summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-04-28 22:33:15 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-04-28 22:33:15 -0700
commit2b3b6a6d63de081df42063b907731048406d1cbd (patch)
tree5ccd29afcb2e47775faec125aa30c220cc5a99ac
parenta8dabad7c21bd7dd5d5744f3e4f55cea683bd977 (diff)
downloadtxr-2b3b6a6d63de081df42063b907731048406d1cbd.tar.gz
txr-2b3b6a6d63de081df42063b907731048406d1cbd.tar.bz2
txr-2b3b6a6d63de081df42063b907731048406d1cbd.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.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ffi.c b/ffi.c
index 2d2aa476..c4aa17e6 100644
--- a/ffi.c
+++ b/ffi.c
@@ -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"),