From ac14e0f1adeb637cf7c393b42f50bf0cab6dc756 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 15 May 2017 06:16:23 -0700 Subject: ffi and utf8: C++ fixes. * ffi.c (ffi_varray_alloc, ffi_char_array_put): Use cnum type consistently to avoid signed/unsigned comparison warning from g++. (ffi_closure_dispatch_safe): Put block of code into a braced statement so that the macro-generated switch case branch isn't crossing the initialization of a variable. Also, convert cast added where we are passing a void * to a mem_* parameter. * utf8.c (utf8_dup_from): Fix coerce macros being used to strip qualifiers, not only convert type. --- utf8.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'utf8.c') diff --git a/utf8.c b/utf8.c index 37d4bf73..ecd3c01b 100644 --- a/utf8.c +++ b/utf8.c @@ -202,9 +202,9 @@ size_t utf8_to(char *dst, const wchar_t *wsrc) wchar_t *utf8_dup_from(const char *str) { size_t len = strlen(str); - size_t nchar = utf8_from_buf(0, coerce(unsigned char *, str), len); + size_t nchar = utf8_from_buf(0, coerce(const unsigned char *, str), len); wchar_t *wstr = chk_wmalloc(nchar); - utf8_from_buf(wstr, coerce(unsigned char *, str), len); + utf8_from_buf(wstr, coerce(const unsigned char *, str), len); return wstr; } -- cgit v1.2.3