summaryrefslogtreecommitdiffstats
path: root/rand.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-04-28 06:33:54 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-04-28 06:33:54 -0700
commite435700d50234e9cc1121858b194462110db9dba (patch)
tree027698c71f11eed38dd55ed94a6c11492ed45666 /rand.c
parentd0c176d3cc719d136cd3c19eb1d057193300b407 (diff)
downloadtxr-e435700d50234e9cc1121858b194462110db9dba.tar.gz
txr-e435700d50234e9cc1121858b194462110db9dba.tar.bz2
txr-e435700d50234e9cc1121858b194462110db9dba.zip
Remove bogus code for 128 bit platform.
* rand.c (make_random_state): Issue #error if SIZEOF_PTR exceeds 8, rather than including bogus code that neglects to use the remaining upper 32 bits.
Diffstat (limited to 'rand.c')
-rw-r--r--rand.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/rand.c b/rand.c
index 7509c237..7bdc2a99 100644
--- a/rand.c
+++ b/rand.c
@@ -129,15 +129,12 @@ val make_random_state(val seed)
memset(r->state, 0xAA, sizeof r->state);
r->state[0] = s & 0xFFFFFFFFul;
-#if SIZEOF_PTR >= 8
+#if SIZEOF_PTR == 8
s >>= 32;
if (s)
r->state[1] = s & 0xFFFFFFFFul;
-#endif
-#if SIZEOF_PTR >= 16
- s >>= 32;
- if (s)
- r->state[2] = s & 0xFFFFFFFFul;
+#elif SIZEOF_PTR > 8
+#error port me!
#endif
} else if (nilp(seed)) {
val time = time_sec_usec();