summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-04-29 09:41:24 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-04-29 09:41:24 -0700
commit8a20c4af0ae40dd28fb351a49e14892070c1eae1 (patch)
tree105fabb65234d70bfdfb0cfabd08cb974b14ac16
parent20d0c961509adc3a513c48461024e403bb1bc989 (diff)
downloadtxr-8a20c4af0ae40dd28fb351a49e14892070c1eae1.tar.gz
txr-8a20c4af0ae40dd28fb351a49e14892070c1eae1.tar.bz2
txr-8a20c4af0ae40dd28fb351a49e14892070c1eae1.zip
ffi: rename ptr-in-out to just ptr.
Why have this verbose naming for the most basic case. Rather, ptr-in and ptr-out are optimizations of ptr which just avoid copying the object in one direction. * ffi.c (ptr_in_out_s): Renamed to ptr_s. (ffi_ptr_in_out_put): Renamed to ffi_ptr_put. (ffi_type_compile, ffi_init): Follow rename. * ffi.h (ptr_in_out_s): Declaration updated
-rw-r--r--ffi.c12
-rw-r--r--ffi.h2
2 files changed, 7 insertions, 7 deletions
diff --git a/ffi.c b/ffi.c
index 7af6dda7..3159d2d0 100644
--- a/ffi.c
+++ b/ffi.c
@@ -74,7 +74,7 @@ val str_d_s, wstr_s, wstr_d_s;
val buf_d_s;
-val ptr_in_s, ptr_out_s, ptr_in_out_s;
+val ptr_in_s, ptr_out_s, ptr_s;
val ffi_type_s, ffi_call_desc_s;
@@ -750,8 +750,8 @@ static val ffi_ptr_out_get(struct txr_ffi_type *tft, mem_t *src, val self)
return tgtft->get(tgtft, ptr, self);
}
-static void ffi_ptr_in_out_put(struct txr_ffi_type *tft, val s, mem_t *dst,
- mem_t *rtvec[], val self)
+static void ffi_ptr_put(struct txr_ffi_type *tft, val s, mem_t *dst,
+ mem_t *rtvec[], val self)
{
val tgttype = tft->mtypes;
struct txr_ffi_type *tgtft = ffi_type_struct(tgttype);
@@ -1153,11 +1153,11 @@ val ffi_type_compile(val syntax)
&ffi_type_pointer,
ffi_ptr_out_put, ffi_ptr_out_get,
ffi_ptr_out_in, target_type);
- } else if (sym == ptr_in_out_s) {
+ } 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_out_put, ffi_ptr_out_get,
+ ffi_ptr_put, ffi_ptr_out_get,
ffi_ptr_out_in, target_type);
} else if (sym == buf_s || sym == buf_d_s) {
cnum nelem = c_num(cadr(syntax));
@@ -1491,7 +1491,7 @@ void ffi_init(void)
buf_d_s = intern(lit("buf-d"), user_package);
ptr_in_s = intern(lit("ptr-in"), user_package);
ptr_out_s = intern(lit("ptr-out"), user_package);
- ptr_in_out_s = intern(lit("ptr-in-out"), user_package);
+ ptr_s = intern(lit("ptr"), user_package);
ffi_type_s = intern(lit("ffi-type"), user_package);
ffi_call_desc_s = intern(lit("ffi-call-desc"), user_package);
reg_fun(intern(lit("ffi-type-compile"), user_package), func_n1(ffi_type_compile_toplevel));
diff --git a/ffi.h b/ffi.h
index 99c87a28..27e9bc10 100644
--- a/ffi.h
+++ b/ffi.h
@@ -41,7 +41,7 @@ extern val str_d_s, wstr_s, wstr_d_s;
extern val buf_d_s;
-extern val ptr_in_s, ptr_out_s, ptr_in_out_s;
+extern val ptr_in_s, ptr_out_s, ptr_s;
extern val array_s;