From dd37dd285188938d68b07fc5a25019db3afbd7a2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Kochma=C5=84ski?= Date: Tue, 22 Sep 2015 16:32:50 +0200 Subject: [PATCH] random-state: more informative message MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Kochmański --- src/c/num_rand.d | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/c/num_rand.d b/src/c/num_rand.d index 2fde51b..3a152dc 100644 --- a/src/c/num_rand.d +++ b/src/c/num_rand.d @@ -220,13 +220,18 @@ ecl_make_random_state(cl_object rs) case t_fixnum: /* XXX: If we'll decide to use 64-bit algorithm for appropriate platforms then this will be replaced - with ecl_to_ulong_long from number.d*/ + with ecl_to_ulong_long from number.d, which takes + widest available type (32 or 64 bit) + automatically. */ z->random.value = init_genrand (ecl_to_uint32_t(rs)); break; - default: + default: { + const char *type + = "(OR RANDOM-STATE (SIMPLE-VECTOR *) (INTEGER 0 *))"; FEwrong_type_only_arg(@[make-random-state], rs, - @[random-state]); + ecl_read_from_cstring(type)); + } } return(z); -- 2.9.0