Actually rely on createsymbol never returning NULL

This reduces complexity, basically
This commit is contained in:
ISSOtm
2020-01-21 11:37:30 +01:00
parent a7c0616cd8
commit 3fb5648880

View File

@@ -493,12 +493,10 @@ void sym_AddEqu(char *tzSym, int32_t value)
{
struct sSymbol *nsym = createNonrelocSymbol(tzSym);
if (nsym) {
nsym->nValue = value;
nsym->nType |= SYMF_EQU | SYMF_DEFINED | SYMF_CONST;
nsym->pScope = NULL;
updateSymbolFilename(nsym);
}
}
/*
@@ -517,7 +515,6 @@ void sym_AddString(char *tzSym, char *tzValue)
{
struct sSymbol *nsym = createNonrelocSymbol(tzSym);
if (nsym) {
nsym->pMacro = malloc(strlen(tzValue) + 1);
if (nsym->pMacro != NULL)
@@ -528,7 +525,6 @@ void sym_AddString(char *tzSym, char *tzValue)
nsym->nType |= SYMF_STRING | SYMF_DEFINED;
nsym->ulMacroSize = strlen(tzValue);
nsym->pScope = NULL;
}
}
/*
@@ -570,12 +566,10 @@ void sym_AddSet(char *tzSym, int32_t value)
nsym = createsymbol(tzSym);
}
if (nsym) {
nsym->nValue = value;
nsym->nType |= SYMF_SET | SYMF_DEFINED | SYMF_CONST;
nsym->pScope = NULL;
updateSymbolFilename(nsym);
}
}
/*
@@ -634,7 +628,6 @@ void sym_AddReloc(char *tzSym)
nsym = createsymbol(tzSym);
}
if (nsym) {
nsym->nValue = nPC;
nsym->nType |= SYMF_RELOC | SYMF_DEFINED;
if (localPtr)
@@ -651,7 +644,6 @@ void sym_AddReloc(char *tzSym)
tzSym);
updateSymbolFilename(nsym);
}
pScope = findsymbol(tzSym, scope);
}
@@ -713,7 +705,6 @@ void sym_Export(char *tzSym)
if (nsym == NULL)
nsym = createsymbol(tzSym);
if (nsym)
nsym->nType |= SYMF_EXPORT;
}
@@ -724,7 +715,6 @@ void sym_AddMacro(char *tzSym, int32_t nDefLineNo)
{
struct sSymbol *nsym = createNonrelocSymbol(tzSym);
if (nsym) {
nsym->nType |= SYMF_MACRO | SYMF_DEFINED;
nsym->pScope = NULL;
nsym->ulMacroSize = ulNewMacroSize;
@@ -735,7 +725,6 @@ void sym_AddMacro(char *tzSym, int32_t nDefLineNo)
* override this with the actual definition line
*/
nsym->nFileLine = nDefLineNo;
}
}
/*
@@ -762,11 +751,10 @@ void sym_Ref(char *tzSym)
nsym = createsymbol(tzSym);
if (nsym && isLocal)
if (isLocal)
nsym->nType |= SYMF_LOCAL;
}
if (nsym)
nsym->nType |= SYMF_REF;
}