random-state: use byte32 array for internal representation
authorDaniel Kochmański <daniel@turtleware.eu>
Mon, 21 Sep 2015 15:09:39 +0000 (17:09 +0200)
committerDaniel Kochmański <daniel@turtleware.eu>
Mon, 21 Sep 2015 15:09:39 +0000 (17:09 +0200)
Signed-off-by: Daniel Kochmański <daniel@turtleware.eu>
src/c/num_rand.d

index 9c53cac..cc48ca6 100644 (file)
@@ -3,7 +3,7 @@
 
 /*
     num_rand.c  -- Random numbers.
-*/
+n*/
 /*
     Copyright (c) 1984, Taiichi Yuasa and Masami Hagiya.
     Copyright (c) 1990, Giuseppe Attardi.
@@ -49,7 +49,9 @@ cl_object
 init_genrand(ulong seed)
 {
         cl_object array =
-                ecl_alloc_simple_base_string((sizeof(ulong) * (MT_N + 1)));
+                ecl_alloc_simple_vector
+                ((MT_N + 1),
+                 ecl_symbol_to_elttype(@'ext::byte32'));
         ulong *mt = (ulong*)(array->base_string.self);
         int j = 0;
         mt[0] = seed & 0xffffffffUL;