1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 11:50:28 +02:00
Commit graph

11 commits

Author SHA1 Message Date
Mark H Weaver
ef405f8ba7 Fix <TAG>vector-length when applied to other uniform vector types
* module/srfi/srfi-4.scm, module/srfi/srfi-4/gnu.scm
  (define-bytevector-type): Fix definition of <TAG>vector-length when
  applied to uniform vectors of different element sizes.  Thanks to
  Tobias Brandt <tob.brandt@googlemail.com> for reporting this bug.

* test-suite/tests/srfi-4.test: Add tests.
2012-03-01 16:16:18 -05:00
Ludovic Courtès
4bc95fccad Add type and range checks to the complex generalized vector accessors.
* libguile/bytevectors.c (COMPLEX_ACCESSOR_PROLOGUE, COMPLEX_NATIVE_REF,
  COMPLEX_NATIVE_SET): New macros.
  (bytevector_ref_c32, bytevector_ref_c64): Defined in terms of
  `COMPLEX_NATIVE_REF'.
  (bytevector_set_c32, bytevector_set_c64): Defined in terms of
  `COMPLEX_NATIVE_SET'.
  (bytevector_ref_fns): Make `static'.

* test-suite/tests/srfi-4.test ("c32 vectors")["generalized-vector-ref",
  "generalized-vector-set!", "generalized-vector-ref, out-of-range",
  "generalized-vector-set!, out-of-range"]: New tests.
  ("c64 vectors")["generalized-vector-ref", "generalized-vector-set!",
  "generalized-vector-ref, out-of-range",
  "generalized-vector-set!, out-of-range"]: New tests.
2011-07-01 19:09:29 +02:00
Andy Wingo
39bed56f67 fix c32vector-set!, c64vector-set!
* module/srfi/srfi-4/gnu.scm (bytevector-c32-native-set!):
  (bytevector-c64-native-set!): Fix to actually allow complex numbers.

* test-suite/tests/srfi-4.test: Add tests.
2011-04-01 16:45:58 +02:00
Mark H Weaver
73ea546c51 Fix bytevectors VALIDATE_REAL to test for reals, not rationals
Reported and fixed by Daniel Llorens <dll@bluewin.ch>.

* libguile/bytevectors.c (VALIDATE_REAL): Test for reals, not rationals.

* test-suite/tests/srfi-4.test (f32 vectors, f64 vectors): Add tests.
2011-03-08 17:50:47 -05:00
Ludovic Courtès
d900a8557d Fix off-by-one error when initializing vectors in `make-srfi-4-vector'.
* libguile/srfi-4.c (scm_make_srfi_4_vector): When FILL is bound and
  non-zero, initialize the last element.

* test-suite/tests/srfi-4.test ("TAG vectors")["make-TAGvector"]: New
  tests.
2010-03-02 23:16:26 +01:00
Andy Wingo
09834e439b fix bug in generalized-vector->list
* libguile/generalized-vectors.c (scm_generalized_vector_to_list): Fix
  bug iterating over indices of array. Thanks to Tristan Colgate for the
  report.

* test-suite/tests/srfi-4.test: Add tests that uniform-vector->list
  works for all kinds of uniform vectors.
2010-01-03 12:37:07 +01:00
Neil Jerram
53befeb700 Change Guile license to LGPLv3+
(Not quite finished, the following will be done tomorrow.
   module/srfi/*.scm
   module/rnrs/*.scm
   module/scripts/*.scm
   testsuite/*.scm
   guile-readline/*
)
2009-06-17 00:22:09 +01:00
Kevin Ryde
6e7d5622ee merge from 1.8 branch 2006-04-16 23:37:40 +00:00
Marius Vollmer
92205699d0 The FSF has a new address. 2005-05-23 19:57:22 +00:00
Marius Vollmer
f16f4d3cae Use (test-suite lib) module. 2005-01-07 00:31:36 +00:00
Martin Grabmüller
39cb0b041d * tests/srfi-4.test: New file. 2001-06-27 13:17:12 +00:00