More common subroutines

git-svn-id: svn://svn.cc65.org/cc65/trunk@69 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2000-06-14 09:32:22 +00:00
parent 114bc5a370
commit 1081c1dcdd
27 changed files with 363 additions and 151 deletions

View File

@@ -35,7 +35,8 @@
#include <string.h>
#include "mem.h"
#include "../common/xmalloc.h"
#include "scanner.h"
#include "toklist.h"
@@ -54,7 +55,7 @@ TokNode* NewTokNode (void)
/* Allocate memory */
unsigned Len = TokHasSVal (Tok)? strlen (SVal) : 0;
T = Xmalloc (sizeof (TokNode) + Len);
T = xmalloc (sizeof (TokNode) + Len);
/* Initialize the token contents */
T->Next = 0;
@@ -73,7 +74,7 @@ TokNode* NewTokNode (void)
void FreeTokNode (TokNode* T)
/* Free the given token node */
{
Xfree (T);
xfree (T);
}
@@ -132,7 +133,7 @@ TokList* NewTokList (void)
/* Create a new, empty token list */
{
/* Allocate memory for the list structure */
TokList* T = Xmalloc (sizeof (TokList));
TokList* T = xmalloc (sizeof (TokList));
/* Initialize the fields */
InitTokList (T);
@@ -155,7 +156,7 @@ void FreeTokList (TokList* List)
}
/* Free the list structure itself */
Xfree (List);
xfree (List);
}
@@ -168,9 +169,9 @@ void AddCurTok (TokList* List)
/* Insert the node into the list */
if (List->Root == 0) {
List->Root = T;
List->Root = T;
} else {
List->Last->Next = T;
List->Last->Next = T;
}
List->Last = T;
@@ -180,6 +181,3 @@ void AddCurTok (TokList* List)