aboutsummaryrefslogtreecommitdiffstats
path: root/rdoff/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'rdoff/hash.c')
-rw-r--r--rdoff/hash.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/rdoff/hash.c b/rdoff/hash.c
index 75213599..741c9e8b 100644
--- a/rdoff/hash.c
+++ b/rdoff/hash.c
@@ -12,9 +12,7 @@
#include "hash.h"
-typedef unsigned int crc32;
-
-const crc32 consttab[] = {
+const uint32_t consttab[] = {
0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA,
0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988,
@@ -81,16 +79,15 @@ const crc32 consttab[] = {
0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
};
-unsigned hash(const int8_t *name)
+uint32_t hash(const char *name)
{
- register const int8_t *n;
- register crc32 hashval = 0xffffffff;
+ register const char *n;
+ register uint32_t hashval = 0xffffffff;
for (n = name; *n; n++)
hashval = (hashval >> 8) ^ consttab[(hashval ^ *n) & 0xff];
hashval ^= 0xffffffff;
- return (hashval);
-
+ return hashval;
}