Fix a few code style errors

This commit is contained in:
ISSOtm
2020-04-08 00:44:41 +02:00
parent b0ec8468e6
commit 2b0c34ecb5
5 changed files with 11 additions and 11 deletions

View File

@@ -44,7 +44,7 @@ noreturn_ void fatal(char const *fmt, ...);
* @param mode The mode to open the file with * @param mode The mode to open the file with
* @return A pointer to a valid FILE structure, or NULL if fileName was NULL * @return A pointer to a valid FILE structure, or NULL if fileName was NULL
*/ */
FILE * openFile(char const *fileName, char const *mode); FILE *openFile(char const *fileName, char const *mode);
#define closeFile(file) do { \ #define closeFile(file) do { \
FILE *tmp = file; \ FILE *tmp = file; \

View File

@@ -25,7 +25,7 @@ struct Assertion {
* This would be redundant with `.section->fileSymbols`... but * This would be redundant with `.section->fileSymbols`... but
* `section` is sometimes NULL! * `section` is sometimes NULL!
*/ */
struct Symbol ** fileSymbols; struct Symbol **fileSymbols;
struct Assertion *next; struct Assertion *next;
}; };

View File

@@ -52,7 +52,7 @@ static char SavedSECOND[3];
static bool exportall; static bool exportall;
struct ForEachArgs { struct ForEachArgs {
void (*func)(struct sSymbol *, void *); void (*func)(struct sSymbol *symbol, void *arg);
void *arg; void *arg;
}; };
@@ -398,10 +398,10 @@ struct sSymbol *sym_AddLocalReloc(char const *tzSym)
fullSymbolName(fullname, sizeof(fullname), tzSym, pScope); fullSymbolName(fullname, sizeof(fullname), tzSym, pScope);
return sym_AddReloc(fullname); return sym_AddReloc(fullname);
} else {
yyerror("Local label '%s' in main scope", tzSym);
return NULL;
} }
yyerror("Local label '%s' in main scope", tzSym);
return NULL;
} }
/* /*

View File

@@ -366,7 +366,7 @@ void patch_CheckAssertions(struct Assertion *assert)
while (assert) { while (assert) {
if (!computeRPNExpr(&assert->patch, if (!computeRPNExpr(&assert->patch,
(struct Symbol const * const *) (struct Symbol const * const *)
assert->fileSymbols)) { assert->fileSymbols)) {
switch ((enum AssertionType)assert->patch.type) { switch ((enum AssertionType)assert->patch.type) {
case ASSERT_FATAL: case ASSERT_FATAL:
fatal("%s: %s", assert->patch.fileName, fatal("%s: %s", assert->patch.fileName,

View File

@@ -64,10 +64,10 @@ static void mergeSections(struct Section *target, struct Section *other)
} else if (target->isAlignFixed } else if (target->isAlignFixed
&& (other->alignMask & target->alignOfs) && (other->alignMask & target->alignOfs)
!= (target->alignMask & other->alignOfs)) { != (target->alignMask & other->alignOfs)) {
errx(1, "Section \"%s\" is defined with conflicting %u-byte alignment (offset %u) and %u-byte alignment (offset %u)", errx(1, "Section \"%s\" is defined with conflicting %u-byte alignment (offset %u) and %u-byte alignment (offset %u)",
other->name, target->alignMask + 1, other->name, target->alignMask + 1,
target->alignOfs, other->alignMask + 1, target->alignOfs, other->alignMask + 1,
other->alignOfs); other->alignOfs);
} else if (!target->isAlignFixed } else if (!target->isAlignFixed
|| (other->alignMask > target->alignMask)) { || (other->alignMask > target->alignMask)) {
target->isAlignFixed = true; target->isAlignFixed = true;