From e50e3e5a23b8f72d5f4809e1d9ceebe1c6cccaa8 Mon Sep 17 00:00:00 2001 From: AntonioND Date: Sun, 2 Apr 2017 17:46:07 +0100 Subject: [PATCH] Remove trailing whitespace Signed-off-by: AntonioND --- include/asm/rpn.h | 38 +++++++++--------- include/extern/stdnoreturn.h | 2 +- src/asm/fstack.c | 20 +++++----- src/asm/globlex.c | 20 +++++----- src/asm/lexer.c | 42 ++++++++++---------- src/asm/main.c | 16 ++++---- src/asm/math.c | 28 +++++++------- src/asm/output.c | 75 ++++++++++++++++++------------------ src/asm/rpn.c | 64 +++++++++++++++--------------- src/asm/symbol.c | 64 +++++++++++++++--------------- src/link/assign.c | 4 +- src/link/library.c | 6 +-- src/link/mapfile.c | 12 +++--- src/link/object.c | 16 ++++---- src/link/output.c | 10 ++--- src/link/patch.c | 12 +++--- src/link/symbol.c | 10 ++--- 17 files changed, 219 insertions(+), 220 deletions(-) diff --git a/include/asm/rpn.h b/include/asm/rpn.h index faf75563..0972098b 100644 --- a/include/asm/rpn.h +++ b/include/asm/rpn.h @@ -15,58 +15,58 @@ ULONG rpn_isPCRelative(struct Expression * expr); void rpn_Symbol(struct Expression * expr, char *tzSym); void rpn_Number(struct Expression * expr, ULONG i); void rpn_LOGNOT(struct Expression * expr, struct Expression * src1); -void +void rpn_LOGOR(struct Expression * expr, struct Expression * src1, struct Expression * src2); -void +void rpn_LOGAND(struct Expression * expr, struct Expression * src1, struct Expression * src2); -void +void rpn_LOGEQU(struct Expression * expr, struct Expression * src1, struct Expression * src2); -void +void rpn_LOGGT(struct Expression * expr, struct Expression * src1, struct Expression * src2); -void +void rpn_LOGLT(struct Expression * expr, struct Expression * src1, struct Expression * src2); -void +void rpn_LOGGE(struct Expression * expr, struct Expression * src1, struct Expression * src2); -void +void rpn_LOGLE(struct Expression * expr, struct Expression * src1, struct Expression * src2); -void +void rpn_LOGNE(struct Expression * expr, struct Expression * src1, struct Expression * src2); -void +void rpn_ADD(struct Expression * expr, struct Expression * src1, struct Expression * src2); -void +void rpn_SUB(struct Expression * expr, struct Expression * src1, struct Expression * src2); -void +void rpn_XOR(struct Expression * expr, struct Expression * src1, struct Expression * src2); -void +void rpn_OR(struct Expression * expr, struct Expression * src1, struct Expression * src2); -void +void rpn_AND(struct Expression * expr, struct Expression * src1, struct Expression * src2); -void +void rpn_SHL(struct Expression * expr, struct Expression * src1, struct Expression * src2); -void +void rpn_SHR(struct Expression * expr, struct Expression * src1, struct Expression * src2); -void +void rpn_MUL(struct Expression * expr, struct Expression * src1, struct Expression * src2); -void +void rpn_DIV(struct Expression * expr, struct Expression * src1, struct Expression * src2); -void +void rpn_MOD(struct Expression * expr, struct Expression * src1, struct Expression * src2); void rpn_UNNEG(struct Expression * expr, struct Expression * src); @@ -74,7 +74,7 @@ void rpn_UNNOT(struct Expression * expr, struct Expression * src); UWORD rpn_PopByte(struct Expression * expr); void rpn_Bank(struct Expression * expr, char *tzSym); void rpn_Reset(struct Expression * expr); -int +int rpn_RangeCheck(struct Expression * expr, struct Expression * src, SLONG low, SLONG high); void rpn_CheckHRAM(struct Expression * expr, struct Expression * src1); diff --git a/include/extern/stdnoreturn.h b/include/extern/stdnoreturn.h index eec7c8ee..30a81d13 100644 --- a/include/extern/stdnoreturn.h +++ b/include/extern/stdnoreturn.h @@ -12,5 +12,5 @@ #define noreturn _declspec( noreturn) #else /* unsupported, but no need to throw a fit */ - #define noreturn + #define noreturn #endif diff --git a/src/asm/fstack.c b/src/asm/fstack.c index 4fe762ab..15da94e7 100644 --- a/src/asm/fstack.c +++ b/src/asm/fstack.c @@ -47,7 +47,7 @@ ULONG ulMacroReturnValue; /* * Context push and pop */ -void +void pushcontext(void) { struct sContext **ppFileStack; @@ -84,7 +84,7 @@ pushcontext(void) fatalerror("No memory for context"); } -int +int popcontext(void) { struct sContext *pLastFile, **ppLastFile; @@ -148,7 +148,7 @@ popcontext(void) return (1); } -int +int yywrap(void) { return (popcontext()); @@ -157,7 +157,7 @@ yywrap(void) /* * Dump the context stack to stderr */ -void +void fstk_Dump(void) { struct sContext *pLastFile; @@ -176,7 +176,7 @@ fstk_Dump(void) /* * Extra includepath stuff */ -void +void fstk_AddIncludePath(char *s) { if (NextIncPath == MAXINCPATHS) { @@ -202,7 +202,7 @@ fstk_FindFile(char *fname) } for (i = 0; i < NextIncPath; ++i) { - if (strlcpy(path, IncludePaths[i], sizeof path) >= + if (strlcpy(path, IncludePaths[i], sizeof path) >= sizeof path) { continue; } @@ -251,7 +251,7 @@ fstk_RunInclude(char *tzFileName) /* * Set up a macro for parsing */ -ULONG +ULONG fstk_RunMacro(char *s) { struct sSymbol *sym; @@ -278,7 +278,7 @@ fstk_RunMacro(char *s) /* * Set up a macroargument for parsing */ -void +void fstk_RunMacroArg(SLONG s) { char *sym; @@ -301,7 +301,7 @@ fstk_RunMacroArg(SLONG s) /* * Set up a stringequate for parsing */ -void +void fstk_RunString(char *s) { struct sSymbol *pSym; @@ -320,7 +320,7 @@ fstk_RunString(char *s) /* * Set up a repeat block for parsing */ -void +void fstk_RunRept(ULONG count) { if (count) { diff --git a/src/asm/globlex.c b/src/asm/globlex.c index 676ec4e5..a61943bc 100644 --- a/src/asm/globlex.c +++ b/src/asm/globlex.c @@ -17,7 +17,7 @@ bool oDontExpandStrings = false; SLONG nGBGfxID = -1; SLONG nBinaryID = -1; -SLONG +SLONG gbgfx2bin(char ch) { SLONG i; @@ -31,7 +31,7 @@ gbgfx2bin(char ch) return (0); } -SLONG +SLONG binary2bin(char ch) { SLONG i; @@ -45,7 +45,7 @@ binary2bin(char ch) return (0); } -SLONG +SLONG char2bin(char ch) { if (ch >= 'a' && ch <= 'f') @@ -62,7 +62,7 @@ char2bin(char ch) typedef SLONG(*x2bin) (char ch); -SLONG +SLONG ascii2bin(char *s) { SLONG radix = 10; @@ -107,7 +107,7 @@ ascii2bin(char *s) return (result); } -ULONG +ULONG ParseFixedPoint(char *s, ULONG size) { //char dest[256]; @@ -133,7 +133,7 @@ ParseFixedPoint(char *s, ULONG size) return (1); } -ULONG +ULONG ParseNumber(char *s, ULONG size) { char dest[256]; @@ -145,7 +145,7 @@ ParseNumber(char *s, ULONG size) return (1); } -ULONG +ULONG ParseSymbol(char *src, ULONG size) { char dest[MAXSYMLEN + 1]; @@ -203,7 +203,7 @@ ParseSymbol(char *src, ULONG size) } } -ULONG +ULONG PutMacroArg(char *src, ULONG size) { char *s; @@ -221,7 +221,7 @@ PutMacroArg(char *src, ULONG size) return (0); } -ULONG +ULONG PutUniqueArg(char *src, ULONG size) { char *s; @@ -390,7 +390,7 @@ struct sLexFloat tMacroUniqueToken = { T_LEX_MACROUNIQUE }; -void +void setuplex(void) { ULONG id; diff --git a/src/asm/lexer.c b/src/asm/lexer.c index b4e9f43a..168face7 100644 --- a/src/asm/lexer.c +++ b/src/asm/lexer.c @@ -39,7 +39,7 @@ ULONG tFloatingChars[256]; ULONG nFloating; enum eLexerState lexerstate = LEX_STATE_NORMAL; -void +void upperstring(char *s) { while (*s) { @@ -48,7 +48,7 @@ upperstring(char *s) } } -void +void lowerstring(char *s) { while (*s) { @@ -57,19 +57,19 @@ lowerstring(char *s) } } -void +void yyskipbytes(ULONG count) { pLexBuffer += count; } -void +void yyunputbytes(ULONG count) { pLexBuffer -= count; } -void +void yyunput(char c) { if (pLexBuffer <= pLexBufferRealStart) @@ -78,7 +78,7 @@ yyunput(char c) *(--pLexBuffer) = c; } -void +void yyunputstr(char *s) { int i, len; @@ -92,26 +92,26 @@ yyunputstr(char *s) *(--pLexBuffer) = s[i]; } -void +void yy_switch_to_buffer(YY_BUFFER_STATE buf) { pCurrentBuffer = buf; } -void +void yy_set_state(enum eLexerState i) { lexerstate = i; } -void +void yy_delete_buffer(YY_BUFFER_STATE buf) { free(buf->pBufferStart - SAFETYMARGIN); free(buf); } -YY_BUFFER_STATE +YY_BUFFER_STATE yy_scan_bytes(char *mem, ULONG size) { YY_BUFFER_STATE pBuffer; @@ -132,7 +132,7 @@ yy_scan_bytes(char *mem, ULONG size) return (NULL); } -YY_BUFFER_STATE +YY_BUFFER_STATE yy_create_buffer(FILE * f) { YY_BUFFER_STATE pBuffer; @@ -219,7 +219,7 @@ lex_CheckCharacterRange(UWORD start, UWORD end) } } -void +void lex_FloatDeleteRange(ULONG id, UWORD start, UWORD end) { lex_CheckCharacterRange(start, end); @@ -230,7 +230,7 @@ lex_FloatDeleteRange(ULONG id, UWORD start, UWORD end) } } -void +void lex_FloatAddRange(ULONG id, UWORD start, UWORD end) { lex_CheckCharacterRange(start, end); @@ -241,7 +241,7 @@ lex_FloatAddRange(ULONG id, UWORD start, UWORD end) } } -void +void lex_FloatDeleteFirstRange(ULONG id, UWORD start, UWORD end) { lex_CheckCharacterRange(start, end); @@ -252,7 +252,7 @@ lex_FloatDeleteFirstRange(ULONG id, UWORD start, UWORD end) } } -void +void lex_FloatAddFirstRange(ULONG id, UWORD start, UWORD end) { lex_CheckCharacterRange(start, end); @@ -263,7 +263,7 @@ lex_FloatAddFirstRange(ULONG id, UWORD start, UWORD end) } } -void +void lex_FloatDeleteSecondRange(ULONG id, UWORD start, UWORD end) { lex_CheckCharacterRange(start, end); @@ -274,7 +274,7 @@ lex_FloatDeleteSecondRange(ULONG id, UWORD start, UWORD end) } } -void +void lex_FloatAddSecondRange(ULONG id, UWORD start, UWORD end) { lex_CheckCharacterRange(start, end); @@ -302,7 +302,7 @@ lexgetfloat(ULONG nFloatMask) return (&tLexFloat[i]); } -ULONG +ULONG lexcalchash(char *s) { ULONG hash = 0; @@ -314,7 +314,7 @@ lexcalchash(char *s) return (hash % LEXHASHSIZE); } -void +void lex_Init(void) { ULONG i; @@ -333,7 +333,7 @@ lex_Init(void) nFloating = 0; } -void +void lex_AddStrings(struct sLexInitString * lex) { while (lex->tzName) { @@ -757,7 +757,7 @@ yylex_MACROARGS() return 0; } -ULONG +ULONG yylex(void) { switch (lexerstate) { diff --git a/src/asm/main.c b/src/asm/main.c index ff9077c2..34e0c75d 100644 --- a/src/asm/main.c +++ b/src/asm/main.c @@ -42,7 +42,7 @@ struct sOptionStackEntry { struct sOptionStackEntry *pOptionStack = NULL; -void +void opt_SetCurrentOptions(struct sOptions * pOpt) { if (nGBGfxID != -1) { @@ -105,7 +105,7 @@ opt_SetCurrentOptions(struct sOptions * pOpt) } } -void +void opt_Parse(char *s) { struct sOptions newopt; @@ -154,7 +154,7 @@ opt_Parse(char *s) opt_SetCurrentOptions(&newopt); } -void +void opt_Push(void) { struct sOptionStackEntry *pOpt; @@ -167,7 +167,7 @@ opt_Push(void) fatalerror("No memory for option stack"); } -void +void opt_Pop(void) { if (pOptionStack) { @@ -234,7 +234,7 @@ verror(const char *fmt, va_list args) nErrors += 1; } -void +void yyerror(const char *fmt, ...) { va_list args; @@ -243,7 +243,7 @@ yyerror(const char *fmt, ...) va_end(args); } -void +void fatalerror(const char *fmt, ...) { va_list args; @@ -268,7 +268,7 @@ warning(const char *fmt, ...) va_end(args); } -static void +static void usage(void) { printf( @@ -277,7 +277,7 @@ usage(void) exit(1); } -int +int main(int argc, char *argv[]) { int ch; diff --git a/src/asm/math.c b/src/asm/math.c index 5649e628..23410bdd 100644 --- a/src/asm/math.c +++ b/src/asm/math.c @@ -18,7 +18,7 @@ /* * Define the _PI symbol */ -void +void math_DefinePI(void) { sym_AddEqu("_PI", double2fix(PI)); @@ -27,7 +27,7 @@ math_DefinePI(void) /* * Print a fixed point value */ -void +void math_Print(SLONG i) { if (i >= 0) @@ -41,7 +41,7 @@ math_Print(SLONG i) /* * Calculate sine */ -SLONG +SLONG math_Sin(SLONG i) { return (double2fix(sin(fix2double(i) * 2 * PI / 65536))); @@ -50,7 +50,7 @@ math_Sin(SLONG i) /* * Calculate cosine */ -SLONG +SLONG math_Cos(SLONG i) { return (double2fix(cos(fix2double(i) * 2 * PI / 65536))); @@ -59,7 +59,7 @@ math_Cos(SLONG i) /* * Calculate tangent */ -SLONG +SLONG math_Tan(SLONG i) { return (double2fix(tan(fix2double(i) * 2 * PI / 65536))); @@ -68,7 +68,7 @@ math_Tan(SLONG i) /* * Calculate arcsine */ -SLONG +SLONG math_ASin(SLONG i) { return (double2fix(asin(fix2double(i)) / 2 / PI * 65536)); @@ -77,7 +77,7 @@ math_ASin(SLONG i) /* * Calculate arccosine */ -SLONG +SLONG math_ACos(SLONG i) { return (double2fix(acos(fix2double(i)) / 2 / PI * 65536)); @@ -86,7 +86,7 @@ math_ACos(SLONG i) /* * Calculate arctangent */ -SLONG +SLONG math_ATan(SLONG i) { return (double2fix(atan(fix2double(i)) / 2 / PI * 65536)); @@ -95,7 +95,7 @@ math_ATan(SLONG i) /* * Calculate atan2 */ -SLONG +SLONG math_ATan2(SLONG i, SLONG j) { return (double2fix @@ -105,7 +105,7 @@ math_ATan2(SLONG i, SLONG j) /* * Multiplication */ -SLONG +SLONG math_Mul(SLONG i, SLONG j) { return (double2fix(fix2double(i) * fix2double(j))); @@ -114,7 +114,7 @@ math_Mul(SLONG i, SLONG j) /* * Division */ -SLONG +SLONG math_Div(SLONG i, SLONG j) { return (double2fix(fix2double(i) / fix2double(j))); @@ -123,7 +123,7 @@ math_Div(SLONG i, SLONG j) /* * Round */ -SLONG +SLONG math_Round(SLONG i) { return double2fix(round(fix2double(i))); @@ -132,7 +132,7 @@ math_Round(SLONG i) /* * Ceil */ -SLONG +SLONG math_Ceil(SLONG i) { return double2fix(ceil(fix2double(i))); @@ -141,7 +141,7 @@ math_Ceil(SLONG i) /* * Floor */ -SLONG +SLONG math_Floor(SLONG i) { return double2fix(floor(fix2double(i))); diff --git a/src/asm/output.c b/src/asm/output.c index 58b6697b..46668696 100644 --- a/src/asm/output.c +++ b/src/asm/output.c @@ -53,7 +53,7 @@ struct SectionStackEntry *pSectionStack = NULL; /* * Section stack routines */ -void +void out_PushSection(void) { struct SectionStackEntry *pSect; @@ -66,7 +66,7 @@ out_PushSection(void) fatalerror("No memory for section stack"); } -void +void out_PopSection(void) { if (pSectionStack) { @@ -83,7 +83,7 @@ out_PopSection(void) /* * Count the number of symbols used in this object */ -ULONG +ULONG countsymbols(void) { struct PatchSymbol *pSym; @@ -102,7 +102,7 @@ countsymbols(void) /* * Count the number of sections used in this object */ -ULONG +ULONG countsections(void) { struct Section *pSect; @@ -121,7 +121,7 @@ countsections(void) /* * Count the number of patches used in this object */ -ULONG +ULONG countpatches(struct Section * pSect) { struct Patch *pPatch; @@ -139,7 +139,7 @@ countpatches(struct Section * pSect) /* * Write a long to a file (little-endian) */ -void +void fputlong(ULONG i, FILE * f) { fputc(i, f); @@ -151,7 +151,7 @@ fputlong(ULONG i, FILE * f) /* * Write a NULL-terminated string to a file */ -void +void fputstring(char *s, FILE * f) { while (*s) @@ -162,7 +162,7 @@ fputstring(char *s, FILE * f) /* * Return a section's ID */ -ULONG +ULONG getsectid(struct Section * pSect) { struct Section *sec; @@ -184,7 +184,7 @@ getsectid(struct Section * pSect) /* * Write a patch to a file */ -void +void writepatch(struct Patch * pPatch, FILE * f) { fputstring(pPatch->tzFilename, f); @@ -198,7 +198,7 @@ writepatch(struct Patch * pPatch, FILE * f) /* * Write a section to a file */ -void +void writesection(struct Section * pSect, FILE * f) { fputstring(pSect->pzName, f); // RGB3 addition @@ -209,7 +209,7 @@ writesection(struct Section * pSect, FILE * f) fputlong(pSect->nBank, f); //RGB1 addition - + fputlong(pSect->nAlign, f); // RGB3 addition if ((pSect->nType == SECT_ROM0) @@ -230,7 +230,7 @@ writesection(struct Section * pSect, FILE * f) /* * Write a symbol to a file */ -void +void writesymbol(struct sSymbol * pSym, FILE * f) { char symname[MAXSYMLEN * 2 + 1]; @@ -250,7 +250,7 @@ writesymbol(struct sSymbol * pSym, FILE * f) strcat(symname, pSym->tzName); } else strcpy(symname, pSym->tzName); - + if (pSym->nType & SYMF_EXPORT) { /* Symbol should be exported */ type = SYM_EXPORT; @@ -279,13 +279,12 @@ writesymbol(struct sSymbol * pSym, FILE * f) /* * Add a symbol to the object */ -ULONG +ULONG addsymbol(struct sSymbol * pSym) { struct PatchSymbol *pPSym, **ppPSym; static ULONG nextID = 0; ULONG hash; - hash = calchash(pSym->tzName); ppPSym = &(tHashedPatchSymbols[hash]); @@ -313,7 +312,7 @@ addsymbol(struct sSymbol * pSym) /* * Add all exported symbols to the object */ -void +void addexports(void) { int i; @@ -353,7 +352,7 @@ allocpatch(void) /* * Create a new patch (includes the rpn expr) */ -void +void createpatch(ULONG type, struct Expression * expr) { struct Patch *pPatch; @@ -429,7 +428,7 @@ createpatch(ULONG type, struct Expression * expr) /* * A quick check to see if we have an initialized section */ -void +void checksection(void) { if (pCurrentSection) @@ -442,7 +441,7 @@ checksection(void) * A quick check to see if we have an initialized section that can contain * this much initialized data */ -void +void checkcodesection(SLONG size) { checksection(); @@ -480,7 +479,7 @@ checkcodesection(SLONG size) /* * Write an objectfile */ -void +void out_WriteObject(void) { FILE *f; @@ -514,7 +513,7 @@ out_WriteObject(void) /* * Prepare for pass #2 */ -void +void out_PrepPass2(void) { struct Section *pSect; @@ -531,7 +530,7 @@ out_PrepPass2(void) /* * Set the objectfilename */ -void +void out_SetFileName(char *s) { tzObjectname = s; @@ -597,7 +596,7 @@ out_FindSection(char *pzName, ULONG secttype, SLONG org, SLONG bank, SLONG align /* * Set the current section */ -void +void out_SetCurrentSection(struct Section * pSect) { pCurrentSection = pSect; @@ -610,7 +609,7 @@ out_SetCurrentSection(struct Section * pSect) /* * Set the current section by name and type */ -void +void out_NewSection(char *pzName, ULONG secttype) { out_SetCurrentSection(out_FindSection(pzName, secttype, -1, -1, 1)); @@ -619,7 +618,7 @@ out_NewSection(char *pzName, ULONG secttype) /* * Set the current section by name and type */ -void +void out_NewAbsSection(char *pzName, ULONG secttype, SLONG org, SLONG bank) { out_SetCurrentSection(out_FindSection(pzName, secttype, org, bank, 1)); @@ -628,7 +627,7 @@ out_NewAbsSection(char *pzName, ULONG secttype, SLONG org, SLONG bank) /* * Set the current section by name and type, using a given byte alignment */ -void +void out_NewAlignedSection(char *pzName, ULONG secttype, SLONG alignment, SLONG bank) { if (alignment < 0 || alignment > 16) { @@ -640,7 +639,7 @@ out_NewAlignedSection(char *pzName, ULONG secttype, SLONG alignment, SLONG bank) /* * Output an absolute byte */ -void +void out_AbsByte(int b) { checkcodesection(1); @@ -653,7 +652,7 @@ out_AbsByte(int b) pPCSymbol->nValue += 1; } -void +void out_AbsByteGroup(char *s, int length) { checkcodesection(length); @@ -664,7 +663,7 @@ out_AbsByteGroup(char *s, int length) /* * Skip this many bytes */ -void +void out_Skip(int skip) { checksection(); @@ -683,7 +682,7 @@ out_Skip(int skip) /* * Output a NULL terminated string (excluding the NULL-character) */ -void +void out_String(char *s) { checkcodesection(strlen(s)); @@ -696,7 +695,7 @@ out_String(char *s) * is an absolute value in disguise. */ -void +void out_RelByte(struct Expression * expr) { checkcodesection(1); @@ -717,7 +716,7 @@ out_RelByte(struct Expression * expr) /* * Output an absolute word */ -void +void out_AbsWord(int b) { checkcodesection(2); @@ -735,7 +734,7 @@ out_AbsWord(int b) * Output a relocatable word. Checking will be done to see if * it's an absolute value in disguise. */ -void +void out_RelWord(struct Expression * expr) { ULONG b; @@ -759,7 +758,7 @@ out_RelWord(struct Expression * expr) /* * Output an absolute longword */ -void +void out_AbsLong(SLONG b) { checkcodesection(sizeof(SLONG)); @@ -778,7 +777,7 @@ out_AbsLong(SLONG b) * Output a relocatable longword. Checking will be done to see if * is an absolute value in disguise. */ -void +void out_RelLong(struct Expression * expr) { SLONG b; @@ -804,7 +803,7 @@ out_RelLong(struct Expression * expr) /* * Output a PC-relative byte */ -void +void out_PCRelByte(struct Expression * expr) { SLONG b = expr->nVal; @@ -821,7 +820,7 @@ out_PCRelByte(struct Expression * expr) /* * Output a binary file */ -void +void out_BinaryFile(char *s) { FILE *f; @@ -852,7 +851,7 @@ out_BinaryFile(char *s) fclose(f); } -void +void out_BinaryFileSlice(char *s, SLONG start_pos, SLONG length) { FILE *f; diff --git a/src/asm/rpn.c b/src/asm/rpn.c index fcbba7f8..6487faf9 100644 --- a/src/asm/rpn.c +++ b/src/asm/rpn.c @@ -12,7 +12,7 @@ #include "asm/main.h" #include "asm/rpn.h" -void +void mergetwoexpressions(struct Expression * expr, struct Expression * src1, struct Expression * src2) { @@ -28,7 +28,7 @@ mergetwoexpressions(struct Expression * expr, struct Expression * src1, /* * Add a byte to the RPN expression */ -void +void pushbyte(struct Expression * expr, int b) { expr->tRPN[expr->nRPNLength++] = b & 0xFF; @@ -37,7 +37,7 @@ pushbyte(struct Expression * expr, int b) /* * Reset the RPN module */ -void +void rpn_Reset(struct Expression * expr) { expr->nRPNLength = expr->nRPNOut = expr->isReloc = expr->isPCRel = 0; @@ -46,7 +46,7 @@ rpn_Reset(struct Expression * expr) /* * Returns the next rpn byte in expression */ -UWORD +UWORD rpn_PopByte(struct Expression * expr) { if (expr->nRPNOut == expr->nRPNLength) { @@ -58,7 +58,7 @@ rpn_PopByte(struct Expression * expr) /* * Determine if the current expression is relocatable */ -ULONG +ULONG rpn_isReloc(struct Expression * expr) { return (expr->isReloc); @@ -67,7 +67,7 @@ rpn_isReloc(struct Expression * expr) /* * Determine if the current expression can be pc-relative */ -ULONG +ULONG rpn_isPCRelative(struct Expression * expr) { return (expr->isPCRel); @@ -76,7 +76,7 @@ rpn_isPCRelative(struct Expression * expr) /* * Add symbols, constants and operators to expression */ -void +void rpn_Number(struct Expression * expr, ULONG i) { rpn_Reset(expr); @@ -88,7 +88,7 @@ rpn_Number(struct Expression * expr, ULONG i) expr->nVal = i; } -void +void rpn_Symbol(struct Expression * expr, char *tzSym) { if (!sym_isConstant(tzSym)) { @@ -110,7 +110,7 @@ rpn_Symbol(struct Expression * expr, char *tzSym) rpn_Number(expr, sym_GetConstantValue(tzSym)); } -void +void rpn_Bank(struct Expression * expr, char *tzSym) { if (!sym_isConstant(tzSym)) { @@ -128,7 +128,7 @@ rpn_Bank(struct Expression * expr, char *tzSym) yyerror("BANK argument must be a relocatable identifier"); } -int +int rpn_RangeCheck(struct Expression * expr, struct Expression * src, SLONG low, SLONG high) { @@ -150,21 +150,21 @@ rpn_RangeCheck(struct Expression * expr, struct Expression * src, SLONG low, } } -void +void rpn_CheckHRAM(struct Expression * expr, struct Expression * src) { *expr = *src; pushbyte(expr, RPN_HRAM); } -void +void rpn_LOGNOT(struct Expression * expr, struct Expression * src) { *expr = *src; pushbyte(expr, RPN_LOGUNNOT); } -void +void rpn_LOGOR(struct Expression * expr, struct Expression * src1, struct Expression * src2) { @@ -173,7 +173,7 @@ rpn_LOGOR(struct Expression * expr, struct Expression * src1, pushbyte(expr, RPN_LOGOR); } -void +void rpn_LOGAND(struct Expression * expr, struct Expression * src1, struct Expression * src2) { @@ -182,7 +182,7 @@ rpn_LOGAND(struct Expression * expr, struct Expression * src1, pushbyte(expr, RPN_LOGAND); } -void +void rpn_LOGEQU(struct Expression * expr, struct Expression * src1, struct Expression * src2) { @@ -191,7 +191,7 @@ rpn_LOGEQU(struct Expression * expr, struct Expression * src1, pushbyte(expr, RPN_LOGEQ); } -void +void rpn_LOGGT(struct Expression * expr, struct Expression * src1, struct Expression * src2) { @@ -200,7 +200,7 @@ rpn_LOGGT(struct Expression * expr, struct Expression * src1, pushbyte(expr, RPN_LOGGT); } -void +void rpn_LOGLT(struct Expression * expr, struct Expression * src1, struct Expression * src2) { @@ -209,7 +209,7 @@ rpn_LOGLT(struct Expression * expr, struct Expression * src1, pushbyte(expr, RPN_LOGLT); } -void +void rpn_LOGGE(struct Expression * expr, struct Expression * src1, struct Expression * src2) { @@ -218,7 +218,7 @@ rpn_LOGGE(struct Expression * expr, struct Expression * src1, pushbyte(expr, RPN_LOGGE); } -void +void rpn_LOGLE(struct Expression * expr, struct Expression * src1, struct Expression * src2) { @@ -227,7 +227,7 @@ rpn_LOGLE(struct Expression * expr, struct Expression * src1, pushbyte(expr, RPN_LOGLE); } -void +void rpn_LOGNE(struct Expression * expr, struct Expression * src1, struct Expression * src2) { @@ -236,7 +236,7 @@ rpn_LOGNE(struct Expression * expr, struct Expression * src1, pushbyte(expr, RPN_LOGNE); } -void +void rpn_ADD(struct Expression * expr, struct Expression * src1, struct Expression * src2) { @@ -245,7 +245,7 @@ rpn_ADD(struct Expression * expr, struct Expression * src1, pushbyte(expr, RPN_ADD); } -void +void rpn_SUB(struct Expression * expr, struct Expression * src1, struct Expression * src2) { @@ -254,7 +254,7 @@ rpn_SUB(struct Expression * expr, struct Expression * src1, pushbyte(expr, RPN_SUB); } -void +void rpn_XOR(struct Expression * expr, struct Expression * src1, struct Expression * src2) { @@ -263,7 +263,7 @@ rpn_XOR(struct Expression * expr, struct Expression * src1, pushbyte(expr, RPN_XOR); } -void +void rpn_OR(struct Expression * expr, struct Expression * src1, struct Expression * src2) { @@ -272,7 +272,7 @@ rpn_OR(struct Expression * expr, struct Expression * src1, pushbyte(expr, RPN_OR); } -void +void rpn_AND(struct Expression * expr, struct Expression * src1, struct Expression * src2) { @@ -281,7 +281,7 @@ rpn_AND(struct Expression * expr, struct Expression * src1, pushbyte(expr, RPN_AND); } -void +void rpn_SHL(struct Expression * expr, struct Expression * src1, struct Expression * src2) { @@ -290,7 +290,7 @@ rpn_SHL(struct Expression * expr, struct Expression * src1, pushbyte(expr, RPN_SHL); } -void +void rpn_SHR(struct Expression * expr, struct Expression * src1, struct Expression * src2) { @@ -299,7 +299,7 @@ rpn_SHR(struct Expression * expr, struct Expression * src1, pushbyte(expr, RPN_SHR); } -void +void rpn_MUL(struct Expression * expr, struct Expression * src1, struct Expression * src2) { @@ -308,7 +308,7 @@ rpn_MUL(struct Expression * expr, struct Expression * src1, pushbyte(expr, RPN_MUL); } -void +void rpn_DIV(struct Expression * expr, struct Expression * src1, struct Expression * src2) { @@ -320,7 +320,7 @@ rpn_DIV(struct Expression * expr, struct Expression * src1, pushbyte(expr, RPN_DIV); } -void +void rpn_MOD(struct Expression * expr, struct Expression * src1, struct Expression * src2) { @@ -332,7 +332,7 @@ rpn_MOD(struct Expression * expr, struct Expression * src1, pushbyte(expr, RPN_MOD); } -void +void rpn_UNNEG(struct Expression * expr, struct Expression * src) { *expr = *src; @@ -340,7 +340,7 @@ rpn_UNNEG(struct Expression * expr, struct Expression * src) pushbyte(expr, RPN_UNSUB); } -void +void rpn_UNNOT(struct Expression * expr, struct Expression * src) { *expr = *src; diff --git a/src/asm/symbol.c b/src/asm/symbol.c index 21204b75..01251b3a 100644 --- a/src/asm/symbol.c +++ b/src/asm/symbol.c @@ -23,7 +23,7 @@ char SavedTIME[256]; char SavedDATE[256]; bool exportall; -SLONG +SLONG Callback_NARG(struct sSymbol * sym) { ULONG i = 0; @@ -37,7 +37,7 @@ Callback_NARG(struct sSymbol * sym) /* * Get the nValue field of a symbol */ -SLONG +SLONG getvaluefield(struct sSymbol * sym) { if (sym->Callback) { @@ -49,7 +49,7 @@ getvaluefield(struct sSymbol * sym) /* * Calculate the hash value for a string */ -ULONG +ULONG calchash(char *s) { ULONG hash = 5381; @@ -153,7 +153,7 @@ sym_FindSymbol(char *tzName) /* * Purge a symbol */ -void +void sym_Purge(char *tzName) { struct sSymbol **ppSym; @@ -184,7 +184,7 @@ sym_Purge(char *tzName) /* * Determine if a symbol has been defined */ -ULONG +ULONG sym_isConstDefined(char *tzName) { struct sSymbol *psym, *pscope; @@ -208,7 +208,7 @@ sym_isConstDefined(char *tzName) return (0); } -ULONG +ULONG sym_isDefined(char *tzName) { struct sSymbol *psym, *pscope; @@ -229,7 +229,7 @@ sym_isDefined(char *tzName) /* * Determine if the symbol is a constant */ -ULONG +ULONG sym_isConstant(char *s) { struct sSymbol *psym, *pscope; @@ -266,7 +266,7 @@ sym_GetStringValue(char *tzSym) /* * Return a constant symbols value */ -ULONG +ULONG sym_GetConstantValue(char *s) { struct sSymbol *psym, *pscope; @@ -292,7 +292,7 @@ sym_GetConstantValue(char *s) /* * Return a symbols value... "estimated" if not defined yet */ -ULONG +ULONG sym_GetValue(char *s) { struct sSymbol *psym, *pscope; @@ -331,7 +331,7 @@ sym_GetValue(char *s) /* * Return a defined symbols value... aborts if not defined yet */ -ULONG +ULONG sym_GetDefinedValue(char *s) { struct sSymbol *psym, *pscope; @@ -360,7 +360,7 @@ sym_GetDefinedValue(char *s) /* * Macro argument stuff */ -void +void sym_ShiftCurrentMacroArgs(void) { SLONG i; @@ -384,7 +384,7 @@ sym_FindMacroArg(SLONG i) return (currentmacroargs[i - 1]); } -void +void sym_UseNewMacroArgs(void) { SLONG i; @@ -395,7 +395,7 @@ sym_UseNewMacroArgs(void) } } -void +void sym_SaveCurrentMacroArgs(char *save[]) { SLONG i; @@ -404,7 +404,7 @@ sym_SaveCurrentMacroArgs(char *save[]) save[i] = currentmacroargs[i]; } -void +void sym_RestoreCurrentMacroArgs(char *save[]) { SLONG i; @@ -413,7 +413,7 @@ sym_RestoreCurrentMacroArgs(char *save[]) currentmacroargs[i] = save[i]; } -void +void sym_FreeCurrentMacroArgs(void) { SLONG i; @@ -424,7 +424,7 @@ sym_FreeCurrentMacroArgs(void) } } -void +void sym_AddNewMacroArg(char *s) { SLONG i = 0; @@ -441,7 +441,7 @@ sym_AddNewMacroArg(char *s) yyerror("A maximum of %d arguments allowed", MAXMACROARGS); } -void +void sym_SetMacroArgID(ULONG nMacroCount) { char s[256]; @@ -450,7 +450,7 @@ sym_SetMacroArgID(ULONG nMacroCount) newmacroargs[MAXMACROARGS] = strdup(s); } -void +void sym_UseCurrentMacroArgs(void) { SLONG i; @@ -471,7 +471,7 @@ sym_FindMacro(char *s) /* * Add an equated symbol */ -void +void sym_AddEqu(char *tzSym, SLONG value) { if ((nPass == 1) @@ -497,7 +497,7 @@ sym_AddEqu(char *tzSym, SLONG value) /* * Add a string equated symbol */ -void +void sym_AddString(char *tzSym, char *tzValue) { struct sSymbol *nsym; @@ -523,7 +523,7 @@ sym_AddString(char *tzSym, char *tzValue) /* * check if symbol is a string equated symbol */ -ULONG +ULONG sym_isString(char *tzSym) { struct sSymbol *pSym; @@ -538,7 +538,7 @@ sym_isString(char *tzSym) /* * Alter a SET symbols value */ -void +void sym_AddSet(char *tzSym, SLONG value) { struct sSymbol *nsym; @@ -557,7 +557,7 @@ sym_AddSet(char *tzSym, SLONG value) /* * Add a local (.name) relocatable symbol */ -void +void sym_AddLocalReloc(char *tzSym) { if ((nPass == 1) @@ -591,7 +591,7 @@ sym_AddLocalReloc(char *tzSym) /* * Add a relocatable symbol */ -void +void sym_AddReloc(char *tzSym) { if ((nPass == 1) @@ -622,7 +622,7 @@ sym_AddReloc(char *tzSym) /* * Export a symbol */ -void +void sym_Export(char *tzSym) { if (nPass == 1) { @@ -649,7 +649,7 @@ sym_Export(char *tzSym) /* * Import a symbol */ -void +void sym_Import(char *tzSym) { if (nPass == 1) { @@ -667,7 +667,7 @@ sym_Import(char *tzSym) /* * Globalize a symbol (export if defined, import if not) */ -void +void sym_Global(char *tzSym) { if (nPass == 2) { @@ -692,7 +692,7 @@ sym_Global(char *tzSym) /* * Add a macro definition */ -void +void sym_AddMacro(char *tzSym) { if ((nPass == 1) @@ -717,7 +717,7 @@ sym_AddMacro(char *tzSym) } } -/* +/* * Set whether to export all relocable symbols by default */ void sym_SetExportAll(BBOOL set) { @@ -727,7 +727,7 @@ void sym_SetExportAll(BBOOL set) { /* * Prepare for pass #1 */ -void +void sym_PrepPass1(void) { sym_Init(); @@ -736,7 +736,7 @@ sym_PrepPass1(void) /* * Prepare for pass #2 */ -void +void sym_PrepPass2(void) { SLONG i; @@ -773,7 +773,7 @@ sym_PrepPass2(void) /* * Initialize the symboltable */ -void +void sym_Init(void) { SLONG i; diff --git a/src/link/assign.c b/src/link/assign.c index 3624a52d..3024a80d 100644 --- a/src/link/assign.c +++ b/src/link/assign.c @@ -63,7 +63,7 @@ ensureSectionTypeIsValid(enum eSectionType type) } } -SLONG +SLONG area_Avail(SLONG bank) { SLONG r; @@ -554,7 +554,7 @@ AssignSections(void) } } -void +void CreateSymbolTable(void) { struct sSection *pSect; diff --git a/src/link/library.c b/src/link/library.c index 4c75d4a6..e3ca429e 100644 --- a/src/link/library.c +++ b/src/link/library.c @@ -7,7 +7,7 @@ #include "link/mylink.h" #include "link/main.h" -static BBOOL +static BBOOL symboldefined(char *name) { struct sSection *pSect; @@ -31,7 +31,7 @@ symboldefined(char *name) return (0); } -static BBOOL +static BBOOL addmodulecontaining(char *name) { struct sSection **ppLSect; @@ -66,7 +66,7 @@ addmodulecontaining(char *name) return (0); } -void +void AddNeededModules(void) { struct sSection *pSect; diff --git a/src/link/mapfile.c b/src/link/mapfile.c index f60a1170..0fa99674 100644 --- a/src/link/mapfile.c +++ b/src/link/mapfile.c @@ -13,7 +13,7 @@ FILE *sf = NULL; SLONG currentbank = 0; SLONG sfbank; -void +void SetMapfileName(char *name) { mf = fopen(name, "w"); @@ -23,7 +23,7 @@ SetMapfileName(char *name) } } -void +void SetSymfileName(char *name) { sf = fopen(name, "w"); @@ -35,7 +35,7 @@ SetSymfileName(char *name) fprintf(sf, ";File generated by rgblink\n\n"); } -void +void CloseMapfile(void) { if (mf) { @@ -48,7 +48,7 @@ CloseMapfile(void) } } -void +void MapfileInitBank(SLONG bank) { if (mf) { @@ -90,7 +90,7 @@ MapfileInitBank(SLONG bank) } } -void +void MapfileWriteSection(struct sSection * pSect) { SLONG i; @@ -125,7 +125,7 @@ MapfileWriteSection(struct sSection * pSect) } } -void +void MapfileCloseBank(SLONG slack) { if (!mf) diff --git a/src/link/object.c b/src/link/object.c index 021e5d34..aff815dc 100644 --- a/src/link/object.c +++ b/src/link/object.c @@ -29,7 +29,7 @@ enum ObjectFileContents { * */ -SLONG +SLONG readlong(FILE * f) { SLONG r; @@ -42,7 +42,7 @@ readlong(FILE * f) return (r); } -UWORD +UWORD readword(FILE * f) { UWORD r; @@ -224,7 +224,7 @@ obj_ReadRGB0Section(FILE * f) return pSection; } -void +void obj_ReadRGB0(FILE * pObjfile) { struct sSection *pFirstSection; @@ -375,7 +375,7 @@ obj_ReadRGBSection(FILE * f, enum ObjectFileContents contents) return pSection; } -void +void obj_ReadRGB(FILE * pObjfile, enum ObjectFileContents contents) { struct sSection *pFirstSection; @@ -435,7 +435,7 @@ obj_ReadRGB(FILE * pObjfile, enum ObjectFileContents contents) * */ -void +void obj_ReadOpenFile(FILE * pObjfile, char *tzObjectfile) { char tzHeader[8]; @@ -464,7 +464,7 @@ obj_ReadOpenFile(FILE * pObjfile, char *tzObjectfile) } } -void +void obj_Readfile(char *tzObjectfile) { FILE *pObjfile; @@ -484,7 +484,7 @@ obj_Readfile(char *tzObjectfile) oReadLib = 0; } -SLONG +SLONG file_Length(FILE * f) { ULONG r, p; @@ -497,7 +497,7 @@ file_Length(FILE * f) return (r); } -void +void lib_ReadXLB0(FILE * f) { SLONG size; diff --git a/src/link/output.c b/src/link/output.c index e1fa1207..67243731 100644 --- a/src/link/output.c +++ b/src/link/output.c @@ -12,7 +12,7 @@ char *tzOverlayname = NULL; SLONG MaxOverlayBank; -void +void writehome(FILE * f, FILE * f_overlay) { struct sSection *pSect; @@ -46,7 +46,7 @@ writehome(FILE * f, FILE * f_overlay) free(mem); } -void +void writebank(FILE * f, FILE * f_overlay, SLONG bank) { struct sSection *pSect; @@ -80,20 +80,20 @@ writebank(FILE * f, FILE * f_overlay, SLONG bank) free(mem); } -void +void out_Setname(char *tzOutputfile) { tzOutname = tzOutputfile; } -void +void out_SetOverlayname(char *tzOverlayfile) { tzOverlayname = tzOverlayfile; } -void +void Output(void) { SLONG i; diff --git a/src/link/patch.c b/src/link/patch.c index afdcead7..83d24602 100644 --- a/src/link/patch.c +++ b/src/link/patch.c @@ -13,19 +13,19 @@ SLONG rpnstack[256]; SLONG rpnp; SLONG nPC; -void +void rpnpush(SLONG i) { rpnstack[rpnp++] = i; } -SLONG +SLONG rpnpop(void) { return (rpnstack[--rpnp]); } -SLONG +SLONG getsymvalue(SLONG symid) { switch (pCurrentSection->tSymbols[symid]->Type) { @@ -51,7 +51,7 @@ getsymvalue(SLONG symid) errx(1, "*INTERNAL* UNKNOWN SYMBOL TYPE"); } -SLONG +SLONG getsymbank(SLONG symid) { SLONG nBank; @@ -79,7 +79,7 @@ getsymbank(SLONG symid) return nBank; } -SLONG +SLONG calcrpn(struct sPatch * pPatch) { SLONG t, size; @@ -231,7 +231,7 @@ calcrpn(struct sPatch * pPatch) return (rpnpop()); } -void +void Patch(void) { struct sSection *pSect; diff --git a/src/link/symbol.c b/src/link/symbol.c index 36cbd7d5..b53cbb67 100644 --- a/src/link/symbol.c +++ b/src/link/symbol.c @@ -19,7 +19,7 @@ struct ISymbol { struct ISymbol *tHash[HASHSIZE]; -SLONG +SLONG calchash(char *s) { SLONG r = 0; @@ -29,7 +29,7 @@ calchash(char *s) return (r % HASHSIZE); } -void +void sym_Init(void) { SLONG i; @@ -37,7 +37,7 @@ sym_Init(void) tHash[i] = NULL; } -SLONG +SLONG sym_GetValue(char *tzName) { if (strcmp(tzName, "@") == 0) { @@ -58,7 +58,7 @@ sym_GetValue(char *tzName) } } -SLONG +SLONG sym_GetBank(char *tzName) { struct ISymbol **ppSym; @@ -75,7 +75,7 @@ sym_GetBank(char *tzName) errx(1, "Unknown symbol '%s'", tzName); } -void +void sym_CreateSymbol(char *tzName, SLONG nValue, SLONG nBank) { if (strcmp(tzName, "@") == 0)