summaryrefslogtreecommitdiff
path: root/libguile/random.c
diff options
context:
space:
mode:
authorMarius Vollmer <mvo@zagadka.de>2004-08-12 17:45:03 +0000
committerMarius Vollmer <mvo@zagadka.de>2004-08-12 17:45:03 +0000
commit8824ac88f08cffc954a907b85858ccd5b3c9843f (patch)
treec96fa1d142124eaf6f030adbc4ec2eb040b612b0 /libguile/random.c
parent70f7ee4188c0a752154d8cc63daf5a99ba89951f (diff)
downloadguile-8824ac88f08cffc954a907b85858ccd5b3c9843f.tar.gz
* 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.
Diffstat (limited to 'libguile/random.c')
-rw-r--r--libguile/random.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libguile/random.c b/libguile/random.c
index 991900af3..bb8d48355 100644
--- a/libguile/random.c
+++ b/libguile/random.c
@@ -383,11 +383,15 @@ SCM_DEFINE (scm_seed_to_random_state, "seed->random-state", 1, 0, 0,
"Return a new random state using @var{seed}.")
#define FUNC_NAME s_scm_seed_to_random_state
{
+ SCM res;
if (SCM_NUMBERP (seed))
seed = scm_number_to_string (seed, SCM_UNDEFINED);
SCM_VALIDATE_STRING (1, seed);
- return make_rstate (scm_c_make_rstate (SCM_STRING_CHARS (seed),
- SCM_STRING_LENGTH (seed)));
+ res = make_rstate (scm_c_make_rstate (SCM_I_STRING_CHARS (seed),
+ SCM_I_STRING_LENGTH (seed)));
+ scm_remember_upto_here_1 (seed);
+ return res;
+
}
#undef FUNC_NAME