summaryrefslogtreecommitdiffstats
path: root/ffi.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-05-06 08:28:21 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-05-06 08:28:21 -0700
commit1e8a60d62a9eb8ef9b8db31b55bfa075fa8c9c7b (patch)
treebbcf31efb9a9d6e0143ba4c982544d20e885ba19 /ffi.c
parent71f5557c94eedb766a5140776c5f377c6d222caa (diff)
downloadtxr-1e8a60d62a9eb8ef9b8db31b55bfa075fa8c9c7b.tar.gz
txr-1e8a60d62a9eb8ef9b8db31b55bfa075fa8c9c7b.tar.bz2
txr-1e8a60d62a9eb8ef9b8db31b55bfa075fa8c9c7b.zip
ffi: remove unchanging param from make_ffi_pointer.
* ffi.c (make_ffi_type_pointer): The underlying ffi type is always ffi_type_pointer, so the parameter for specifying it is removed, and it is hard-coded. (ffi_type_compile): Remove &ffi_type_pointer argument from a half dozen calls.
Diffstat (limited to 'ffi.c')
-rw-r--r--ffi.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/ffi.c b/ffi.c
index d99e5beb..8052f8dc 100644
--- a/ffi.c
+++ b/ffi.c
@@ -1126,8 +1126,7 @@ static val make_ffi_type_builtin(val syntax, val lisp_type,
return obj;
}
-static val make_ffi_type_pointer(val syntax, val lisp_type,
- cnum size, ffi_type *ft,
+static val make_ffi_type_pointer(val syntax, val lisp_type, cnum size,
void (*put)(struct txr_ffi_type *, val obj,
mem_t *dst, val self),
val (*get)(struct txr_ffi_type *,
@@ -1143,7 +1142,7 @@ static val make_ffi_type_pointer(val syntax, val lisp_type,
val obj = cobj(coerce(mem_t *, tft), ffi_type_s, &ffi_type_ptr_ops);
- tft->ft = ft;
+ tft->ft = &ffi_type_pointer;
tft->syntax = syntax;
tft->lt = lisp_type;
tft->mnames = tft->mtypes = nil;
@@ -1336,42 +1335,36 @@ val ffi_type_compile(val syntax)
} else if (sym == ptr_in_s) {
val target_type = ffi_type_compile(cadr(syntax));
return make_ffi_type_pointer(syntax, cptr_s, sizeof (mem_t *),
- &ffi_type_pointer,
ffi_ptr_in_put, ffi_ptr_get,
ffi_ptr_in_in, ffi_ptr_in_out,
target_type);
} else if (sym == ptr_in_d_s) {
val target_type = ffi_type_compile(cadr(syntax));
return make_ffi_type_pointer(syntax, cptr_s, sizeof (mem_t *),
- &ffi_type_pointer,
ffi_ptr_in_put, ffi_ptr_d_get,
0, ffi_ptr_in_out,
target_type);
} else if (sym == ptr_out_s) {
val target_type = ffi_type_compile(cadr(syntax));
return make_ffi_type_pointer(syntax, cptr_s, sizeof (mem_t *),
- &ffi_type_pointer,
ffi_ptr_out_put, ffi_ptr_get,
ffi_ptr_out_in, ffi_ptr_out_out,
target_type);
} else if (sym == ptr_out_d_s) {
val target_type = ffi_type_compile(cadr(syntax));
return make_ffi_type_pointer(syntax, cptr_s, sizeof (mem_t *),
- &ffi_type_pointer,
ffi_ptr_out_null_put, ffi_ptr_d_get,
ffi_ptr_out_in, ffi_ptr_out_out,
target_type);
} else if (sym == ptr_s) {
val target_type = ffi_type_compile(cadr(syntax));
return make_ffi_type_pointer(syntax, cptr_s, sizeof (mem_t *),
- &ffi_type_pointer,
ffi_ptr_in_put, ffi_ptr_get,
ffi_ptr_out_in, ffi_ptr_out_out,
target_type);
} else if (sym == ptr_out_s_s) {
val target_type = ffi_type_compile(cadr(syntax));
return make_ffi_type_pointer(syntax, cptr_s, sizeof (mem_t *),
- &ffi_type_pointer,
ffi_ptr_out_null_put, ffi_ptr_get,
ffi_ptr_out_s_in, ffi_ptr_out_out,
target_type);