Fix two code style errors

This commit is contained in:
ISSOtm
2020-02-13 20:43:47 +01:00
parent 30a95d735a
commit bc80e910ed

View File

@@ -547,28 +547,24 @@ void sym_AddReloc(char const *tzSym)
pScope->pScope : pScope; pScope->pScope : pScope;
uint32_t parentLen = localPtr - tzSym; uint32_t parentLen = localPtr - tzSym;
if (strchr(localPtr + 1, '.') != NULL) { if (strchr(localPtr + 1, '.') != NULL)
fatalerror("'%s' is a nonsensical reference to a nested local symbol", fatalerror("'%s' is a nonsensical reference to a nested local symbol",
tzSym); tzSym);
} else if (strlen(parent->tzName) != parentLen else if (strlen(parent->tzName) != parentLen
|| strncmp(tzSym, parent->tzName, parentLen) != 0) { || strncmp(tzSym, parent->tzName, parentLen) != 0)
yyerror("Not currently in the scope of '%.*s'", yyerror("Not currently in the scope of '%.*s'",
parentLen, tzSym); parentLen, tzSym);
}
scope = parent; scope = parent;
} }
nsym = findsymbol(tzSym, scope); nsym = findsymbol(tzSym, scope);
if (nsym != NULL) { if (!nsym)
if (sym_IsDefined(nsym)) { nsym = createsymbol(tzSym);
else if (sym_IsDefined(nsym))
yyerror("'%s' already defined in %s(%d)", tzSym, yyerror("'%s' already defined in %s(%d)", tzSym,
nsym->tzFileName, nsym->nFileLine); nsym->tzFileName, nsym->nFileLine);
}
} else {
nsym = createsymbol(tzSym);
}
nsym->nValue = nPC; nsym->nValue = nPC;
nsym->type = SYM_LABEL; nsym->type = SYM_LABEL;