diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-05-04 06:46:52 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-05-04 06:46:52 -0700 |
commit | 5810e55fb63872657f2e5598313684f5341b382a (patch) | |
tree | fa65fd0825218195ea638a43050110dd79b5b028 /ffi.c | |
parent | 31319bcda188159ba0b453e0b1a328b76c253ab2 (diff) | |
download | txr-5810e55fb63872657f2e5598313684f5341b382a.tar.gz txr-5810e55fb63872657f2e5598313684f5341b382a.tar.bz2 txr-5810e55fb63872657f2e5598313684f5341b382a.zip |
ffi: remove redundant function.
* ffi.c (ffi_str_d_put): Function removed. It is identical to
ffi_str_put.
(ffi_init_types): Use ffi_str_put for the str-d type.
Diffstat (limited to 'ffi.c')
-rw-r--r-- | ffi.c | 15 |
1 files changed, 1 insertions, 14 deletions
@@ -569,19 +569,6 @@ static void ffi_str_put(struct txr_ffi_type *tft, val s, mem_t *dst, } } -static void ffi_str_d_put(struct txr_ffi_type *tft, val s, mem_t *dst, - val self) -{ - if (s == nil) { - *coerce(const char **, dst) = 0; - } else { - const wchar_t *ws = c_str(s); - char *u8s = utf8_dup_to(ws); - *coerce(const char **, dst) = u8s; - } -} - - static val ffi_str_get(struct txr_ffi_type *tft, mem_t *src, val self) { const char *p = *coerce(const char **, src); @@ -1440,7 +1427,7 @@ static void ffi_init_types(void) ffi_typedef(str_d_s, make_ffi_type_builtin(str_d_s, str_s, sizeof (mem_t *), &ffi_type_pointer, - ffi_str_d_put, ffi_str_d_get)); + ffi_str_put, ffi_str_d_get)); ffi_typedef(wstr_s, make_ffi_type_builtin(wstr_s, str_s, sizeof (mem_t *), &ffi_type_pointer, ffi_wstr_put, ffi_wstr_get)); |