h->key = key;
h->val = val;
- llassert (val != HBUCKET_DNE); /*@i523 way bogus! */
-
+ llassert (val != HBUCKET_DNE);
return (h);
}
for (i = 0; i < h->size; i++)
{
- newentries[i] = h->entries[i];
+ newentries[i] = h->entries[i];
}
- /*@i32@*/ sfree (h->entries);
+ sfree (h->entries);
h->entries = newentries;
-/*@i23@*/ }
+ /*@-compmempass@*/
+} /*@=compmempass@*/ /* Spurious warnings reported - shouldn't need this */
static int hbucket_lookup (hbucket p_h, cstring p_key);
void
cstringTable_free (/*@only@*/ cstringTable h)
{
- int i;
+ unsigned int i;
llassert (cstringTable_isDefined (h));
cstringTable_countCollisions (cstringTable h)
{
int nc = 0;
- int i;
+ unsigned int i;
llassert (cstringTable_isDefined (h));
cstringTable_countEmpty (cstringTable h)
{
int nc = 0;
- int i;
+ unsigned int i;
llassert (cstringTable_isDefined (h));
/*@only@*/ cstringTable
-cstringTable_create (int size)
+cstringTable_create (unsigned int size)
{
int i;
cstringTable h = (cstringTable) dmalloc (sizeof (*h));
cstring cstringTable_unparse (cstringTable h)
{
cstring res = cstring_newEmpty ();
- int i;
+ unsigned int i;
if (cstringTable_isDefined (h))
{
}
}
- res = message ("%qsize: %d, collisions: %d, empty: %d",
+ res = message ("%qsize: %u, collisions: %d, empty: %d",
res,
h->size,
cstringTable_countCollisions (h),
cstringTable_stats (cstringTable h)
{
llassert (cstringTable_isDefined (h));
- return (message ("size: %d, collisions: %d, empty: %d\n",
+ return (message ("size: %u, collisions: %d, empty: %d\n",
h->size, cstringTable_countCollisions (h),
cstringTable_countEmpty (h)));
}
** rehashing based (loosely) on code by Steve Harrison
*/
- int i;
- int oldsize = h->size;
- int newsize = 1 + ((oldsize * 26244) / 10000); /* 26244 = 162^2 */
+ unsigned int i;
+ /* Fix provided by Thomas Mertz (int -> unsigned long), 21 Apr 2004 */
+ unsigned long oldsize = h->size;
+ unsigned long newsize = 1 + ((oldsize * 26244) / 10000); /* 26244 = 162^2 */
hbucket *oldbuckets = h->buckets;
h->size = newsize;