a9e2c03ac20549afbec470813a86987dc2fe4dec kent Tue Mar 15 00:19:42 2011 -0700 Indulging in a little paranoia about void pointer arithmetic. diff --git src/lib/hash.c src/lib/hash.c index 0cd90b8..8ec874a 100644 --- src/lib/hash.c +++ src/lib/hash.c @@ -312,31 +312,33 @@ char *pt = NULL; return hashAdd(hash, name, pt + val); } void hashIncInt(struct hash *hash, char *name) /* Increment integer value in hash */ { struct hashEl *hel = hashLookup(hash, name); if (hel == NULL) { hashAddInt(hash, name, 1); } else { - ++hel->val; + hel->val = ((char *)hel->val)+1; + /* The much simpler ++hel->val works for gnu C, but really adding one to a void pointer + * I think is not well defined. */ } } long long hashIntSum(struct hash *hash) /* Return sum of all the ints in a hash of ints. */ { long long sum = 0; int i; struct hashEl *hel; for (i=0; isize; ++i) { for (hel = hash->table[i]; hel != NULL; hel = hel->next) { int num = ptToInt(hel->val); sum += (long long)num;