Skip to content

Commit 304c9c3

Browse files
committed
random: Add explicitly named seed64() helper for xoshiro256**
1 parent 79f648a commit 304c9c3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ext/random/engine_xoshiro256starstar.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ static inline void seed256(php_random_status_state_xoshiro256starstar *s, uint64
8989
s->state[3] = s3;
9090
}
9191

92-
static void seed(php_random_status *status, uint64_t seed)
92+
static inline void seed64(php_random_status_state_xoshiro256starstar *state, uint64_t seed)
9393
{
9494
uint64_t s[4];
9595

@@ -98,7 +98,12 @@ static void seed(php_random_status *status, uint64_t seed)
9898
s[2] = splitmix64(&seed);
9999
s[3] = splitmix64(&seed);
100100

101-
seed256(status->state, s[0], s[1], s[2], s[3]);
101+
seed256(state, s[0], s[1], s[2], s[3]);
102+
}
103+
104+
static void seed(php_random_status *status, uint64_t seed)
105+
{
106+
seed64(status->state, seed);
102107
}
103108

104109
static php_random_result generate(php_random_status *status)

0 commit comments

Comments
 (0)