From 27964254dc0171b838370984981c1e068c47e76d Mon Sep 17 00:00:00 2001 From: uz Date: Fri, 12 Aug 2011 16:22:28 +0000 Subject: [PATCH] Adjust to recent changes in the hash modules. git-svn-id: svn://svn.cc65.org/cc65/trunk@5160 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/ca65/filetab.c | 14 +------------- src/ca65/macro.c | 16 ++-------------- src/ca65/symtab.c | 2 +- 3 files changed, 4 insertions(+), 28 deletions(-) diff --git a/src/ca65/filetab.c b/src/ca65/filetab.c index 43df4def5..ad760988f 100644 --- a/src/ca65/filetab.c +++ b/src/ca65/filetab.c @@ -64,9 +64,6 @@ static unsigned HT_GenHash (const void* Key); static const void* HT_GetKey (void* Entry); /* Given a pointer to the user entry data, return a pointer to the key. */ -static HashNode* HT_GetHashNode (void* Entry); -/* Given a pointer to the user entry data, return a pointer to the hash node */ - static int HT_Compare (const void* Key1, const void* Key2); /* Compare two keys. The function must return a value less than zero if * Key1 is smaller than Key2, zero if both are equal, and a value greater @@ -103,7 +100,6 @@ static Collection FileTab = STATIC_COLLECTION_INITIALIZER; static const HashFunctions HashFunc = { HT_GenHash, HT_GetKey, - HT_GetHashNode, HT_Compare }; @@ -134,14 +130,6 @@ static const void* HT_GetKey (void* Entry) -static HashNode* HT_GetHashNode (void* Entry) -/* Given a pointer to the user entry data, return a pointer to the hash node */ -{ - return &((FileEntry*) Entry)->Node; -} - - - static int HT_Compare (const void* Key1, const void* Key2) /* Compare two keys. The function must return a value less than zero if * Key1 is smaller than Key2, zero if both are equal, and a value greater @@ -167,7 +155,7 @@ static FileEntry* NewFileEntry (unsigned Name, FileType Type, FileEntry* F = xmalloc (sizeof (FileEntry)); /* Initialize the fields */ - InitHashNode (&F->Node, F); + InitHashNode (&F->Node); F->Name = Name; F->Index = CollCount (&FileTab) + 1; /* First file has index #1 */ F->Type = Type; diff --git a/src/ca65/macro.c b/src/ca65/macro.c index 204ac2b95..34d7eaeb7 100644 --- a/src/ca65/macro.c +++ b/src/ca65/macro.c @@ -38,7 +38,7 @@ /* common */ #include "check.h" -#include "hashstr.h" +#include "hashfunc.h" #include "hashtab.h" #include "xmalloc.h" @@ -68,9 +68,6 @@ static unsigned HT_GenHash (const void* Key); static const void* HT_GetKey (void* Entry); /* Given a pointer to the user entry data, return a pointer to the key */ -static HashNode* HT_GetHashNode (void* Entry); -/* Given a pointer to the user entry data, return a pointer to the hash node */ - static int HT_Compare (const void* Key1, const void* Key2); /* Compare two keys. The function must return a value less than zero if * Key1 is smaller than Key2, zero if both are equal, and a value greater @@ -115,7 +112,6 @@ struct Macro { static const HashFunctions HashFunc = { HT_GenHash, HT_GetKey, - HT_GetHashNode, HT_Compare }; @@ -176,14 +172,6 @@ static const void* HT_GetKey (void* Entry) -static HashNode* HT_GetHashNode (void* Entry) -/* Given a pointer to the user entry data, return a pointer to the hash node */ -{ - return &((Macro*) Entry)->Node; -} - - - static int HT_Compare (const void* Key1, const void* Key2) /* Compare two keys. The function must return a value less than zero if * Key1 is smaller than Key2, zero if both are equal, and a value greater @@ -249,7 +237,7 @@ static Macro* NewMacro (const StrBuf* Name, unsigned char Style) Macro* M = xmalloc (sizeof (Macro)); /* Initialize the macro struct */ - InitHashNode (&M->Node, M); + InitHashNode (&M->Node); M->LocalCount = 0; M->Locals = 0; M->ParamCount = 0; diff --git a/src/ca65/symtab.c b/src/ca65/symtab.c index 409a49669..514d863df 100644 --- a/src/ca65/symtab.c +++ b/src/ca65/symtab.c @@ -38,7 +38,7 @@ /* common */ #include "addrsize.h" #include "check.h" -#include "hashstr.h" +#include "hashfunc.h" #include "mmodel.h" #include "scopedefs.h" #include "symdefs.h" -- 2.39.5