Rename xorshift functions

This commit is contained in:
Abdelrahman Said 2025-03-22 00:30:20 +00:00
parent d661312cfa
commit 74428f1caf
2 changed files with 8 additions and 8 deletions

View File

@ -12,7 +12,7 @@ struct split_mix_64_state {
internal u64 rol64(u64 x, u64 bits);
internal u64 split_mix_64(SplitMix64State *state);
XOR256State wapp_init_xor_256_state(void) {
XOR256State wapp_prng_xorshift_init_state(void) {
persistent bool seeded = false;
if (!seeded) {
seeded = true;
@ -33,7 +33,7 @@ XOR256State wapp_init_xor_256_state(void) {
};
}
u64 wapp_xorshift_256_generate(XOR256State *state) {
u64 wapp_prng_xorshift_256(XOR256State *state) {
u64 t = state->x ^ (state->x << 11);
state->x = state->y;
@ -44,7 +44,7 @@ u64 wapp_xorshift_256_generate(XOR256State *state) {
return state->w;
}
u64 wapp_xoshiro_256ss_generate(XOR256State *state) {
u64 wapp_prng_xorshift_256ss(XOR256State *state) {
const u64 result = rol64(state->z * 5, 7) * 9;
const u64 t = state->z << 17;
@ -59,7 +59,7 @@ u64 wapp_xoshiro_256ss_generate(XOR256State *state) {
return result;
}
u64 wapp_xoshiro_256p_generate(XOR256State *state) {
u64 wapp_prng_xorshift_256p(XOR256State *state) {
const u64 result = state->w + state->x;
const u64 t = state->z << 17;

View File

@ -15,10 +15,10 @@ struct xor_256_state {
u64 w;
};
XOR256State wapp_init_xor_256_state(void);
u64 wapp_xorshift_256_generate(XOR256State *state);
u64 wapp_xoshiro_256ss_generate(XOR256State *state);
u64 wapp_xoshiro_256p_generate(XOR256State *state);
XOR256State wapp_prng_xorshift_init_state(void);
u64 wapp_prng_xorshift_256(XOR256State *state);
u64 wapp_prng_xorshift_256ss(XOR256State *state);
u64 wapp_prng_xorshift_256p(XOR256State *state);
#ifdef __cplusplus
END_C_LINKAGE