summaryrefslogtreecommitdiffstats
path: root/ffi.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-05-04 06:46:52 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-05-04 06:46:52 -0700
commit5810e55fb63872657f2e5598313684f5341b382a (patch)
treefa65fd0825218195ea638a43050110dd79b5b028 /ffi.c
parent31319bcda188159ba0b453e0b1a328b76c253ab2 (diff)
downloadtxr-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.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/ffi.c b/ffi.c
index 234ff2ab..0c9bb9b2 100644
--- a/ffi.c
+++ b/ffi.c
@@ -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));