mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
* 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. * 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.
This commit is contained in:
parent
d7c6575f3f
commit
1aaa1c171e
4 changed files with 27 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue