Whamcloud - gitweb
Branch b1_6
[fs/lustre-release.git] / lnet / ulnds / socklnd / table.c
index 662775a..986c5ce 100644 (file)
@@ -93,11 +93,14 @@ unsigned int key_from_int(int i)
  */
 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);
 }
 
@@ -110,7 +113,7 @@ unsigned int key_from_string(char *s)
  * 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));