summaryrefslogtreecommitdiffstats
path: root/usr.bin/make/hash.c
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2004-11-30 17:46:29 +0000
committerharti <harti@FreeBSD.org>2004-11-30 17:46:29 +0000
commitba6eb9dcb908ffe7a797968e8a9b7dff037333e4 (patch)
tree056a9516097226d7d6992273b2586fdf619c382c /usr.bin/make/hash.c
parent82f18a9482f4ba9dc496eb84ba5acec216728a40 (diff)
downloadFreeBSD-src-ba6eb9dcb908ffe7a797968e8a9b7dff037333e4.zip
FreeBSD-src-ba6eb9dcb908ffe7a797968e8a9b7dff037333e4.tar.gz
Stylification: missing spaces, extra space after function names, casts
and the sizeof operator, missing empty lines, void casts, extra empty lines. Checked by: diff on make *.o lst.lib/*.o Submitted by: Max Okumoto <okumoto@soe.ucsd.edu> (partly)
Diffstat (limited to 'usr.bin/make/hash.c')
-rw-r--r--usr.bin/make/hash.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/usr.bin/make/hash.c b/usr.bin/make/hash.c
index 7d2c64d..f3103dd 100644
--- a/usr.bin/make/hash.c
+++ b/usr.bin/make/hash.c
@@ -72,7 +72,7 @@ static void RebuildTable(Hash_Table *);
*---------------------------------------------------------
*
* Hash_InitTable --
- *
+ *
* Set up the hash table t with a given number of buckets, or a
* reasonable default if the number requested is less than or
* equal to zero. Hash tables will grow in size as needed.
@@ -234,13 +234,13 @@ Hash_CreateEntry(Hash_Table *t, char *key, Boolean *newPtr)
*/
if (t->numEntries >= rebuildLimit * t->size)
RebuildTable(t);
- e = (Hash_Entry *) emalloc(sizeof(*e) + keylen);
+ e = (Hash_Entry *)emalloc(sizeof(*e) + keylen);
hp = &t->bucketPtr[h & t->mask];
e->next = *hp;
*hp = e;
e->clientData = NULL;
e->namehash = h;
- (void) strcpy(e->name, p);
+ strcpy(e->name, p);
t->numEntries++;
if (newPtr != NULL)
@@ -281,7 +281,7 @@ Hash_DeleteEntry(Hash_Table *t, Hash_Entry *e)
return;
}
}
- (void) write(STDERR_FILENO, "bad call to Hash_DeleteEntry\n", 29);
+ write(STDERR_FILENO, "bad call to Hash_DeleteEntry\n", 29);
abort();
}
@@ -307,10 +307,11 @@ Hash_DeleteEntry(Hash_Table *t, Hash_Entry *e)
Hash_Entry *
Hash_EnumFirst(Hash_Table *t, Hash_Search *searchPtr)
{
+
searchPtr->tablePtr = t;
searchPtr->nextIndex = 0;
searchPtr->hashEntryPtr = NULL;
- return Hash_EnumNext(searchPtr);
+ return (Hash_EnumNext(searchPtr));
}
/*
@@ -388,7 +389,7 @@ RebuildTable(Hash_Table *t)
i <<= 1;
t->size = i;
t->mask = mask = i - 1;
- t->bucketPtr = hp = (struct Hash_Entry **) emalloc(sizeof(*hp) * i);
+ t->bucketPtr = hp = (struct Hash_Entry **)emalloc(sizeof(*hp) * i);
while (--i >= 0)
*hp++ = NULL;
for (hp = oldhp, i = oldsize; --i >= 0;) {
OpenPOWER on IntegriCloud