diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-04-28 22:33:15 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-04-28 22:33:15 -0700 |
commit | e5174a9dac601791af64903f44b8ab4a5e82621e (patch) | |
tree | 5ccd29afcb2e47775faec125aa30c220cc5a99ac | |
parent | ce6d4ca76af3c5f10cd90b9c2a974f63fa1187e2 (diff) | |
download | txr-e5174a9dac601791af64903f44b8ab4a5e82621e.tar.gz txr-e5174a9dac601791af64903f44b8ab4a5e82621e.tar.bz2 txr-e5174a9dac601791af64903f44b8ab4a5e82621e.zip |
ffi: assign better Lisp types to some ffi types.
* ffi.c (ffi_type_compile): Type descriptors for str,
wstr, buf and void are being tagged with the Lisp type cptr.
Let's give them str, str, buf and null, respectively.
-rw-r--r-- | ffi.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1232,7 +1232,7 @@ val ffi_type_compile(val syntax) tft->free = ffi_noop_free; return type; } else if (syntax == str_s) { - val type = make_ffi_type_builtin(syntax, cptr_s, sizeof (mem_t *), + val type = make_ffi_type_builtin(syntax, str_s, sizeof (mem_t *), &ffi_type_pointer, ffi_str_put, ffi_str_get); struct txr_ffi_type *tft = ffi_type_struct(type); @@ -1240,11 +1240,11 @@ val ffi_type_compile(val syntax) tft->rtsize = 1; return type; } else if (syntax == wstr_s) { - return make_ffi_type_builtin(syntax, cptr_s, sizeof (mem_t *), + return make_ffi_type_builtin(syntax, str_s, sizeof (mem_t *), &ffi_type_pointer, ffi_wstr_put, ffi_wstr_get); } else if (syntax == buf_s) { - val type = make_ffi_type_builtin(syntax, cptr_s, sizeof (mem_t *), + val type = make_ffi_type_builtin(syntax, buf_s, sizeof (mem_t *), &ffi_type_pointer, ffi_buf_put, ffi_void_get); struct txr_ffi_type *tft = ffi_type_struct(type); @@ -1252,7 +1252,7 @@ val ffi_type_compile(val syntax) tft->free = ffi_noop_free; return type; } else if (syntax == void_s) { - return make_ffi_type_builtin(syntax, nil, 0, &ffi_type_void, + return make_ffi_type_builtin(syntax, null_s, 0, &ffi_type_void, ffi_void_put, ffi_void_get); } else { uw_throwf(error_s, lit("~a: bad type syntax: ~!~s"), |