summaryrefslogtreecommitdiff
path: root/libguile/random.h
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2010-07-22 21:26:19 +0200
committerAndy Wingo <wingo@pobox.com>2010-07-26 15:01:02 +0200
commitb606ff6af9c9ec7fc3c4473c09ce1e95c18f024a (patch)
tree963d7a600564ccbc6f7bf84fb184c187042f2c78 /libguile/random.h
parent4ca48269976e17b2530728cce7df63843a6ce2b0 (diff)
downloadguile-b606ff6af9c9ec7fc3c4473c09ce1e95c18f024a.tar.gz
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.
Diffstat (limited to 'libguile/random.h')
-rw-r--r--libguile/random.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/libguile/random.h b/libguile/random.h
index 402c3f1cb..92800ccfa 100644
--- a/libguile/random.h
+++ b/libguile/random.h
@@ -46,7 +46,7 @@ typedef struct scm_t_rstate {
typedef struct scm_t_rng {
size_t rstate_size; /* size of random state */
- unsigned long (*random_bits) (scm_t_rstate *state); /* gives 32 random bits */
+ scm_t_uint32 (*random_bits) (scm_t_rstate *state); /* gives 32 random bits */
void (*init_rstate) (scm_t_rstate *state, const char *seed, int n);
scm_t_rstate *(*copy_rstate) (scm_t_rstate *state);
void (*init_rstate_scm) (scm_t_rstate *state, SCM exposed);
@@ -61,11 +61,11 @@ SCM_API scm_t_rng scm_the_rng;
*/
typedef struct scm_t_i_rstate {
scm_t_rstate rstate;
- unsigned long w;
- unsigned long c;
+ scm_t_uint32 w;
+ scm_t_uint32 c;
} scm_t_i_rstate;
-SCM_INTERNAL unsigned long scm_i_uniform32 (scm_t_i_rstate *);
+SCM_INTERNAL scm_t_uint32 scm_i_uniform32 (scm_t_i_rstate *);
SCM_INTERNAL void scm_i_init_rstate (scm_t_i_rstate *, const char *seed, int n);
SCM_INTERNAL scm_t_i_rstate *scm_i_copy_rstate (scm_t_i_rstate *);
SCM_INTERNAL void scm_i_init_rstate_scm (scm_t_i_rstate *state, SCM value);
@@ -82,7 +82,7 @@ SCM_API scm_t_rstate *scm_c_default_rstate (void);
SCM_API double scm_c_uniform01 (scm_t_rstate *);
SCM_API double scm_c_normal01 (scm_t_rstate *);
SCM_API double scm_c_exp1 (scm_t_rstate *);
-SCM_API unsigned long scm_c_random (scm_t_rstate *, unsigned long m);
+SCM_API scm_t_uint32 scm_c_random (scm_t_rstate *, scm_t_uint32 m);
SCM_API SCM scm_c_random_bignum (scm_t_rstate *, SCM m);