Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/make make(1): remove underscore from Hash_Table and ...
details: https://anonhg.NetBSD.org/src/rev/61bfb648640a
branches: trunk
changeset: 944988:61bfb648640a
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Oct 18 12:36:43 2020 +0000
description:
make(1): remove underscore from Hash_Table and Hash_Entry
For consistency with the other type names, such as GNodeListNode.
diffstat:
usr.bin/make/arch.c | 10 ++++----
usr.bin/make/dir.c | 20 +++++++++---------
usr.bin/make/dir.h | 4 +-
usr.bin/make/hash.c | 58 ++++++++++++++++++++++++++--------------------------
usr.bin/make/hash.h | 40 ++++++++++++++++++------------------
usr.bin/make/main.c | 6 ++--
usr.bin/make/make.h | 4 +-
usr.bin/make/targ.c | 8 +++---
usr.bin/make/var.c | 16 +++++++-------
9 files changed, 83 insertions(+), 83 deletions(-)
diffs (truncated from 537 to 300 lines):
diff -r 3cc9bdb17267 -r 61bfb648640a usr.bin/make/arch.c
--- a/usr.bin/make/arch.c Sun Oct 18 12:00:16 2020 +0000
+++ b/usr.bin/make/arch.c Sun Oct 18 12:36:43 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: arch.c,v 1.134 2020/10/18 12:00:16 rillig Exp $ */
+/* $NetBSD: arch.c,v 1.135 2020/10/18 12:36:43 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -130,7 +130,7 @@
#include "config.h"
/* "@(#)arch.c 8.2 (Berkeley) 1/2/94" */
-MAKE_RCSID("$NetBSD: arch.c,v 1.134 2020/10/18 12:00:16 rillig Exp $");
+MAKE_RCSID("$NetBSD: arch.c,v 1.135 2020/10/18 12:36:43 rillig Exp $");
#ifdef TARGET_MACHINE
#undef MAKE_MACHINE
@@ -148,7 +148,7 @@
typedef struct Arch {
char *name; /* Name of archive */
- Hash_Table members; /* All the members of the archive described
+ HashTable members; /* All the members of the archive described
* by <name, struct ar_hdr *> key/value pairs */
char *fnametab; /* Extended name table strings */
size_t fnamesize; /* Size of the string table */
@@ -167,7 +167,7 @@
{
Arch *a = (Arch *)ap;
HashIter hi;
- Hash_Entry *he;
+ HashEntry *he;
/* Free memory from hash entries */
HashIter_Init(&hi, &a->members);
@@ -606,7 +606,7 @@
#endif
{
- Hash_Entry *he;
+ HashEntry *he;
he = Hash_CreateEntry(&ar->members, memName, NULL);
Hash_SetValue(he, bmake_malloc(sizeof(struct ar_hdr)));
memcpy(Hash_GetValue(he), &arh, sizeof(struct ar_hdr));
diff -r 3cc9bdb17267 -r 61bfb648640a usr.bin/make/dir.c
--- a/usr.bin/make/dir.c Sun Oct 18 12:00:16 2020 +0000
+++ b/usr.bin/make/dir.c Sun Oct 18 12:36:43 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dir.c,v 1.164 2020/10/18 10:44:25 rillig Exp $ */
+/* $NetBSD: dir.c,v 1.165 2020/10/18 12:36:43 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -135,7 +135,7 @@
#include "job.h"
/* "@(#)dir.c 8.2 (Berkeley) 1/2/94" */
-MAKE_RCSID("$NetBSD: dir.c,v 1.164 2020/10/18 10:44:25 rillig Exp $");
+MAKE_RCSID("$NetBSD: dir.c,v 1.165 2020/10/18 12:36:43 rillig Exp $");
#define DIR_DEBUG0(text) DEBUG0(DIR, text)
#define DIR_DEBUG1(fmt, arg1) DEBUG1(DIR, fmt, arg1)
@@ -221,7 +221,7 @@
/* A list of cached directories, with fast lookup by directory name. */
typedef struct OpenDirs {
CachedDirList *list;
- Hash_Table /* of CachedDirListNode */ table;
+ HashTable /* of CachedDirListNode */ table;
} OpenDirs;
static void
@@ -255,7 +255,7 @@
static void
OpenDirs_Add(OpenDirs *odirs, CachedDir *cdir)
{
- Hash_Entry *he = Hash_FindEntry(&odirs->table, cdir->name);
+ HashEntry *he = Hash_FindEntry(&odirs->table, cdir->name);
if (he != NULL)
return;
he = Hash_CreateEntry(&odirs->table, cdir->name, NULL);
@@ -266,7 +266,7 @@
static void
OpenDirs_Remove(OpenDirs *odirs, const char *name)
{
- Hash_Entry *he = Hash_FindEntry(&odirs->table, name);
+ HashEntry *he = Hash_FindEntry(&odirs->table, name);
CachedDirListNode *ln;
if (he == NULL)
return;
@@ -298,9 +298,9 @@
* already updated the file, in which case we'll update it again. Generally,
* there won't be two rules to update a single file, so this should be ok,
* but... */
-static Hash_Table mtimes;
+static HashTable mtimes;
-static Hash_Table lmtimes; /* same as mtimes but for lstat */
+static HashTable lmtimes; /* same as mtimes but for lstat */
/*
* We use stat(2) a lot, cache the results.
@@ -320,10 +320,10 @@
/* Returns 0 and the result of stat(2) or lstat(2) in *mst, or -1 on error. */
static int
-cached_stats(Hash_Table *htp, const char *pathname, struct make_stat *mst,
+cached_stats(HashTable *htp, const char *pathname, struct make_stat *mst,
CachedStatsFlags flags)
{
- Hash_Entry *entry;
+ HashEntry *entry;
struct stat sys_st;
struct cache_st *cst;
int rc;
@@ -609,7 +609,7 @@
DirMatchFiles(const char *pattern, CachedDir *dir, StringList *expansions)
{
HashIter hi;
- Hash_Entry *entry; /* Current entry in the table */
+ HashEntry *entry; /* Current entry in the table */
Boolean isDot; /* TRUE if the directory being searched is . */
isDot = (dir->name[0] == '.' && dir->name[1] == '\0');
diff -r 3cc9bdb17267 -r 61bfb648640a usr.bin/make/dir.h
--- a/usr.bin/make/dir.h Sun Oct 18 12:00:16 2020 +0000
+++ b/usr.bin/make/dir.h Sun Oct 18 12:36:43 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dir.h,v 1.29 2020/10/05 22:45:47 rillig Exp $ */
+/* $NetBSD: dir.h,v 1.30 2020/10/18 12:36:43 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -87,7 +87,7 @@
int refCount; /* Number of SearchPaths with this directory */
int hits; /* The number of times a file in this
* directory has been found */
- Hash_Table files; /* Hash set of files in directory */
+ HashTable files; /* Hash set of files in directory */
} CachedDir;
void Dir_Init(void);
diff -r 3cc9bdb17267 -r 61bfb648640a usr.bin/make/hash.c
--- a/usr.bin/make/hash.c Sun Oct 18 12:00:16 2020 +0000
+++ b/usr.bin/make/hash.c Sun Oct 18 12:36:43 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hash.c,v 1.45 2020/10/18 10:44:25 rillig Exp $ */
+/* $NetBSD: hash.c,v 1.46 2020/10/18 12:36:43 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -79,7 +79,7 @@
#include "make.h"
/* "@(#)hash.c 8.1 (Berkeley) 6/6/93" */
-MAKE_RCSID("$NetBSD: hash.c,v 1.45 2020/10/18 10:44:25 rillig Exp $");
+MAKE_RCSID("$NetBSD: hash.c,v 1.46 2020/10/18 12:36:43 rillig Exp $");
/*
* The ratio of # entries to # buckets at which we rebuild the table to
@@ -100,10 +100,10 @@
return h;
}
-static Hash_Entry *
-HashTable_Find(Hash_Table *t, unsigned int h, const char *key)
+static HashEntry *
+HashTable_Find(HashTable *t, unsigned int h, const char *key)
{
- Hash_Entry *e;
+ HashEntry *e;
unsigned int chainlen = 0;
#ifdef DEBUG_HASH_LOOKUP
@@ -124,10 +124,10 @@
/* Sets up the hash table. */
void
-Hash_InitTable(Hash_Table *t)
+Hash_InitTable(HashTable *t)
{
unsigned int n = 16, i;
- struct Hash_Entry **hp;
+ HashEntry **hp;
t->numEntries = 0;
t->maxchain = 0;
@@ -139,11 +139,11 @@
}
/* Removes everything from the hash table and frees up the memory space it
- * occupied (except for the space in the Hash_Table structure). */
+ * occupied (except for the space in the HashTable structure). */
void
-Hash_DeleteTable(Hash_Table *t)
+Hash_DeleteTable(HashTable *t)
{
- struct Hash_Entry **hp, *h, *nexth = NULL;
+ HashEntry **hp, *h, *nexth = NULL;
int i;
for (hp = t->buckets, i = (int)t->bucketsSize; --i >= 0;) {
@@ -171,29 +171,29 @@
* Returns a pointer to the entry for key, or NULL if the table contains
* no entry for the key.
*/
-Hash_Entry *
-Hash_FindEntry(Hash_Table *t, const char *key)
+HashEntry *
+Hash_FindEntry(HashTable *t, const char *key)
{
unsigned int h = hash(key, NULL);
return HashTable_Find(t, h, key);
}
void *
-Hash_FindValue(Hash_Table *t, const char *key)
+Hash_FindValue(HashTable *t, const char *key)
{
- Hash_Entry *he = Hash_FindEntry(t, key);
+ HashEntry *he = Hash_FindEntry(t, key);
return he != NULL ? he->value : NULL;
}
/* Makes a new hash table that is larger than the old one. The entire hash
* table is moved, so any bucket numbers from the old table become invalid. */
static void
-RebuildTable(Hash_Table *t)
+RebuildTable(HashTable *t)
{
- Hash_Entry *e, *next = NULL, **hp, **xp;
+ HashEntry *e, *next = NULL, **hp, **xp;
int i;
unsigned int mask, oldsize, newsize;
- Hash_Entry **oldhp;
+ HashEntry **oldhp;
oldhp = t->buckets;
oldsize = t->bucketsSize;
@@ -227,13 +227,13 @@
* newPtr Filled with TRUE if new entry created,
* FALSE otherwise.
*/
-Hash_Entry *
-Hash_CreateEntry(Hash_Table *t, const char *key, Boolean *newPtr)
+HashEntry *
+Hash_CreateEntry(HashTable *t, const char *key, Boolean *newPtr)
{
- Hash_Entry *e;
+ HashEntry *e;
unsigned h;
size_t keylen;
- struct Hash_Entry **hp;
+ HashEntry **hp;
h = hash(key, &keylen);
e = HashTable_Find(t, h, key);
@@ -267,9 +267,9 @@
/* Delete the given hash table entry and free memory associated with it. */
void
-Hash_DeleteEntry(Hash_Table *t, Hash_Entry *e)
+Hash_DeleteEntry(HashTable *t, HashEntry *e)
{
- Hash_Entry **hp, *p;
+ HashEntry **hp, *p;
for (hp = &t->buckets[e->namehash & t->bucketsMask];
(p = *hp) != NULL; hp = &p->next) {
@@ -285,7 +285,7 @@
/* Set things up for iterating over all entries in the hash table. */
void
-HashIter_Init(HashIter *hi, Hash_Table *t)
+HashIter_Init(HashIter *hi, HashTable *t)
{
hi->table = t;
hi->nextBucket = 0;
@@ -294,11 +294,11 @@
/* Return the next entry in the hash table, or NULL if the end of the table
* is reached. */
-Hash_Entry *
+HashEntry *
HashIter_Next(HashIter *hi)
{
- Hash_Entry *e;
- Hash_Table *t = hi->table;
+ HashEntry *e;
+ HashTable *t = hi->table;
/*
* The entry field points to the most recently returned
@@ -322,8 +322,8 @@
}
void
-Hash_DebugStats(Hash_Table *t, const char *name)
+Hash_DebugStats(HashTable *t, const char *name)
{
Home |
Main Index |
Thread Index |
Old Index