mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
Merge branch 'master' into boehm-demers-weiser-gc
Conflicts: lib/Makefile.am libguile/Makefile.am libguile/frames.c libguile/gc-card.c libguile/gc-freelist.c libguile/gc-mark.c libguile/gc-segment.c libguile/gc_os_dep.c libguile/load.c libguile/macros.c libguile/objcodes.c libguile/programs.c libguile/strings.c libguile/vm.c m4/gnulib-cache.m4 m4/gnulib-comp.m4 m4/inline.m4
This commit is contained in:
commit
fbb857a472
823 changed files with 61674 additions and 14111 deletions
|
@ -1,20 +1,21 @@
|
|||
/* srfi-4.c --- Uniform numeric vector datatypes.
|
||||
*
|
||||
* Copyright (C) 2001, 2004, 2006 Free Software Foundation, Inc.
|
||||
* Copyright (C) 2001, 2004, 2006, 2009 Free Software Foundation, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation; either version 3 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* This library is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
@ -28,6 +29,7 @@
|
|||
#include "libguile/_scm.h"
|
||||
#include "libguile/__scm.h"
|
||||
#include "libguile/srfi-4.h"
|
||||
#include "libguile/bytevectors.h"
|
||||
#include "libguile/error.h"
|
||||
#include "libguile/read.h"
|
||||
#include "libguile/ports.h"
|
||||
|
@ -580,6 +582,8 @@ scm_i_generalized_vector_type (SCM v)
|
|||
return scm_sym_b;
|
||||
else if (scm_is_uniform_vector (v))
|
||||
return scm_from_locale_symbol (uvec_tags[SCM_UVEC_TYPE(v)]);
|
||||
else if (scm_is_bytevector (v))
|
||||
return scm_from_locale_symbol ("vu8");
|
||||
else
|
||||
return SCM_BOOL_F;
|
||||
}
|
||||
|
@ -721,6 +725,8 @@ scm_array_handle_uniform_element_size (scm_t_array_handle *h)
|
|||
vec = SCM_I_ARRAY_V (vec);
|
||||
if (scm_is_uniform_vector (vec))
|
||||
return uvec_sizes[SCM_UVEC_TYPE(vec)];
|
||||
if (scm_is_bytevector (vec))
|
||||
return 1U;
|
||||
scm_wrong_type_arg_msg (NULL, 0, h->array, "uniform array");
|
||||
}
|
||||
|
||||
|
@ -761,6 +767,8 @@ scm_array_handle_uniform_writable_elements (scm_t_array_handle *h)
|
|||
char *elts = SCM_UVEC_BASE (vec);
|
||||
return (void *) (elts + size*h->base);
|
||||
}
|
||||
if (scm_is_bytevector (vec))
|
||||
return SCM_BYTEVECTOR_CONTENTS (vec);
|
||||
scm_wrong_type_arg_msg (NULL, 0, h->array, "uniform array");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue