diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-05-20 07:28:31 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-05-20 07:28:31 -0700 |
commit | 4b949beae1a22e2e4f9d9a61502754ae1bcfbd70 (patch) | |
tree | 62241c542a104e6757184b9386ca36c7bd7354e7 | |
parent | a6a5a200aff519d458d5582fdab776e30af40efc (diff) | |
download | txr-4b949beae1a22e2e4f9d9a61502754ae1bcfbd70.tar.gz txr-4b949beae1a22e2e4f9d9a61502754ae1bcfbd70.tar.bz2 txr-4b949beae1a22e2e4f9d9a61502754ae1bcfbd70.zip |
ffi: reorder initializations in carray-buf.
* ffi.c (carray_buf): Do the buf_get first, then
length_buf, since buf_get takes a self argument.
This way the diagnostic is better if the object
isn't a buf.
-rw-r--r-- | ffi.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2608,8 +2608,8 @@ val carray_blank(val nelem, val type) val carray_buf(val buf, val type) { val self = lit("carray-buf"); - cnum blen = c_num(length_buf(buf)); mem_t *data = buf_get(buf, self); + cnum blen = c_num(length_buf(buf)); struct txr_ffi_type *tft = ffi_type_struct(type); cnum nelem = if3(tft->size, blen / tft->size, 0); return make_carray(type, data, nelem, buf); |