]> granicus.if.org Git - yasm/commitdiff
Eliminate some signed/unsigned character mismatches in GAP build.
authorPeter Johnson <peter@tortall.net>
Sat, 18 Mar 2006 22:36:21 +0000 (22:36 -0000)
committerPeter Johnson <peter@tortall.net>
Sat, 18 Mar 2006 22:36:21 +0000 (22:36 -0000)
* 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

libyasm/phash.c
libyasm/phash.h
tools/gap/perfect.c
tools/gap/perfect.h

index ed14001ba4cf68f9e9de0f094754e795ce6453fe..b828bb650e8d7fea4c079e2ad40f8f2fbc4ca4dc 100644 (file)
@@ -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;
index 1f6472574c1e0cbaee68e6e5a42c0ce2dd3ad34b..5fc44e39d54080d40a61c71e15ded11c2e977835 100644 (file)
@@ -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);
index c0b07d2898825b5e0b12feb3f44b609795917315..77464c25419d8962840e5d9879356a3d01b3f5a5 100644 (file)
@@ -279,7 +279,7 @@ static void initinl(
     ub4   i;
     for (i=0; i<mykey->len_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;
index 297778a20efd77f23513ea47905da7f78b4be790..bfb60010f6e77f1d5c1e084ebc054fee42bfda04 100644 (file)
@@ -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 */