aboutsummaryrefslogtreecommitdiff
path: root/shell/random.h
diff options
context:
space:
mode:
Diffstat (limited to 'shell/random.h')
-rw-r--r--shell/random.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/shell/random.h b/shell/random.h
index 8667e1c99..e22a2e88b 100644
--- a/shell/random.h
+++ b/shell/random.h
@@ -13,7 +13,13 @@ typedef struct random_t {
13 uint32_t LCG; /* LCG (fast but weak) */ 13 uint32_t LCG; /* LCG (fast but weak) */
14} random_t; 14} random_t;
15 15
16#define UNINITED_RANDOM_T(rnd) \
17 ((rnd)->galois_LFSR == 0)
18
16#define INIT_RANDOM_T(rnd, nonzero, v) \ 19#define INIT_RANDOM_T(rnd, nonzero, v) \
17 ((rnd)->galois_LFSR = (nonzero), (rnd)->LCG = (v)) 20 ((rnd)->galois_LFSR = (nonzero), (rnd)->LCG = (v))
18 21
22#define CLEAR_RANDOM_T(rnd) \
23 ((rnd)->galois_LFSR = 0)
24
19uint32_t next_random(random_t *rnd) FAST_FUNC; 25uint32_t next_random(random_t *rnd) FAST_FUNC;