From: Peter Johnson Date: Sat, 18 Mar 2006 22:36:21 +0000 (-0000) Subject: Eliminate some signed/unsigned character mismatches in GAP build. X-Git-Tag: v0.5.0rc2~5^2~24 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d0ebe182cc6b3d5c256da6cf373dce6657a3cf38;p=yasm Eliminate some signed/unsigned character mismatches in GAP build. * phash.c, phash.h (phash_checksum): Change to take signed char. * perfect.h (key): Change name_k to char. * perfect.c (initinl): Cast name_k. svn path=/trunk/yasm/; revision=1418 --- diff --git a/libyasm/phash.c b/libyasm/phash.c index ed14001b..b828bb65 100644 --- a/libyasm/phash.c +++ b/libyasm/phash.c @@ -191,11 +191,12 @@ is trying to cause collisions. Do NOT use for cryptography. */ void phash_checksum( - register const unsigned char *k, + register const char *sk, register unsigned long len, register unsigned long *state) { register unsigned long a,b,c,d,e,f,g,h,length; + register const unsigned char *k = (const unsigned char *)sk; /* Use the length and level; add in the golden ratio. */ length = len; diff --git a/libyasm/phash.h b/libyasm/phash.h index 1f647257..5fc44e39 100644 --- a/libyasm/phash.h +++ b/libyasm/phash.h @@ -12,5 +12,4 @@ Source is http://burtleburtle.net/bob/c/lookupa.h unsigned long phash_lookup(const char *k, unsigned long length, unsigned long level); -void phash_checksum(const unsigned char *k, unsigned long length, - unsigned long *state); +void phash_checksum(const char *k, unsigned long length, unsigned long *state); diff --git a/tools/gap/perfect.c b/tools/gap/perfect.c index c0b07d28..77464c25 100644 --- a/tools/gap/perfect.c +++ b/tools/gap/perfect.c @@ -279,7 +279,7 @@ static void initinl( ub4 i; for (i=0; ilen_k; ++i) { - hash = (mykey->name_k[i] ^ hash) + ((hash<<(UB4BITS-6))+(hash>>6)); + hash = ((ub1)mykey->name_k[i] ^ hash) + ((hash<<(UB4BITS-6))+(hash>>6)); } mykey->hash_k = hash; mykey->a_k = (alen > 1) ? (hash & amask) : 0; diff --git a/tools/gap/perfect.h b/tools/gap/perfect.h index 297778a2..bfb60010 100644 --- a/tools/gap/perfect.h +++ b/tools/gap/perfect.h @@ -79,7 +79,7 @@ typedef struct hashform hashform; /* representation of a key */ struct key { - ub1 *name_k; /* the actual key */ + char *name_k; /* the actual key */ ub4 len_k; /* the length of the actual key */ ub4 hash_k; /* the initial hash value for this key */ struct key *next_k; /* next key */