refactor datum->random-state / random-state->datum
authorAndy Wingo <wingo@pobox.com>
Mon, 26 Jul 2010 12:57:46 +0000 (14:57 +0200)
committerAndy Wingo <wingo@pobox.com>
Mon, 26 Jul 2010 13:01:02 +0000 (15:01 +0200)
commit99a0ee662050ad31e74acb3390d6901e3c916f57
tree5e16269200f0d1847bd466d77e8345316119e648
parentb606ff6af9c9ec7fc3c4473c09ce1e95c18f024a
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.
libguile/random.c
libguile/random.h