Skip to content
Prev Previous commit
Next Next commit
random: Remove the seed member from php_random_algo
See the explanation in the previous commit for the reasoning. This member is unused since the previous commit and was not consistently available even before that (specifically for the Secure engine).
  • Loading branch information
TimWolla committed Feb 27, 2024
commit ad1fd44005cf2417a56d8078a823cc2e40911612
1 change: 0 additions & 1 deletion ext/random/engine_combinedlcg.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ static bool unserialize(void *state, HashTable *data)

const php_random_algo php_random_algo_combinedlcg = {
sizeof(php_random_status_state_combinedlcg),
NULL,
generate,
range,
serialize,
Expand Down
1 change: 0 additions & 1 deletion ext/random/engine_mt19937.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ static bool unserialize(void *state, HashTable *data)

const php_random_algo php_random_algo_mt19937 = {
sizeof(php_random_status_state_mt19937),
NULL,
generate,
range,
serialize,
Expand Down
1 change: 0 additions & 1 deletion ext/random/engine_pcgoneseq128xslrr64.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ static bool unserialize(void *state, HashTable *data)

const php_random_algo php_random_algo_pcgoneseq128xslrr64 = {
sizeof(php_random_status_state_pcgoneseq128xslrr64),
NULL,
generate,
range,
serialize,
Expand Down
1 change: 0 additions & 1 deletion ext/random/engine_secure.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ static zend_long range(void *state, zend_long min, zend_long max)

const php_random_algo php_random_algo_secure = {
0,
NULL,
generate,
range,
NULL,
Expand Down
1 change: 0 additions & 1 deletion ext/random/engine_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ static zend_long range(void *state, zend_long min, zend_long max)

const php_random_algo php_random_algo_user = {
sizeof(php_random_status_state_user),
NULL,
generate,
range,
NULL,
Expand Down
1 change: 0 additions & 1 deletion ext/random/engine_xoshiro256starstar.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ static bool unserialize(void *state, HashTable *data)

const php_random_algo php_random_algo_xoshiro256starstar = {
sizeof(php_random_status_state_xoshiro256starstar),
NULL,
generate,
range,
serialize,
Expand Down
1 change: 0 additions & 1 deletion ext/random/php_random.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ typedef struct _php_random_result {

typedef struct _php_random_algo {
const size_t state_size;
void (*seed)(void *state, uint64_t seed);
php_random_result (*generate)(void *state);
zend_long (*range)(void *state, zend_long min, zend_long max);
bool (*serialize)(void *state, HashTable *data);
Expand Down