diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-05-15 06:16:23 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-05-15 06:16:23 -0700 |
commit | ac14e0f1adeb637cf7c393b42f50bf0cab6dc756 (patch) | |
tree | fa9a7eb953d5d20b2bea6ef7cd28232889104657 /utf8.c | |
parent | 657c6fedce9c743e46badcc4457a1fbaa8901d7e (diff) | |
download | txr-ac14e0f1adeb637cf7c393b42f50bf0cab6dc756.tar.gz txr-ac14e0f1adeb637cf7c393b42f50bf0cab6dc756.tar.bz2 txr-ac14e0f1adeb637cf7c393b42f50bf0cab6dc756.zip |
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.
Diffstat (limited to 'utf8.c')
-rw-r--r-- | utf8.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; } |