diff options
-rw-r--r-- | ice-9/ChangeLog | 7 | ||||
-rw-r--r-- | ice-9/deprecated.scm | 2 | ||||
-rw-r--r-- | libguile/ChangeLog | 7 | ||||
-rw-r--r-- | libguile/unif.c | 12 |
4 files changed, 27 insertions, 1 deletions
diff --git a/ice-9/ChangeLog b/ice-9/ChangeLog index 74e941028..00f11c603 100644 --- a/ice-9/ChangeLog +++ b/ice-9/ChangeLog @@ -1,3 +1,10 @@ +2006-02-12 Marius Vollmer <mvo@zagadka.de> + + * deprecated.scm (make-uniform-array): Don't pass the prototype as + the fill value, dimensions->uniform-array will do the right thing + now. See scm_dimensions_to_uniform_array why we need to be tricky + about the fill value. + 2006-02-04 Neil Jerram <neil@ossau.uklinux.net> * boot-9.scm (try-module-autoload): Make sure that module code is diff --git a/ice-9/deprecated.scm b/ice-9/deprecated.scm index 4eab976c0..91f4d7445 100644 --- a/ice-9/deprecated.scm +++ b/ice-9/deprecated.scm @@ -174,7 +174,7 @@ (define make-uniform-vector dimensions->uniform-array) (define (make-uniform-array prot . bounds) - (dimensions->uniform-array bounds prot prot)) + (dimensions->uniform-array bounds prot)) (define (list->uniform-vector prot lst) (list->uniform-array 1 prot lst)) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 248ee9dca..af7502e2e 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,10 @@ +2006-02-12 Marius Vollmer <mvo@zagadka.de> + + * unif.c (scm_dimensions_to_uniform_array): Use the prototype for + filling when the fill parameter is omitted, as documented, but + turn #\nul into 0 since s8 arrays (signified by a #\nul prototype) + can not store characters. + 2006-02-09 Neil Jerram <neil@ossau.uklinux.net> * socket.c (scm_c_make_socket_address): Pass address_size pointer diff --git a/libguile/unif.c b/libguile/unif.c index 1cdc47895..14438b5f6 100644 --- a/libguile/unif.c +++ b/libguile/unif.c @@ -796,6 +796,18 @@ SCM_DEFINE (scm_dimensions_to_uniform_array, "dimensions->uniform-array", 2, 1, if (scm_is_integer (dims)) dims = scm_list_1 (dims); + + if (SCM_UNBNDP (fill)) + { + /* Using #\nul as the prototype yields a s8 array, but numeric + arrays can't store characters, so we have to special case this. + */ + if (scm_is_eq (prot, SCM_MAKE_CHAR (0))) + fill = scm_from_int (0); + else + fill = prot; + } + return scm_make_typed_array (prototype_to_type (prot), fill, dims); } #undef FUNC_NAME |