summaryrefslogtreecommitdiff
path: root/libguile/uniform.c
AgeCommit message (Collapse)AuthorFilesLines
2014-01-27Rename scm_t_array_handle.array to .rootDaniel Llorens1-5/+5
Globally rename this field (after shared-array-root), since it's not an array.
2014-01-27Have array impl->vref, vset take SCM, not handlesDaniel Llorens1-2/+4
* libguile/array-handle.h - scm_i_t_array_ref, scm_i_t_array_set take SCM. - scm_array_handle_ref, scm_array_handle_set: pass h->array. * libguile/array-map.c - AREF, ASET, rafill, racp, ramap, rafe: pass storage vector SCM instead of handle. * libguile/bitvector.c - bitvector_handle_ref, bitvector_handle_set_x: take bitvector arg. * libguile/bytevectors.c - bv_handle_ref, bv_handle_set_x: take bytevector arg. - scm_i_print_bytevectors: don't use array handles. * libguile/deprecated.c - scm_generalized_vector_to_list: pass h.array. * libguile/strings.c - string_handle_ref, string_handle_set: take string arg. * libguile/uniform.c - scm_c_uniform_vector_ref, scm_c_uniform_vector_set_x: pass h.array. * libguile/vectors.c - vector_handle_ref, vector_handle_set: take vector arg.
2014-01-27Match uniform_vector_elements with vector_elementsDaniel Llorens1-12/+12
* libguile/vectors.c - (scm_vector_writable_elements): allow any non-uniform rank 1 array, after the doc. Match the implementation with scm_uniform_vector_elements. - (scm_vector_elements): after the above. * libguile/uniform.c - (scm_uniform_vector_writable_elements): ditto for uniform rank 1 arrays. * libguile/sort.c - revert the changes in 7a6fd9, except for the argument type test; allow what scm_vector_(writable_)elements allows.
2014-01-27For uniform vectors SCM_I_ARRAYP can't be trueDaniel Llorens1-6/+5
This fixes an inconsistency where uniform-vector? of a shared array could be true but -ref operations failed to account correctly for lbnd. * libguile/uniform.c - scm_is_uniform_vector: SCM_I_ARRAYP disqualifies obj as uniform vector. - scm_c_uniform_vector_length: lbnd is known 0, so don't use it. - scm_c_uniform_vector_ref: lbnd/base/inc are known to be 0/0/1. - scm_c_uniform_vector_set_x!: idem. - scm_uniform_vector_writable_elements: check uvec's type. * test-suite/tests/arrays.test - group the exception types at the top. - check that uniform-vector functions do not accept general arrays.
2014-01-27Don't use generalized-vector functions in uniform.cDaniel Llorens1-10/+31
* 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): inline length computation. This removes a redundant rank check. - (scm_c_uniform_vector_ref): inline impl->vref use. This removes a redundant rank check. - (scm_c_uniform_vector_set): inline impl->vset use. This removes a redundant rank check. - (scm_uniform_vector_writable_elements): replace scm_generalized_vector_get_handle by scm_array_get_handle. * test-suite/test/arrays.test - rename uniform-vector-ref block to uniform-vector. - exercise uniform-vector-length and shared arrays remaining uniform.
2013-10-31Support serialization of uniform vector literalsAndy Wingo1-0/+19
* 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.
2013-02-18deprecate generalized vectors in favor of arraysAndy Wingo1-2/+2
* 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.
2011-02-09fix typos in the manual bits generated from source comments.Ralf Wildenhues1-2/+2
* 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.
2010-08-29bitvector workAndy Wingo1-8/+6
* 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.
2009-12-15Remove unneeded #include <assert.h>.Ludovic Courtès1-2/+0
* 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>.
2009-09-18fix bitvectors after the array handle refactoringAndy Wingo1-30/+26
* 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.
2009-07-19uniform vector functions to their own fileAndy Wingo1-0/+254
* 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.