This commit is contained in:
Davi Reis 2014-06-06 11:52:06 -03:00
parent a57fe72c9a
commit a57b0e966d

View File

@ -87,12 +87,10 @@ acceptable. Do NOT use for cryptographic purposes.
jenkins_state_t *jenkins_state_new(cmph_uint32 size) //size of hash table jenkins_state_t *jenkins_state_new(cmph_uint32 size) //size of hash table
{ {
jenkins_state_t *state = (jenkins_state_t *)malloc(sizeof(jenkins_state_t)); jenkins_state_t *state = (jenkins_state_t *)malloc(sizeof(jenkins_state_t));
if (!state) return NULL; if (!state) return NULL;
DEBUGP("Initializing jenkins hash\n"); DEBUGP("Initializing jenkins hash\n");
if(size > 0) if (size > 0) state->seed = ((cmph_uint32)rand() % size);
state->seed = ((cmph_uint32)rand() % size); else state->seed = 0;
else
state->seed = 0;
return state; return state;
} }
void jenkins_state_destroy(jenkins_state_t *state) void jenkins_state_destroy(jenkins_state_t *state)