1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-02 21:10:27 +02:00
Commit graph

4914 commits

Author SHA1 Message Date
Kevin Ryde
c4cb76284e *** empty log message *** 2005-01-04 00:37:34 +00:00
Kevin Ryde
168e958cb8 (scm_strftime): Free t.tm_zone produced by bdtime2c.
Reported by Bill Schottstaedt.
2005-01-04 00:35:48 +00:00
Marius Vollmer
0fb1d2642c Hard code SCM_HAVE_ARRAYS to "1", for real now. 2005-01-02 21:04:50 +00:00
Marius Vollmer
0356881d32 *** empty log message *** 2005-01-02 20:50:28 +00:00
Marius Vollmer
4057a3e05a Use new vector elements API or simple vector API, as appropriate.
Removed SCM_HAVE_ARRAYS ifdefery.  Replaced all uses of
SCM_HASHTABLE_BUCKETS with SCM_HASHTABLE_BUCKET.
2005-01-02 20:49:04 +00:00
Marius Vollmer
f60539dba4 (SCM_VALIDATE_VECTOR, SCM_VALIDATE_VECTOR_OR_DVECTOR): use
scm_is_simple_vector instead of SCM_VECTORP.
2005-01-02 20:46:03 +00:00
Marius Vollmer
cb26f5696c * sort.c (quicksort): Added INC parameter for non-contigous
vectors.
(quicksort1): New, for contigous vectors.  Both functions are
generated from the same code by including "quicksort.i.c".
(scm_restricted_vector_sort_x): Call one of quicksort and
quicksort1, depending on increment of vector.
(scm_sort): Simply call scm_sort_x on a copy of the list or
vector.
(scm_merge_vector_x, scm_merge_vector_step): Changed indices to
size_t, added inc parameter.
(scm_stable_sort_x): Allocate temporary storage as Scheme vector
so that it doesn't leak.
(scm_stable_sort): Simply call scm_stable_sort_x on a copy of the
list or vector.

* tags.h, weaks.c, vports.c, hashtab.c, convert.c, sort.c: Use new
vector elements API or simple vector API, as appropriate.  Removed
SCM_HAVE_ARRAYS ifdefery.  Replaced all uses of
SCM_HASHTABLE_BUCKETS with SCM_HASHTABLE_BUCKET.
2005-01-02 20:45:07 +00:00
Marius Vollmer
5d916ba3f0 * ramap.c (scm_array_map_x): Do not try to convert fill value
before filling, any necessary conversion is done while storing.
2005-01-02 20:25:26 +00:00
Marius Vollmer
b8b154fdf9 (scm_i_sweep_card): Call scm_i_vector_free instead of doing it inline. 2005-01-02 20:17:26 +00:00
Marius Vollmer
3ebc1832c7 (SCM_HASHTABLE_BUCKETS): Removed.
(SCM_HASHTABLE_BUCKET, SCM_HASHTABLE_BUCKET_LOC): New.  Replaced
all uses of SCM_HASHTABLE_BUCKETS with SCM_HASHTABLE_BUCKET.
2005-01-02 20:11:15 +00:00
Marius Vollmer
6e708ef2b1 * weaks.c: Use new vector elements API or simple vector
API, as appropriate.

* srfi-4.h, srfi-4.c, srfi-4.i.c (scm_array_handle_uniform_elements,
scm_array_handle_uniform_writable_elements,
scm_uniform_vector_elements, scm_uniform_vector_writable_elements):
(scm_<foo>vector_elements, scm_<foo>vector_writable_elements): Use
scm_t_array_handle, deliver length and increment.
(scm_array_handle_<foo>_elements,
scm_array_handle_<foo>_writable_elements): New.

* unif.h, unif.c (scm_t_array_handle, scm_array_get_handle,
scm_array_handle_rank, scm_array_handle_dims, scm_array_handle_ref
scm_array_handle_set, scm_array_handle_elements
scm_array_handle_writable_elements, scm_vector_get_handle): New.
(scm_make_uve, scm_array_prototype, scm_list_to_uniform_array,
scm_dimensions_to_uniform_array): Deprecated for real.  (scm_array_p,
scm_i_array_p): Use latter for SCM_DEFINE since snarfing wont allow a
mismatch between C and Scheme arglists.  (scm_make_shared_array,
scm_enclose_array): Correctly use scm_c_generalized_vector_length
instead of scm_uniform_vector_length.

