aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorHartmut Brandt <harti@FreeBSD.org>2004-12-06 08:51:34 +0000
committerHartmut Brandt <harti@FreeBSD.org>2004-12-06 08:51:34 +0000
commit491fb056d30bbce807b67334acd44db3d670e519 (patch)
treed1cd3a1280596e6fc16ebd0ac6aa673c1bdfabdc /usr.bin
parentd29cf9e2f35ad5d82dcafb0d4d337db127b9e558 (diff)
downloadsrc-491fb056d30bbce807b67334acd44db3d670e519.tar.gz
src-491fb056d30bbce807b67334acd44db3d670e519.zip
Style: fix indentation, prototypes for functions even in comment.
Notes
Notes: svn path=/head/; revision=138433
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/make/hash.h38
1 files changed, 13 insertions, 25 deletions
diff --git a/usr.bin/make/hash.h b/usr.bin/make/hash.h
index 044ddf8ed4f6..0e50ee2cc34a 100644
--- a/usr.bin/make/hash.h
+++ b/usr.bin/make/hash.h
@@ -52,34 +52,28 @@
/*
* The following defines one entry in the hash table.
*/
-
typedef struct Hash_Entry {
- struct Hash_Entry *next; /* Used to link together all the
- * entries associated with the same
- * bucket. */
- void * clientData; /* Arbitrary piece of data associated
- * with key. */
- unsigned namehash; /* hash value of key */
- char name[1]; /* key string */
+ struct Hash_Entry *next; /* Link entries within same bucket. */
+ void *clientData; /* Data associated with key. */
+ unsigned namehash; /* hash value of key */
+ char name[1]; /* key string */
} Hash_Entry;
typedef struct Hash_Table {
- struct Hash_Entry **bucketPtr;/* Pointers to Hash_Entry, one
- * for each bucket in the table. */
- int size; /* Actual size of array. */
- int numEntries; /* Number of entries in the table. */
- int mask; /* Used to select bits for hashing. */
+ struct Hash_Entry **bucketPtr; /* Buckets in the table */
+ int size; /* Actual size of array. */
+ int numEntries; /* Number of entries in the table. */
+ int mask; /* Used to select bits for hashing. */
} Hash_Table;
/*
* The following structure is used by the searching routines
* to record where we are in the search.
*/
-
typedef struct Hash_Search {
- Hash_Table *tablePtr; /* Table being searched. */
- int nextIndex; /* Next bucket to check (after current). */
- Hash_Entry *hashEntryPtr; /* Next entry to check in current bucket. */
+ Hash_Table *tablePtr; /* Table being searched. */
+ int nextIndex; /* Next bucket to check */
+ Hash_Entry *hashEntryPtr; /* Next entry in current bucket */
} Hash_Search;
/*
@@ -87,24 +81,18 @@ typedef struct Hash_Search {
*/
/*
- * void * Hash_GetValue(h)
- * Hash_Entry *h;
+ * void *Hash_GetValue(const Hash_Entry *h)
*/
-
#define Hash_GetValue(h) ((h)->clientData)
/*
- * Hash_SetValue(h, val);
- * Hash_Entry *h;
- * char *val;
+ * Hash_SetValue(Hash_Entry *h, void *val);
*/
-
#define Hash_SetValue(h, val) ((h)->clientData = (val))
/*
* Hash_Size(n) returns the number of words in an object of n bytes
*/
-
#define Hash_Size(n) (((n) + sizeof(int) - 1) / sizeof(int))
void Hash_InitTable(Hash_Table *, int);