shithub: rgbds

Download patch

ref: 2b0c34ecb57e0187541b327020d09f41370cfe54
parent: b0ec8468e65c1fdc17102fcfd29747ef29535f4f
author: ISSOtm <[email protected]>
date: Tue Apr 7 20:44:41 EDT 2020

Fix a few code style errors

--- a/include/link/main.h
+++ b/include/link/main.h
@@ -44,7 +44,7 @@
  * @param mode The mode to open the file with
  * @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 { \
 				FILE *tmp = file; \
--- a/include/link/patch.h
+++ b/include/link/patch.h
@@ -25,7 +25,7 @@
 	 * This would be redundant with `.section->fileSymbols`... but
 	 * `section` is sometimes NULL!
 	 */
-	struct Symbol ** fileSymbols;
+	struct Symbol **fileSymbols;
 
 	struct Assertion *next;
 };
--- a/src/asm/symbol.c
+++ b/src/asm/symbol.c
@@ -52,7 +52,7 @@
 static bool exportall;
 
 struct ForEachArgs {
-	void (*func)(struct sSymbol *, void *);
+	void (*func)(struct sSymbol *symbol, void *arg);
 	void *arg;
 };
 
@@ -398,10 +398,10 @@
 
 		fullSymbolName(fullname, sizeof(fullname), tzSym, pScope);
 		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;
 }
 
 /*
--- a/src/link/patch.c
+++ b/src/link/patch.c
@@ -366,7 +366,7 @@
 	while (assert) {
 		if (!computeRPNExpr(&assert->patch,
 				    (struct Symbol const * const *)
-				    			assert->fileSymbols)) {
+							assert->fileSymbols)) {
 			switch ((enum AssertionType)assert->patch.type) {
 			case ASSERT_FATAL:
 				fatal("%s: %s", assert->patch.fileName,
--- a/src/link/section.c
+++ b/src/link/section.c
@@ -64,10 +64,10 @@
 		} else if (target->isAlignFixed
 			&& (other->alignMask & target->alignOfs)
 				 != (target->alignMask & other->alignOfs)) {
-				errx(1, "Section \"%s\" is defined with conflicting %u-byte alignment (offset %u) and %u-byte alignment (offset %u)",
-				     other->name, target->alignMask + 1,
-				     target->alignOfs, other->alignMask + 1,
-				     other->alignOfs);
+			errx(1, "Section \"%s\" is defined with conflicting %u-byte alignment (offset %u) and %u-byte alignment (offset %u)",
+			     other->name, target->alignMask + 1,
+			     target->alignOfs, other->alignMask + 1,
+			     other->alignOfs);
 		} else if (!target->isAlignFixed
 			|| (other->alignMask > target->alignMask)) {
 			target->isAlignFixed = true;