*/
unsigned int key_from_string(char *s)
{
- unsigned int result=0;
+ unsigned int result=0, i;
unsigned char *n;
- int i;
- if (!s) return(1);
- for (n=s,i=0;*n;n++,i++) result^=(*n*57)^*n*i;
+
+ if (!s)
+ return(1);
+ for (n = (unsigned char *)s, i = 0; *n; n++, i++)
+ result ^= (*n * 57) ^ *n * i;
+
return(result);
}
* Returns: a pointer to the new table
*/
table hash_create_table (int (*compare_function)(void *, void *),
- unsigned int (*key_function)(unsigned int *))
+ unsigned int (*key_function)(void *))
{
table new=(table)malloc(sizeof(struct table));
memset(new, 0, sizeof(struct table));