summaryrefslogtreecommitdiff
path: root/libguile/uniform.c
Commit message (Expand)AuthorAgeFilesLines
* Merge commit 'fb7dd00169304a5922838e4d2f25253640a35def'...This commit also renames uniform-vector-element-type-code to array-type-code. Conflicts: libguile/uniform.c libguile/uniform.h test-suite/tests/arrays.test Andy Wingo2014-02-081-172/+0
|\
| * Deprecate general "uniform-vector" interface...* libguile/uniform.h: * libguile/uniform.c (scm_is_uniform_vector, scm_uniform_vector_p) (scm_c_uniform_vector_length, scm_uniform_vector_length) (scm_uniform_vector_element_type, scm_uniform_vector_element_size) (scm_c_uniform_vector_ref, scm_uniform_vector_ref): (scm_c_uniform_vector_set_x, scm_uniform_vector_set_x): (scm_uniform_vector_to_list) (scm_uniform_vector_elements, scm_uniform_vector_writable_elements): Deprecate. This interface lacked both generality and specificity. The general replacement is array-length, array-ref, and friends on the scheme side, or the array handle interface on the C side. On the specific side of things, there are the specific bytevector, srfi-4, and bitvector interfaces. * test-suite/tests/arrays.test: * test-suite/tests/bitvectors.test: * test-suite/tests/ports.test: * test-suite/tests/srfi-4.test: Update to use array interfaces. * doc/ref/api-foreign.texi (Void Pointers and Byte Access): * doc/ref/srfi-modules.texi (SRFI-4): Update. Andy Wingo2014-02-081-1/+58
* | Don't use generalized-vector functions in uniform.c...* libguile/uniform.c (scm_is_uniform_vector): Replace scm_is_generalized_vector and scm_generalized_vector_get_handle by scm_is_array and manual rank check. (scm_c_uniform_vector_length): Use scm_c_array_length. (scm_c_uniform_vector_ref): Use scm_c_array_ref_1. (scm_c_uniform_vector_set): Use scm_c_array_set_1_x. (scm_uniform_vector_writable_elements): Use scm_array_get_handle, and assert that the rank is 1. * test-suite/test/arrays.test: Rename the uniform-vector-ref block to uniform-vector. Exercise uniform-vector-length and shared arrays remaining uniform. Modifications by Andy Wingo <wingo@pobox.com>. Daniel Llorens2014-02-061-13/+14
* | Support serialization of uniform vector literals...* libguile/uniform.h: * libguile/uniform.c (scm_uniform_vector_element_type_code): New interface, returns a type code as an integer. * module/system/vm/assembler.scm (<uniform-vector-backing-store>) (simple-vector?, uniform-array?, statically-allocatable?) (intern-constant, link-data, link-constants): Support uniform arrays, and punt on vectors aren't contiguous from 0. Support for general arrays will come later. * test-suite/tests/rtl.test ("load-constant"): Add tests. Andy Wingo2013-10-311-0/+19
|/
* deprecate generalized vectors in favor of arrays...* libguile/generalized-arrays.h: * libguile/generalized-arrays.c (scm_c_array_length): (scm_array_length): New functions. * module/ice-9/deprecated.scm: * libguile/generalized-vectors.c: * libguile/generalized-vectors.h: * libguile/deprecated.h: * libguile/deprecated.c (scm_generalized_vector_p) (scm_generalized_vector_length, scm_generalized_vector_ref) (scm_generalized_vector_set_x, scm_generalized_vector_to_list): Deprecate. * libguile/uniform.c (scm_uniform_vector_to_list): Use scm_array_to_list. * module/ice-9/boot-9.scm (case): Arrays are generalized vectors. * module/srfi/srfi-4/gnu.scm (define-any->vector): Use the array functions instead of the generalized-vector functions. * test-suite/tests/arrays.test: Remove generalized-vector->list test; covered by array->list test. * test-suite/tests/bitvectors.test: * test-suite/tests/bytevectors.test: * test-suite/tests/srfi-4.test: Adapt to test using array interfaces instead of generalized-vector interfaces. * doc/ref/api-compound.texi: Remove generalized vector docs. * doc/ref/api-data.texi: * doc/ref/srfi-modules.texi: Adapt. Andy Wingo2013-02-181-2/+2
* fix typos in the manual bits generated from source comments....* libguile/bitvectors.c, libguile/chars.c, libguile/deprecated.c, libguile/numbers.c, libguile/random.c, libguile/read.c, libguile/root.c, libguile/srfi-1.c, libguile/srfi-13.c, libguile/srfi-14.c, libguile/uniform.c: Fix typos, add missing newlines. Ralf Wildenhues2011-02-091-2/+2
* bitvector work...* test-suite/Makefile.am: * test-suite/tests/bitvectors.test: Add a new file to test bitvectors. * libguile/uniform.c (scm_c_uniform_vector_length): Don't call scm_uniform_vector_elements, as we don't need to be able to access the elements with pointers to bytes. Fixes uniform-vector-length on bitvectors. Andy Wingo2010-08-291-8/+6
* Remove unneeded #include <assert.h>....* libguile/backtrace.c, libguile/eval.c, libguile/gc.c, libguile/goops.c, libguile/memoize.c, libguile/threads.c, libguile/uniform.c, libguile/vm.c, test-suite/standalone/test-conversion.c, test-suite/standalone/test-list.c: Don't include <assert.h>. Ludovic Courtès2009-12-151-2/+0
* fix bitvectors after the array handle refactoring...* libguile/uniform.h (scm_array_handle_uniform_element_bit_size): New public accessor. * libguile/uniform.c (scm_array_handle_uniform_element_size): Better errors in non-byte-aligned arrays. (scm_uniform_vector_element_type, scm_uniform_vector_element_size) (scm_c_uniform_vector_ref, scm_c_uniform_vector_set_x): (scm_uniform_vector_to_list): Don't require byte-aligned access. * libguile/bytevectors.c (scm_uniform_array_to_bytevector): * libguile/arrays.c (scm_from_contiguous_typed_array): Fix for uniform arrays whose element size is not a multiple of the byte size. Andy Wingo2009-09-181-30/+26
* uniform vector functions to their own file...* libguile/uniform.c: * libguile/uniform.h: * libguile/srfi-4.c: * libguile/srfi-4.h: * libguile/Makefile.am: Move uniform vector funcs out of srfi-4 to their own file. * libguile.h: * libguile/arrays.c: * libguile/bytevectors.c: Update includers. Andy Wingo2009-07-191-0/+254