mirror of
https://github.com/cc65/cc65.git
synced 2024-12-26 08:32:00 +00:00
Adjust to recent changes in the hash modules.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5160 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
6b79f5bbb1
commit
27964254dc
@ -64,9 +64,6 @@ static unsigned HT_GenHash (const void* Key);
|
|||||||
static const void* HT_GetKey (void* Entry);
|
static const void* HT_GetKey (void* Entry);
|
||||||
/* Given a pointer to the user entry data, return a pointer to the key. */
|
/* 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);
|
static int HT_Compare (const void* Key1, const void* Key2);
|
||||||
/* Compare two keys. The function must return a value less than zero if
|
/* 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
|
* 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 = {
|
static const HashFunctions HashFunc = {
|
||||||
HT_GenHash,
|
HT_GenHash,
|
||||||
HT_GetKey,
|
HT_GetKey,
|
||||||
HT_GetHashNode,
|
|
||||||
HT_Compare
|
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)
|
static int HT_Compare (const void* Key1, const void* Key2)
|
||||||
/* Compare two keys. The function must return a value less than zero if
|
/* 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
|
* 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));
|
FileEntry* F = xmalloc (sizeof (FileEntry));
|
||||||
|
|
||||||
/* Initialize the fields */
|
/* Initialize the fields */
|
||||||
InitHashNode (&F->Node, F);
|
InitHashNode (&F->Node);
|
||||||
F->Name = Name;
|
F->Name = Name;
|
||||||
F->Index = CollCount (&FileTab) + 1; /* First file has index #1 */
|
F->Index = CollCount (&FileTab) + 1; /* First file has index #1 */
|
||||||
F->Type = Type;
|
F->Type = Type;
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
/* common */
|
/* common */
|
||||||
#include "check.h"
|
#include "check.h"
|
||||||
#include "hashstr.h"
|
#include "hashfunc.h"
|
||||||
#include "hashtab.h"
|
#include "hashtab.h"
|
||||||
#include "xmalloc.h"
|
#include "xmalloc.h"
|
||||||
|
|
||||||
@ -68,9 +68,6 @@ static unsigned HT_GenHash (const void* Key);
|
|||||||
static const void* HT_GetKey (void* Entry);
|
static const void* HT_GetKey (void* Entry);
|
||||||
/* Given a pointer to the user entry data, return a pointer to the key */
|
/* 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);
|
static int HT_Compare (const void* Key1, const void* Key2);
|
||||||
/* Compare two keys. The function must return a value less than zero if
|
/* 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
|
* Key1 is smaller than Key2, zero if both are equal, and a value greater
|
||||||
@ -115,7 +112,6 @@ struct Macro {
|
|||||||
static const HashFunctions HashFunc = {
|
static const HashFunctions HashFunc = {
|
||||||
HT_GenHash,
|
HT_GenHash,
|
||||||
HT_GetKey,
|
HT_GetKey,
|
||||||
HT_GetHashNode,
|
|
||||||
HT_Compare
|
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)
|
static int HT_Compare (const void* Key1, const void* Key2)
|
||||||
/* Compare two keys. The function must return a value less than zero if
|
/* 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
|
* 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));
|
Macro* M = xmalloc (sizeof (Macro));
|
||||||
|
|
||||||
/* Initialize the macro struct */
|
/* Initialize the macro struct */
|
||||||
InitHashNode (&M->Node, M);
|
InitHashNode (&M->Node);
|
||||||
M->LocalCount = 0;
|
M->LocalCount = 0;
|
||||||
M->Locals = 0;
|
M->Locals = 0;
|
||||||
M->ParamCount = 0;
|
M->ParamCount = 0;
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
/* common */
|
/* common */
|
||||||
#include "addrsize.h"
|
#include "addrsize.h"
|
||||||
#include "check.h"
|
#include "check.h"
|
||||||
#include "hashstr.h"
|
#include "hashfunc.h"
|
||||||
#include "mmodel.h"
|
#include "mmodel.h"
|
||||||
#include "scopedefs.h"
|
#include "scopedefs.h"
|
||||||
#include "symdefs.h"
|
#include "symdefs.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user