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

108 commits

Author SHA1 Message Date
Daniel Llorens
70a63479ad Identify scm_is_vector with scm_is_simple_vector
This patch fixes the bug (vector-ref #1@1(1 2 3) 1) => 2.

* libguile/vectors.c: (scm_is_vector): just as scm_is_simple_vector.
* libguile/filesys.c, libguile/random.c, libguile/stime.c, libguile/trees.c,
  libguile/validate.h: use scm_is_vector instead of scm_is_simple_vector.
* libguile/sort.c
  - scm_restricted_vector_sort_x: use scm_array_handle_writable_elements
    instead of scm_vector_writable_elements, to work with non-vector
    rank-1 array objects.
  - scm_sort_x: check for scm_is_array instead of scm_is_vector. Rank
    check is in restricted_vector_sort_x.
  - scm_sort: ditto.
  - scm_stable_sort_x: like scm_restricted_vector_sort_x.
  - scm_stable_sort: like scm_sort.
* test-suite/tests/arrays.test: fix header.
* test-suite/tests/random.test: new coverage test covering
  random:normal-vector!
* test-suite/Makefile.am: include random.test in make check.
2014-01-27 21:45:17 +01:00
Daniel Llorens
5a4f40f903 Replace scm_c_generalized_vector_length in random.c
* libguile/random.c: (random:solid-sphere!): array is of known
  rank 1, so use scm_c_array_length() instead.
2014-01-27 21:45:17 +01:00
Mark H Weaver
be6a36a05d Update copyright dates on random.c
* libguile/random.c: Add 2012 and 2013 to the copyright notice.
2013-02-25 22:14:41 -05:00
Mark H Weaver
587f4edd39 random_state_of_last_resort: use getpid directly, instead of scm_getpid
* libguile/random.c: Include <sys/types.h> and <unistd.h> (if present).
  (random_state_of_last_resort): Use getpid directly.
2013-02-25 13:53:49 -05:00
Mark H Weaver
3ec19a7884 Revert "random_state_of_last_resort doesn't rely on HAVE_POSIX"
This reverts commit eaf21539d4.
2013-02-25 13:33:28 -05:00
Mark H Weaver
444b26f739 Revert "random-state-from-platform: simplify pid conditional, and clarify docs."
This reverts commit 08904661a2.
2013-02-25 13:33:14 -05:00
Mark H Weaver
08904661a2 random-state-from-platform: simplify pid conditional, and clarify docs.
* libguile/random.c (random_state_of_last_resort): Simplify optional
  inclusion of PID in the random state.  Clarify in the comments that
  the PID is only included where scm_getpid is present.

* doc/ref/api-data.texi (Random): Clarify that
  'random-state-from-platform' includes the PID in the random state only
  if scm_getpid is present.
2013-02-24 19:57:00 -05:00
Andy Wingo
eaf21539d4 random_state_of_last_resort doesn't rely on HAVE_POSIX
* libguile/random.c (random_state_of_last_resort): Add the PID as a seed
  only if we have scm_getpid().
2013-02-24 12:46:48 +01:00
Mark H Weaver
d47db067b6 Add random-state-from-platform' and scm_i_random_bytes_from_platform'
* libguile/random.c (scm_random_state_from_platform): New procedure.
  (scm_i_random_bytes_from_platform): New internal function.

* libguile/random.h (scm_random_state_from_platform,
  scm_i_random_bytes_from_platform): Add prototypes.

* doc/ref/api-data.texi (Random): Add documentation.
2012-01-21 03:22:57 -05:00
Ralf Wildenhues
ffb62a43dc fix typos in the manual bits generated from source comments.
* libguile/bitvectors.c, libguile/chars.c,
libguile/deprecated.c, libguile/numbers.c, libguile/random.c,
libguile/read.c, libguile/root.c, libguile/srfi-1.c,
libguile/srfi-13.c, libguile/srfi-14.c, libguile/uniform.c:
Fix typos, add missing newlines.
2011-02-09 22:28:49 +00:00
Andy Wingo
e25f37271a fix a number of assuptions that a long could hold an inum
* libguile/bytevectors.c:
* libguile/goops.c:
* libguile/instructions.c:
* libguile/numbers.c:
* libguile/random.c:
* libguile/read.c:
* libguile/vm-i-scheme.c: Fix a number of assumptions that a long could
  hold an inum. This is not the case on platforms whose void* is larger
  than their long.

* libguile/numbers.c (scm_i_inum2big): New helper, only implemented for
  sizeof(void*) == sizeof(long); produces a compile error on other
  platforms. Basically gmp doesn't have a nice interface for converting
  between mpz values and intmax_t.
2010-11-19 15:22:43 +01:00
Andreas Rottmann
2af6e1351d Fix the range of `random' on 64-bit platforms
For > 32 bit integers still in the fixnum range, scm_random() would
return random numbers with a lower range than specified.

* libguile/random.c (scm_i_mask32): New static inline function.
  (scm_c_random): Use `scm_i_mask32'.
  (scm_c_random64): New function, 64-bit variant of scm_c_random.
  (scm_random): Use `scm_c_random64' instead of forming the 64-bit random
  number in a bogus way.
* libguile/random.h: Added `scm_c_random64'.
2010-08-01 21:53:29 +02:00
Andy Wingo
9defb64118 64-bit random fixes
* libguile/random.c (scm_random): Fix generation of inum randoms with
  more than 32 bits.

* libguile/random.h (scm_t_rstate): Fix a comment.
2010-07-27 11:32:40 +02:00
Andy Wingo
a2a95453eb rstates point to rngs
* libguile/random.h (scm_t_rstate): Include the rng in the rstate, so we
  can actually have multiple rngs. Instead of reserved0 / reserved1,
  reserve a double explicitly for scm_c_normal01.
  (scm_c_uniform32): Change to call the rstate's rng.

* libguile/random.c: Change to access an rstate's rng through its rng
  pointer.
  (scm_c_normal01): Instead of a flag and a next double, just check that
  the double is equal to 0.0. Excluding one value shouldn't affect the
  distribution, right?
2010-07-26 16:36:15 +02:00
Andy Wingo
1d454874c1 update docs
* doc/ref/api-data.texi:
* libguile/random.c: Update datum->random-state and random-state->datum
  docs.
2010-07-26 15:12:42 +02:00
Andy Wingo
99a0ee6620 refactor datum->random-state / random-state->datum
* libguile/random.c (scm_t_i_rstate): Move here from random.h, along
  with prototypes for functions
  (scm_i_uniform32, scm_i_init_rstate, scm_i_copy_rstate): Change to
  take a stock scm_t_rstate as an arg, and cast it. This way we don't
  cast the pointers below.
  (scm_i_rstate_from_datum, scm_i_rstate_from_datum): Same and rename
  from scm_i_init_rstate_scm / scm_i_expose_rstate.
  (scm_c_rstate_from_datum): Rename from scm_c_make_rstate_scm.
  (scm_datum_to_random_state, scm_random_state_to_datum): Rename from
  scm_external_to_random_state and scm_random_state_to_external.
  (scm_init_random): Remove casts.

* libguile/random.h (scm_t_rng): Rename init_rstate_scm, expose_rstate
  vmethods to from_datum, to_datum. Remove internal definitions. Rename
  to scm_c_rstate_from_datum, and provide scm_random_state_to_datum and
  scm_datum_to_random_state.
2010-07-26 15:01:02 +02:00
Andy Wingo
b606ff6af9 low-level RNG interfaces deal in scm_t_uint32, not unsigned long
* libguile/random.h (scm_t_rng): random_bits returns a scm_t_uint32.
  (scm_i_uniform32, scm_t_i_rstate): Internal RNG returns a
  scm_t_uint32, as advertised, instead of unsigned long.
  (scm_c_random): Return a scm_t_uint32 instead of an unsigned long.

* libguile/random.c (scm_i_uniform32, scm_i_init_rstate_scm):
  (scm_i_expose_rstate, scm_c_random, scm_c_random_bignum, scm_random)
  (scm_init_random): Adapt types to match implementation.
2010-07-26 15:01:02 +02:00
Andy Wingo
4ca4826997 remove SCM_HAVE_T_INT64, SCM_HAVE_T_UINT64
* libguile/__scm.h:
* libguile/numbers.h:
* libguile/random.c:
* libguile/srfi-4.c:
* libguile/srfi-4.h:
* libguile/numbers.c:
* test-suite/standalone/test-conversion.c:
* libguile/gen-scmconfig.c: As we require 64-bit integers in
  configure.ac, remove conditional definition of 64-bit types.
2010-07-26 15:00:49 +02:00
Andreas Rottmann
77b139121d Allow exposing of random number generator state
Now the random number generator state can be obtained in external
(i.e. `read'/`write'-able) form via the new procedure
`random-state->external'.  An externalized state can be reinstantiated by
calling `external->random-state'.

* libguile/random.c (scm_i_init_rstate_scm, scm_i_expose_rstate): New
  internal functions.
* libguile/random.c (scm_c_make_rstate_scm, scm_external_to_random_state,
  scm_random_state_to_external): New public functions.
* libguile/random.h: Add prototypes for the above functions.

* libguile/random.h (scm_t_rng): Add new fields `init_rstate_scm' and
  `expose_rstate'.
* libguile/random.c (scm_init_random): Initialize the new fields in
  `scm_the_rng'.
2010-07-26 15:00:49 +02:00
Andreas Rottmann
442eaa681b Fix random number generator on 64-bit platforms
* libguile/random.c (scm_c_random): On platforms where `unsigned long' has 64
  bit, generate up to 64 bit of randomness. This is expected by
  scm_c_random_bignum(), and hence was a serious distortion of the random value
  distribution for values exceeding 2^32. This change also fixes a crash when
  the `m' argument is a value above 2^32.
2010-07-19 22:40:56 +02:00
Ludovic Courtès
7af531508c Merge branch 'master' into boehm-demers-weiser-gc
Conflicts:
	libguile/Makefile.am
	libguile/bytevectors.c
	libguile/gc-card.c
	libguile/gc-mark.c
	libguile/programs.c
	libguile/srcprop.c
	libguile/srfi-14.c
	libguile/symbols.c
	libguile/threads.c
	libguile/unif.c
	libguile/vm.c
2009-08-28 19:16:46 +02:00
Ludovic Courtès
fbb857a472 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
2009-08-18 00:06:45 +02:00
Andy Wingo
f332e95717 generic vector ops to own file
* libguile/Makefile.am:
* libguile/vectors.c:
* libguile/vectors.h:
* libguile/generalized-vectors.c:
* libguile/generalized-vectors.h: Move generic vector ops off into their
  own file too. The implementation is now based on the generic
  array-handle infrastructure.

* libguile.h:
* libguile/array-map.c:
* libguile/bitvectors.c:
* libguile/random.c:
* libguile/srfi-4.c: Update includers.
2009-07-19 15:15:44 +02:00
Andy Wingo
2fa901a51f rename unif.[ch] to arrays.[ch]
* libguile/Makefile.am:
* libguile/unif.c:
* libguile/unif.h:
* libguile/arrays.c:
* libguile/arrays.h: Rename unif.[ch] to arrays.[ch].

* libguile.h:
* libguile/array-handle.c:
* libguile/array-map.c:
* libguile/bitvectors.c:
* libguile/bytevectors.c:
* libguile/eq.c:
* libguile/gc-card.c:
* libguile/gc-malloc.c:
* libguile/gc-mark.c:
* libguile/gc.c:
* libguile/init.c:
* libguile/inline.h:
* libguile/print.c:
* libguile/random.c:
* libguile/read.c:
* libguile/socket.c:
* libguile/sort.c:
* libguile/srfi-4.c:
* libguile/srfi-4.h:
* libguile/strports.c:
* libguile/vectors.c:
* libguile/vectors.h: Update includers.
2009-07-19 14:53:03 +02: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
Ludovic Courtès
44e268898b Merge branch 'master' into boehm-demers-weiser-gc
Conflicts:
	lib/Makefile.am
	libguile/gc-card.c
	libguile/gc-freelist.c
	libguile/gc-mark.c
	libguile/gc-segment.c
	libguile/gc.c
	libguile/gc.h
	libguile/gc_os_dep.c
	libguile/private-gc.h
	m4/.cvsignore
	m4/gnulib-cache.m4
	m4/gnulib-comp.m4
2008-09-13 22:51:27 +02:00
Ludovic Courtès
dbb605f575 Include <config.h> in all C files; use #ifdef HAVE_CONFIG_H' rather than #if'. 2008-09-13 15:35:27 +02:00
Ludovic Courtes
92d8fd328c Use `scm_gc_malloc_pointerless' in various places (improves performance).
* libguile/fports.c (scm_fport_buffer_add): Use
  `scm_gc_malloc_pointerless ()' instead of `scm_gc_malloc ()' when
  allocating room for the read/write buffers.

* libguile/numbers.c (scm_c_make_rectangular): Likewise.

* libguile/ports.c (scm_ungetc): Likewise.

* libguile/random.c (scm_i_copy_rstate): Likewise.
  (scm_c_make_rstate): Likewise.

* libguile/regex-posix.c (scm_make_regexp): Likewise.

git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-36
2008-09-10 20:27:00 +02:00
Ludovic Courtes
a4a141f679 Removed a lot of now-useless SMOB mark/free functions.
* libguile/arbiters.c (scm_init_arbiters): Don't invoke `scm_set_smob_mark'.

* libguile/async.c (async_gc_mark): Removed.
  (scm_init_async): Don't invoke `scm_set_smob_mark'.

* libguile/coop-pthreads.c (thread_mark): Removed.
  (create_thread): Use `scm_gc_malloc' instead of `scm_malloc' when
  allocating `launch_data'.
  (mutex_mark): Removed.
  (scm_threads_init): Don't invoke `scm_set_smob_mark' and
  `scm_set_smob_free'.

* libguile/debug.c (scm_init_debug): Don't invoke `scm_set_smob_mark'.

* libguile/dynl.c (dynl_obj_mark): Removed.
  (scm_init_dynamic_linking): Don't invoke `scm_set_smob_mark'.

* libguile/dynwind.c (winder_mark): Removed.
  (scm_init_dynwind): Don't invoke `scm_set_smob_mark'.

* libguile/environments.c (environment_mark): Removed.
  (environment_free): Removed.
  (observer_mark): Removed.
  (core_environments_mark): Removed.
  (core_environments_finalize): Removed.
  (leaf_environment_mark): Removed.
  (leaf_environment_free): Removed.
  (leaf_environment_funcs): Don't refer to the above funcs.
  (eval_environment_mark): Removed.
  (eval_environment_free): Removed.
  (eval_environment_funcs): Don't refer to the above funcs.
  (import_environment_mark): Removed.
  (import_environment_free): Removed.
  (import_environment_funcs): Don't refer to the above funcs.
  (export_environment_mark): Removed.
  (export_environment_free): Removed.
  (export_environment_funcs): Don't refer to the above funcs.
  (scm_environments_prehistory): Don't invoke `scm_set_smob_mark' and
  `scm_set_smob_free'.

* libguile/environments.h (scm_environment_funcs)[mark]: Removed.
  [free]: Removed.

* libguile/eval.c (promise_mark): Removed.
  (promise_free): Removed.
  (scm_init_eval): Don't invoke `scm_set_smob_mark' and
  `scm_set_smob_free'.

* libguile/fluids.c (fluid_free): Removed.
  (scm_fluids_prehistory): Don't invoke `scm_set_smob_mark' and
  `scm_set_smob_free'.

* libguile/futures.c (future_mark): Removed.
  (scm_init_futures): Don't invoke `scm_set_smob_mark'.

* libguile/hashtab.c (hashtable_free): Removed.
  (scm_hashtab_prehistory): Don't invoke `scm_set_smob_mark' and
  `scm_set_smob_free'.

* libguile/hooks.c (scm_init_hooks): Don't invoke `scm_set_smob_mark'.

* libguile/keywords.c (scm_init_keywords): Don't invoke
  `scm_set_smob_mark'.

* libguile/macros.c (scm_init_macros): Don't invoke `scm_set_smob_mark'.

* libguile/modules.c (scm_init_modules): Don't invoke
  `scm_set_smob_mark'.

* libguile/print.c (scm_init_print): Don't invoke `scm_set_smob_mark'.

* libguile/random.c (scm_i_copy_rstate): Use `scm_gc_malloc' instead of
  `scm_malloc'.
  (scm_c_make_rstate): Likewise.
  (rstate_free): Removed.
  (scm_init_random): Don't invoke `scm_set_smob_free'.

* libguile/srcprop.c (srcprops_mark): Removed.
  (scm_init_srcprop): Don't invoke `srcprops_mark'.

* libguile/srfi-14.c (charset_free): Removed.
  (scm_init_srfi_14): Don't invoke `scm_set_smob_free'.

* libguile/srfi-4.c (uvec_mark): Removed.
  (uvec_free): Removed.
  (scm_init_srfi_4): Don't invoke `scm_set_smob_free' and
  `scm_set_smob_mark'.

* libguile/threads.c (thread_mark): Removed.
  (fat_mutex_mark): Removed.
  (fat_cond_mark): Removed.
  (scm_init_threads): Dont invoke `scm_set_smob_mark' and
  `scm_set_smob_free'.

* libguile/unif.c (bitvector_free): Removed.
  (array_mark): Removed.
  (array_free): Removed.
  (scm_init_unif): Don't invoke `scm_set_smob_free' and
  `scm_set_smob_mark'.

git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-28
2008-09-05 09:34:23 +02:00
Kevin Ryde
2b829bbb3d merge from 1.8 branch 2006-04-17 00:05:42 +00:00
Mikael Djurfeldt
4a9f83ff06 Test for SCM_HAVE_T_UINT64 instead of
SCM_HAVE_T_INT64.
(scm_i_uniform32, scm_i_uniform32, scm_i_init_rstate): Use
scm_t_uint64 and scm_t_uint32 instead of scm_t_int64 and
scm_t_int32.
2006-02-19 16:34:51 +00:00
Kevin Ryde
c224262bd1 (scm_i_copy_rstate, scm_c_make_rstate): Don't test for
scm_malloc returning NULL, it never does that.
2005-11-26 00:53:27 +00:00
Marius Vollmer
92205699d0 The FSF has a new address. 2005-05-23 19:57:22 +00:00
Kevin Ryde
8b3747f9c6 (scm_i_init_rstate): Compare w to -1 not 0xffffffffUL, now
that it's an scm_t_int32.  Otherwise gcc 3.4 says it's always false on
a 64-bit system.
2005-01-23 23:58:43 +00:00
Marius Vollmer
f160e70907 (scm_random_solid_sphere_x): Use scm_c_generalized_vector_length
instead of scm_uniform_vector_length.
2005-01-17 17:22:22 +00:00
Kevin Ryde
6efaeb3567 (scm_random_solid_sphere_x): Update docstring from manual. 2005-01-15 00:03:53 +00:00
Marius Vollmer
55fcbb966b Don't check for definedness of SCM_HAVE_T_INT64, check
its value.
2005-01-14 18:01:31 +00:00
Marius Vollmer
c8857a4db4 (scm_array_handle_release): New, changed all uses of
scm_t_array_handle to properly call it.
(scm_vector_get_handle, scm_generalized_vector_get_handle):
Renamed former to latter, changed all uses.
2005-01-06 18:56:34 +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
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
e911caec2b (scm_random_solid_sphere_x, scm_random_hollow_sphere_x): Do not
validate vector argument, this is already done elsewhere.
2004-11-02 19:36:50 +00:00
Marius Vollmer
46d25cffa8 (vector_scale, vector_scale_x): Renamed former to the
latter, since it modifies its argument.
(vector_scale_x, vector_sum_squares, scm_random_normal_vector_x):
Do not use scm_universal_vector_length for non-uniform vectors.
Use scm_f64vector_elements to access innards of uniform vectors.
2004-10-27 19:28:05 +00:00
Marius Vollmer
cc95e00ac6 * strings.h, strings.c: (scm_i_string_chars, scm_i_string_length,
scm_i_string_writable_chars, scm_i_string_stop_writing): New, to
replace SCM_I_STRING_CHARS and SCM_I_STRING_LENGTH.  Updated all
uses.
(scm_i_make_string, scm_c_make_string): New, to replace
scm_allocate_string.  Updated all uses.
(SCM_STRINGP, SCM_STRING_CHARS, SCM_STRING_UCHARS,
SCM_STRING_LENGTH): Deprecated.
(scm_allocate_string, scm_take_str, scm_take0str, scm_mem2string,
scm_str2string, scm_makfrom0str, scm_makfrom0str_opt):
Discouraged.  Replaced all uses with scm_from_locale_string or
similar, as appropriate.
(scm_c_string_length, scm_c_string_ref, scm_c_string_set_x,
scm_c_substring, scm_c_substring_shared, scm_c_substring_copy,
scm_substring_shared, scm_substring_copy): New.

* symbols.c, symbols.h (SCM_SYMBOLP, SCM_SYMBOL_FUNC,
SCM_SET_SYMBOL_FUNC, SCM_SYMBOL_PROPS, SCM_SET_SYMBOL_PROPS,
SCM_SYMBOL_HASH, SCM_SYMBOL_INTERNED_P, scm_mem2symbol,
scm_str2symbol, scm_mem2uninterned_symbol): Discouraged.
(SCM_SYMBOL_LENGTH, SCM_SYMBOL_CHARS, scm_c_symbol2str):
Deprecated.
(SCM_MAKE_SYMBOL_TAG, SCM_SET_SYMBOL_LENGTH, SCM_SET_SYMBOL_CHARS,
SCM_PROP_SLOTS, SCM_SET_PROP_SLOTS): Removed.
(scm_is_symbol, scm_from_locale_symbol, scm_from_locale_symboln):
New, to replace scm_str2symbol and scm_mem2symbol, respectively.
Updated all uses.
(scm_gensym): Generate only the number suffix in the buffer, just
string-append the prefix.
2004-08-19 17:19:44 +00:00
Marius Vollmer
8824ac88f0 * socket.c, rw.c, deprecated.h, validate.h
(SCM_VALIDATE_STRING_COPY): Deprecated.  Replaced all uses with
SCM_VALIDATE_STRING plus SCM_I_STRING_CHARS or
scm_to_locale_string, etc.
(SCM_VALIDATE_SUBSTRING_SPEC_COPY): Deprecated.  Replaced as
above, plus scm_i_get_substring_spec.

* regex-posix.c, read.c, random.c, ramap.c, print.c, numbers.c,
hash.c, gc.c, gc-card.c, convert.i.c, backtrace.c, strop.c,
strorder.c, strports.c, struct.c, symbols.c, unif.c, ports.c: Use
SCM_I_STRING_CHARS, SCM_I_STRING_UCHARS, and SCM_I_STRING_LENGTH
instead of SCM_STRING_CHARS, SCM_STRING_UCHARS, and
SCM_STRING_LENGTH, respectively.  Also, replaced scm_return_first
with more explicit scm_remember_upto_here_1, etc, or introduced
them in the first place.
2004-08-12 17:45:03 +00:00
Marius Vollmer
d9a67fc441 (scm_make_real, scm_num2dbl, scm_float2num, scm_double2num):
Discouraged by moving to discouraged.h and discouraged.c.
Replaced all uses with scm_from_double.
(scm_num2float, scm_num2double): Discouraged by moving prototype
to discouraged.h and rewriting in terms of scm_to_double.
Replaced all uses with scm_to_double.
2004-08-03 15:06:12 +00:00
Marius Vollmer
e11e83f3d9 * deprecated.h, deprecated.c, numbers.h (SCM_INUMP, SCM_NINUMP,
SCM_INUM): Deprecated by reenaming them to SCM_I_INUMP, SCM_I_NINUMP
and SCM_I_INUM, respectively and adding deprecated versions to
deprecated.h and deprecated.c.  Changed all uses to either use the
SCM_I_ variants or scm_is_*, scm_to_*, or scm_from_*, as appropriate.
2004-07-23 15:43:02 +00:00
Marius Vollmer
a55c2b6809 * validate.h, deprecated.h (SCM_VALIDATE_INUM, SCM_VALIDATE_INUM_COPY,
SCM_VALIDATE_BIGINT, SCM_VALIDATE_INUM_MIN,
SCM_VALIDATE_INUM_MIN_COPY,
SCM_VALIDATE_INUM_MIN_DEF_COPY,SCM_VALIDATE_INUM_DEF,
SCM_VALIDATE_INUM_DEF_COPY, SCM_VALIDATE_INUM_RANGE,
SCM_VALIDATE_INUM_RANGE_COPY): Deprecated because they make the
fixnum/bignum distinction visible.  Changed all uses to scm_to_size_t
or similar.
2004-07-10 14:35:36 +00:00
Marius Vollmer
93ccaef0c6 * numbers.h (SCM_MAKINUM, SCM_I_MAKINUM): Renamed SCM_MAKINUM to
SCM_I_MAKINUM and changed all uses.
2004-07-08 15:58:11 +00:00
Rob Browning
0d79003d44 * random.c (scm_c_random_bignum): use SCM_CHAR_BIT. 2003-04-16 19:44:55 +00:00
Rob Browning
8db9cc6cf3 * random.c: #include gmp.h.
(scm_c_random_bignum): normalize result on return.
2003-04-07 01:51:10 +00:00