* weaks.h, weaks.c: Use new internal weak vector API from
vectors.h.

* Makefile.am (libguile_la_SOURCES, DOT_X_FILES, DOT_DOC_FILES,
EXTRA_libguile_la_SOURCES): Changed ramap.c and unif.c from being
'extra' to being regular sources.
(noinst_HEADERS): Added quicksort.i.c.
* quicksort.i.c: New file.

* vectors.h, vector.c (SCM_VECTORP, SCM_VECTOR_LENGTH, SCM_VELTS,
SCM_WRITABLE_VELTS, SCM_VECTOR_REF, SCM_VECTOR_SET): Deprecated and
reimplemented.  Replaced all uses with scm_vector_elements,
scm_vector_writable_elements, or SCM_SIMPLE_VECTOR_*, as appropriate.
(scm_is_simple_vector, SCM_SIMPLE_VECTOR_LENGTH,
SCM_SIMPLE_VECTOR_REF, SCM_SIMPLE_VECTOR_SET, SCM_SIMPLE_VECTOR_LOC):
New.  (SCM_VECTOR_BASE, SCM_SET_VECTOR_BASE, SCM_VECTOR_MAX_LENGTH,
SCM_MAKE_VECTOR_TAG, SCM_SET_VECTOR_LENGTH, SCM_VELTS_AS_STACKITEMS,
SCM_SETVELTS, SCM_GC_WRITABLE_VELTS): Removed.  (scm_vector_copy):
New.  (scm_vector_elements, scm_vector_writable_elements): Use
scm_t_array_handle, deliver length and increment.  Moved to
unif.h. Changed all uses.  (scm_vector_release_elements,
scm_vector_release_writable_elements,
(scm_frame_vector_release_elements,
scm_frame_vector_release_writable_elements): Removed.
(SCM_I_IS_VECTOR, SCM_I_VECTOR_ELTS, SCM_I_VECTOR_WELTS,
SCM_I_VECTOR_LENGTH, scm_i_vector_free): New internal API.
(SCM_I_WVECTP SCM_I_WVECT_LENGTH SCM_I_WVECT_VELTS
SCM_I_WVECT_GC_WVELTS SCM_I_WVECT_TYPE SCM_I_WVECT_GC_CHAIN
SCM_I_SET_WVECT_GC_CHAIN, scm_i_allocate_weak_vector): New, for weak
vectors.
2005-01-02 20:06:08 +00:00
Marius Vollmer
9c6e33c62a * gen-scmconfig.h.in (SCM_I_GSC_HAVE_ARRAYS): Removed.
* gen-scmconfig.c: Hard code SCM_HAVE_ARRAYS to "1".
2005-01-02 19:43:36 +00:00
Marius Vollmer
9de6f5f176 * Makefile.am (libguile_la_SOURCES, DOT_X_FILES, DOT_DOC_FILES,
EXTRA_libguile_la_SOURCES): Changed ramap.c and unif.c from being
'extra' to being regular sources.
(noinst_HEADERS): Added quicksort.i.c.
* quicksort.i.c: New file.
2005-01-02 19:16:39 +00:00
Marius Vollmer
06f9c81488 * Makefile.am (libguile_la_SOURCES, DOT_X_FILES, DOT_DOC_FILES,
EXTRA_libguile_la_SOURCES): Changed ramap.c and unif.c from being
'extra' to being regular sources.
(noinst_HEADERS): Added quicksort.i.c.
* quicksort.i.c: New file.
2005-01-02 18:55:03 +00:00
Marius Vollmer
0336d18b67 *** empty log message *** 2004-12-29 18:25:00 +00:00
Marius Vollmer
f301dbf34a * srfi-4.h (scm_i_proc_make_u8vector, scm_i_proc_make_s8vector,
scm_i_proc_make_u16vector, scm_i_proc_make_s16vector,
scm_i_proc_make_u32vector, scm_i_proc_make_s32vector,
scm_i_proc_make_u64vector, scm_i_proc_make_s64vector,
scm_i_proc_make_f32vector, scm_i_proc_make_f64vector,
scm_i_proc_make_c32vector, scm_i_proc_make_c64vector,
uvec_proc_vars): Removed.
(scm_i_generalized_vector_creator): Removed.
(scm_i_generalized_vector_type): New.

* unif.h, unif.c (scm_typed_array_p, scm_make_array,
scm_make_typed_array, scm_array_type, scm_list_to_array,
scm_list_to_typed_array, scm_is_array, scm_is_typed_array): New.
(scm_array_creator): Removed.
(scm_array_p): Deprecated second PROT argument.
(scm_dimensions_to_uniform_array, scm_list_to_uniform_array):
Deprecated, reimplemented in terms of scm_make_typed_array and
scm_list_to_typed_array.
(scm_i_proc_make_vector, scm_i_proc_make_string,
scm_i_proc_make_bitvector): Removed.
(type_creator_table, init_type_creator_table, type_to_creator,
make_typed_vector): New.
(scm_i_convert_old_prototype): Removed.
(prototype_to_type): New.
(scm_make_uve): Deprecated, reimplemented using make_typed_vector.
(scm_array_dimensions): Use scm_list_1 instead of scm_cons for
minor added clarity.
(scm_make_shared_array, scm_ra2contig): Use make_typed_vector
instead of scm_make_uve.
(tag_creator_table, scm_i_tag_to_creator): Removed.
(tag_to_type): New.
(scm_i_read_array): Use scm_list_to_typed_array instead of
scm_list_to_uniform_array.
2004-12-29 18:21:55 +00:00
Marius Vollmer
32b2620254 *** empty log message *** 2004-12-27 02:32:37 +00:00
Marius Vollmer
21c487f124 (scm_bitvector_elements): Made return value "const".
(scm_bitvector_writable_elements): New.
(scm_bitvector_release, scm_bitvector_release_elements):
Renamed former to latter.  Added explicit call to
scm_remember_upto_here_1.
(scm_frame_bitvector_release,
scm_frame_bitvector_release_elements): Renamed former to latter.
(scm_bitvector_release_writable_elements,
scm_bitvector_release_writable_elements): New.
Changed all uses as required by the changes above.
2004-12-27 02:28:38 +00:00
Marius Vollmer
d817a70c3d * unif.c (scm_bitvector_release): Added explicit call to
scm_remember_upto_here_1.

(scm_uniform_vector_elements,
scm_u8vector_elements, etc): Made return value "const".
(scm_uniform_vector_writable_elements,
scm_u8vector_writable_elements, etc): New.
(scm_uniform_vector_release, scm_uniform_vector_release_elements):
Renamed former to latter.  Added explicit call to
scm_remember_upto_here_1.
(scm_frame_uniform_vector_release,
scm_frame_uniform_vector_release_elements): Renamed former to latter.
(scm_uniform_vector_release_writable_elements,
scm_frame_uniform_vector_release_writable_elements): New. Takes
crown of longest identifier yet.
Changed all uses as required by the changes above.
2004-12-27 02:11:16 +00:00
Marius Vollmer
b590aceb96 (scm_uniform_vector_elements,
scm_u8vector_elements, etc): Made return value "const".
(scm_uniform_vector_writable_elements,
scm_u8vector_writable_elements, etc): New.
(scm_uniform_vector_release, scm_uniform_vector_release_elements):
Renamed former to latter.  Added explicit call to
scm_remember_upto_here_1.
(scm_frame_uniform_vector_release,
scm_frame_uniform_vector_release_elements): Renamed former to latter.
(scm_uniform_vector_release_writable_elements,
scm_frame_uniform_vector_release_writable_elements): New. Takes
crown of longest identifier yet.
Changed all uses as required by the changes above.
2004-12-27 02:10:14 +00:00
Marius Vollmer
1d0df896c9 (scm_c_vector_set_x): Make return type
void.
(scm_is_vector, scm_vector_p, scm_vector_length,
scm_c_vector_length, scm_vector_ref, scm_c_vector_ref,
scm_vector_set_x, scm_c_vector_set_x, scm_vector_to_list,
scm_vector_move_left_x, scm_vector_move_right_x,
scm_vector_fill_x): handle one-dimensional arrays.
(scm_vector_elements, scm_vector_release_elements,
scm_vector_frame_release_elements, scm_vector_writable_elements,
scm_vector_release_writable_elements,
scm_vector_frame_release_writable_elements): New.
(scm_list_to_vector, scm_vector_to_list, scm_vector_fill,
scm_vector_move_left_x, scm_vector_move_right_x): Use them.
2004-12-27 02:01:21 +00:00
Marius Vollmer
277e847212 *** empty log message *** 2004-12-27 00:11:43 +00:00
Marius Vollmer
ee67e2fa2c (scm_ramapc, scm_raeql): Use
scm_c_generalized_vector_length instead of
scm_uniform_vector_length.
(scm_ramap, rafe): Use scm_c_vector_ref instead of SCM_VELTS.  use
scm_c_generalized_vector_ref instead of scm_uniform_vector_ref.
2004-12-27 00:09:57 +00:00
Marius Vollmer
de5c0f5801 (scm_c_vector_set_x): Make return type
void.
(scm_is_vector, scm_vector_p, scm_vector_length,
scm_c_vector_length, scm_vector_ref, scm_c_vector_ref,
scm_vector_set_x, scm_c_vector_set_x, scm_vector_to_list,
scm_vector_move_left_x, scm_vector_move_right_x,
scm_vector_fill_x): handle one-dimensional arrays.
2004-12-27 00:00:07 +00:00
Marius Vollmer
49c5161012 *** empty log message *** 2004-12-23 15:32:17 +00:00
Marius Vollmer
7f12a94355 (read_frame, read_frames, scm_make_stack, scm_last_stack_frame,
scm_stack_id): Use the new 'offset' member of continuations instead of
calculating the offset ourselves.  Relocate 'vect' member of
scm_t_debug_frame.
2004-12-23 15:30:29 +00:00
Marius Vollmer
5c5c27dc0d (scm_t_contregs): New 'offset' member for relocating debug frames.
(scm_make_continuation): Set it.
2004-12-23 15:30:16 +00:00
Kevin Ryde
3b2ee265fb *** empty log message *** 2004-12-16 00:41:39 +00:00
Kevin Ryde
e96a9fada5 (scm_array_map_x): Check for at least one source argument. 2004-12-15 23:01:32 +00:00
Kevin Ryde
e120686ac0 *** empty log message *** 2004-12-14 00:23:52 +00:00
Kevin Ryde
fdc6aebfaf (string-any, string-every): Use a scheme
wrapper around the C code so for the final call to the predicate
procedure is a tail call, per SRFI-13 spec.
2004-12-14 00:21:25 +00:00
Kevin Ryde
680b523714 *** empty log message *** 2004-12-13 22:40:08 +00:00
Kevin Ryde
4450a22762 More of:
(scm_eq_p, scm_eqv_p, scm_equal_p): Update docstrings from
recent revision to the reference manual.
2004-12-10 00:49:51 +00:00
Kevin Ryde
2b4d15471c (scm_from_ipv6): Just use mpz_import. Don't bother trying
to fit scm_from_ulong_long, since that uses mpz_import anyway.  Don't
bother trying to fit scm_from_ulong, not really worth the trouble if
addresses are more than 4 bytes usually.
2004-12-10 00:41:33 +00:00
Kevin Ryde
66b1c775d2 (scm_modulo): Amend fixme comment about negative divisor
with "%", C99 says it's well-defined.
2004-12-10 00:00:27 +00:00
Kevin Ryde
602d32dd48 (scm_eq_p, scm_eqv_p, scm_equal_p): Update docstrings from
recent revision to the reference manual.
2004-12-09 23:49:46 +00:00
Kevin Ryde
446d320c8e *** empty log message *** 2004-11-29 21:16:54 +00:00
Kevin Ryde
083ff9955e (NetBSD): Test __m68k__ and __arm__ as well as m68k and
arm32.  Reported by Greg Troxel.
2004-11-29 21:13:57 +00:00
Marius Vollmer
f26547600b *** empty log message *** 2004-11-14 00:25:10 +00:00
Marius Vollmer
2d4d7f27ae (scm_i_cvref): Made non-static for ramap.c. 2004-11-14 00:23:08 +00:00
Marius Vollmer
dd893484ec (INCLUDES): It is "@LTDLINCL@", not "@LTDLINC@". 2004-11-14 00:18:26 +00:00
Marius Vollmer
d550e35f37 *** empty log message *** 2004-11-12 19:00:36 +00:00
Marius Vollmer
02339e5b9b (scm_tc16_enclosed_array, SCM_ENCLOSED_ARRAYP):
New.
(exactly_one_third, singp): Removed.
(scm_array_p, scm_array_dimensions, scm_shared_array_root,
scm_shared_array_offset, scm_shared_array_increments): Handle
enclosed arrays explicitely.
(scm_array_rank): Likewise. Also, do not return zero for
non-arrays, signal an error instead since arrays with rank zero do
exist.
(scm_i_make_ra): New, for specifying the tag of the new array.
(scm_make_enclosed_array): Use it.
(scm_make_ra): Reimplemented in terms of scm_i_make_ra.
(scm_make_shared_array): Use scm_c_generalized_vector_length
instead of scm_uniform_vector_length.
(scm_array_in_bounds_p): Rewritten to be much cleaner.
(scm_i_cvref): New, doing the job of scm_cvref.
(scm_cvref): Use scm_i_cvref.
(scm_array_ref): Do not accept non-arrays when no indices are
given. Use scm_i_cvref to do the actual access.
("uniform-array-set1"): Do not register.
(scm_array_set_x, scm_uniform_array_read_x,
scm_uniform_array_write): Handle enclosed arrays explicitly.
(ra2l): Use scm_i_cvref instead of scm_uniform_vector_ref to also
handle enclosed arrays.
(scm_array_to_list): Handle enclosed arrays explicitly.
(rapr1): Removed.
(scm_i_print_array_dimension): Use scm_i_cvref to also handle
enclosed arrays.
(scm_i_print_enclosed_array): New.
(tag_proto_table, tag_creator_table): Renamed former to latter.
Added "a" and "b" for strings and bitvectors, resp.
(scm_i_tag_to_prototype, scm_i_tag_to_creator): Renamed former to
latter.  Tag "a" is in the table now, no need to handle it as a
legacy tag.
(scm_raprin1): Just call scm_iprin1.
(scm_array_creator, scm_array_prototype): Handle enclosed arrays
explicitly.
(scm_init_unif): Initialize scm_tc16_enclosed_array smob.
Use scm_i_print_array as printer for scm_tc16_array.
2004-11-12 18:55:25 +00:00
Marius Vollmer
823086c18b *** empty log message *** 2004-11-10 01:57:04 +00:00
Marius Vollmer
03a5397a53 Changed all uses of scm_array_prototype to
scm_array_creator. (scm_i_get_old_prototype): Signal error when no
prototype is known.
(scm_uniform_array_read_x, scm_uniform_array_write): Reimplemented
in terms of scm_uniform_vector_read_x and
scm_uniform_vector_write, respectively.  Strings and
bitvector support has been dropped.
2004-11-10 01:55:26 +00:00
Marius Vollmer
b4b3363620 (cind): Changed second arg to be pointer to long instead
of uniform vector.
(scm_ramapc): Allocate index vector with scm_malloc and not as
uniform vector.  Wrap it in a frameso that it gets properly freed.
(scm_array_index_map_x): Likewise.
2004-11-10 01:47:44 +00:00
Marius Vollmer
2ed348854d *** empty log message *** 2004-11-10 01:03:43 +00:00
Marius Vollmer
69730f92ca Do not include <libguile.h>, include the
needed files directly.  Include config.h, <unistd.h> and <io.h>
when available.
(scm_uniform_vector_read_x, scm_uniform_vector_write): New.
2004-11-10 01:02:32 +00:00
Marius Vollmer
2c72f25301 *** empty log message *** 2004-11-09 22:12:33 +00:00
Marius Vollmer
65b39e8ab7 (gh_uniform_vector_length): Properly use scm_c_uniform_vector_length
instead of scm_uniform_vector_length.
2004-11-09 22:10:59 +00:00