X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fld65%2Fextsyms.c;h=5224ac34b7f70f20c969a2787babc73dc9932d8a;hb=295d853b89342e0734a5970359bfe266266bc8bf;hp=73582b35365c14d25d0b3de730d7f5b8e3483a66;hpb=53dd513176425872128ef26031d00952ef7a0628;p=cc65 diff --git a/src/ld65/extsyms.c b/src/ld65/extsyms.c index 73582b353..5224ac34b 100644 --- a/src/ld65/extsyms.c +++ b/src/ld65/extsyms.c @@ -36,8 +36,8 @@ #include #include "../common/hashstr.h" +#include "../common/xmalloc.h" -#include "mem.h" #include "error.h" #include "extsyms.h" @@ -88,11 +88,11 @@ ExtSym* NewExtSym (ExtSymTab* Tab, const char* Name) ExtSym* E = GetExtSym (Tab, Name); /* Don't care about duplicate hash here... */ if (E != 0) { /* We do already have a symbol with this name */ - Error ("Duplicate external symbol `%s'", Name); + Error ("Duplicate external symbol `%s'", Name); } /* Allocate memory for the structure */ - E = Xmalloc (sizeof (ExtSym) + Len); + E = xmalloc (sizeof (ExtSym) + Len); /* Initialize the structure */ E->List = 0; @@ -102,10 +102,10 @@ ExtSym* NewExtSym (ExtSymTab* Tab, const char* Name) /* Insert the entry into the list of all symbols */ if (Tab->Last == 0) { - /* List is empty */ - Tab->Root = E; + /* List is empty */ + Tab->Root = E; } else { - /* List not empty */ + /* List not empty */ Tab->Last->List = E; } Tab->Last = E; @@ -120,13 +120,13 @@ ExtSym* NewExtSym (ExtSymTab* Tab, const char* Name) } - + static void FreeExtSym (ExtSym* E) /* Free an external symbol structure. Will not unlink the entry, so internal * use only. */ { - Xfree (E); + xfree (E); } @@ -137,14 +137,14 @@ ExtSymTab* NewExtSymTab (void) unsigned I; /* Allocate memory */ - ExtSymTab* Tab = Xmalloc (sizeof (ExtSymTab)); + ExtSymTab* Tab = xmalloc (sizeof (ExtSymTab)); /* Initialize the fields */ Tab->Root = 0; Tab->Last = 0; Tab->Count = 0; for (I = 0; I < HASHTAB_SIZE; ++I) { - Tab->HashTab [I] = 0; + Tab->HashTab [I] = 0; } /* Done, return the hash table */ @@ -158,13 +158,13 @@ void FreeExtSymTab (ExtSymTab* Tab) { /* Free all entries */ while (Tab->Root) { - ExtSym* E = Tab->Root; - Tab->Root = E->Next; - FreeExtSym (E); + ExtSym* E = Tab->Root; + Tab->Root = E->Next; + FreeExtSym (E); } /* Free the struct itself */ - Xfree (Tab); + xfree (Tab); }