From a1bd86193cf23d87e6ddb767a753416a5e5c36a8 Mon Sep 17 00:00:00 2001 From: MORIOKA Tomohiko Date: Mon, 1 Apr 2013 14:40:28 +0900 Subject: [PATCH] (concord_hash_c_string): Use `unsigned long' instead of int' as the type of return value. --- name.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/name.c b/name.c index 41ca2ec..8155dec 100644 --- a/name.c +++ b/name.c @@ -34,7 +34,7 @@ struct CONCORD_HASH_TABLE CONCORD_HASH_TABLE* concord_make_hash_table (size_t size); void concord_destroy_hash_table (CONCORD_HASH_TABLE* hash); -int concord_hash_c_string (const unsigned char *ptr); +unsigned long concord_hash_c_string (const unsigned char *ptr); CONCORD_HASH_TABLE* concord_make_hash_table (size_t size) @@ -70,14 +70,14 @@ concord_destroy_hash_table (CONCORD_HASH_TABLE* table) /* derived from hashpjw, Dragon Book P436. */ -int +unsigned long concord_hash_c_string (const unsigned char *ptr) { - int hash = 0; + unsigned long hash = 0; while (*ptr != '\0') { - int g; + unsigned long g; hash = (hash << 4) + *ptr++; g = hash & 0xf0000000; if (g) -- 1.7.10.4