Remove trailing whitespace

Signed-off-by: AntonioND <antonio_nd@outlook.com>
This commit is contained in:
AntonioND
2017-04-02 17:46:07 +01:00
parent f63339472e
commit e50e3e5a23
17 changed files with 219 additions and 220 deletions

View File

@@ -15,58 +15,58 @@ ULONG rpn_isPCRelative(struct Expression * expr);
void rpn_Symbol(struct Expression * expr, char *tzSym); void rpn_Symbol(struct Expression * expr, char *tzSym);
void rpn_Number(struct Expression * expr, ULONG i); void rpn_Number(struct Expression * expr, ULONG i);
void rpn_LOGNOT(struct Expression * expr, struct Expression * src1); void rpn_LOGNOT(struct Expression * expr, struct Expression * src1);
void void
rpn_LOGOR(struct Expression * expr, struct Expression * src1, rpn_LOGOR(struct Expression * expr, struct Expression * src1,
struct Expression * src2); struct Expression * src2);
void void
rpn_LOGAND(struct Expression * expr, struct Expression * src1, rpn_LOGAND(struct Expression * expr, struct Expression * src1,
struct Expression * src2); struct Expression * src2);
void void
rpn_LOGEQU(struct Expression * expr, struct Expression * src1, rpn_LOGEQU(struct Expression * expr, struct Expression * src1,
struct Expression * src2); struct Expression * src2);
void void
rpn_LOGGT(struct Expression * expr, struct Expression * src1, rpn_LOGGT(struct Expression * expr, struct Expression * src1,
struct Expression * src2); struct Expression * src2);
void void
rpn_LOGLT(struct Expression * expr, struct Expression * src1, rpn_LOGLT(struct Expression * expr, struct Expression * src1,
struct Expression * src2); struct Expression * src2);
void void
rpn_LOGGE(struct Expression * expr, struct Expression * src1, rpn_LOGGE(struct Expression * expr, struct Expression * src1,
struct Expression * src2); struct Expression * src2);
void void
rpn_LOGLE(struct Expression * expr, struct Expression * src1, rpn_LOGLE(struct Expression * expr, struct Expression * src1,
struct Expression * src2); struct Expression * src2);
void void
rpn_LOGNE(struct Expression * expr, struct Expression * src1, rpn_LOGNE(struct Expression * expr, struct Expression * src1,
struct Expression * src2); struct Expression * src2);
void void
rpn_ADD(struct Expression * expr, struct Expression * src1, rpn_ADD(struct Expression * expr, struct Expression * src1,
struct Expression * src2); struct Expression * src2);
void void
rpn_SUB(struct Expression * expr, struct Expression * src1, rpn_SUB(struct Expression * expr, struct Expression * src1,
struct Expression * src2); struct Expression * src2);
void void
rpn_XOR(struct Expression * expr, struct Expression * src1, rpn_XOR(struct Expression * expr, struct Expression * src1,
struct Expression * src2); struct Expression * src2);
void void
rpn_OR(struct Expression * expr, struct Expression * src1, rpn_OR(struct Expression * expr, struct Expression * src1,
struct Expression * src2); struct Expression * src2);
void void
rpn_AND(struct Expression * expr, struct Expression * src1, rpn_AND(struct Expression * expr, struct Expression * src1,
struct Expression * src2); struct Expression * src2);
void void
rpn_SHL(struct Expression * expr, struct Expression * src1, rpn_SHL(struct Expression * expr, struct Expression * src1,
struct Expression * src2); struct Expression * src2);
void void
rpn_SHR(struct Expression * expr, struct Expression * src1, rpn_SHR(struct Expression * expr, struct Expression * src1,
struct Expression * src2); struct Expression * src2);
void void
rpn_MUL(struct Expression * expr, struct Expression * src1, rpn_MUL(struct Expression * expr, struct Expression * src1,
struct Expression * src2); struct Expression * src2);
void void
rpn_DIV(struct Expression * expr, struct Expression * src1, rpn_DIV(struct Expression * expr, struct Expression * src1,
struct Expression * src2); struct Expression * src2);
void void
rpn_MOD(struct Expression * expr, struct Expression * src1, rpn_MOD(struct Expression * expr, struct Expression * src1,
struct Expression * src2); struct Expression * src2);
void rpn_UNNEG(struct Expression * expr, struct Expression * src); 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); UWORD rpn_PopByte(struct Expression * expr);
void rpn_Bank(struct Expression * expr, char *tzSym); void rpn_Bank(struct Expression * expr, char *tzSym);
void rpn_Reset(struct Expression * expr); void rpn_Reset(struct Expression * expr);
int int
rpn_RangeCheck(struct Expression * expr, struct Expression * src, SLONG low, rpn_RangeCheck(struct Expression * expr, struct Expression * src, SLONG low,
SLONG high); SLONG high);
void rpn_CheckHRAM(struct Expression * expr, struct Expression * src1); void rpn_CheckHRAM(struct Expression * expr, struct Expression * src1);

View File

@@ -12,5 +12,5 @@
#define noreturn _declspec( noreturn) #define noreturn _declspec( noreturn)
#else #else
/* unsupported, but no need to throw a fit */ /* unsupported, but no need to throw a fit */
#define noreturn #define noreturn
#endif #endif

View File

@@ -47,7 +47,7 @@ ULONG ulMacroReturnValue;
/* /*
* Context push and pop * Context push and pop
*/ */
void void
pushcontext(void) pushcontext(void)
{ {
struct sContext **ppFileStack; struct sContext **ppFileStack;
@@ -84,7 +84,7 @@ pushcontext(void)
fatalerror("No memory for context"); fatalerror("No memory for context");
} }
int int
popcontext(void) popcontext(void)
{ {
struct sContext *pLastFile, **ppLastFile; struct sContext *pLastFile, **ppLastFile;
@@ -148,7 +148,7 @@ popcontext(void)
return (1); return (1);
} }
int int
yywrap(void) yywrap(void)
{ {
return (popcontext()); return (popcontext());
@@ -157,7 +157,7 @@ yywrap(void)
/* /*
* Dump the context stack to stderr * Dump the context stack to stderr
*/ */
void void
fstk_Dump(void) fstk_Dump(void)
{ {
struct sContext *pLastFile; struct sContext *pLastFile;
@@ -176,7 +176,7 @@ fstk_Dump(void)
/* /*
* Extra includepath stuff * Extra includepath stuff
*/ */
void void
fstk_AddIncludePath(char *s) fstk_AddIncludePath(char *s)
{ {
if (NextIncPath == MAXINCPATHS) { if (NextIncPath == MAXINCPATHS) {
@@ -202,7 +202,7 @@ fstk_FindFile(char *fname)
} }
for (i = 0; i < NextIncPath; ++i) { for (i = 0; i < NextIncPath; ++i) {
if (strlcpy(path, IncludePaths[i], sizeof path) >= if (strlcpy(path, IncludePaths[i], sizeof path) >=
sizeof path) { sizeof path) {
continue; continue;
} }
@@ -251,7 +251,7 @@ fstk_RunInclude(char *tzFileName)
/* /*
* Set up a macro for parsing * Set up a macro for parsing
*/ */
ULONG ULONG
fstk_RunMacro(char *s) fstk_RunMacro(char *s)
{ {
struct sSymbol *sym; struct sSymbol *sym;
@@ -278,7 +278,7 @@ fstk_RunMacro(char *s)
/* /*
* Set up a macroargument for parsing * Set up a macroargument for parsing
*/ */
void void
fstk_RunMacroArg(SLONG s) fstk_RunMacroArg(SLONG s)
{ {
char *sym; char *sym;
@@ -301,7 +301,7 @@ fstk_RunMacroArg(SLONG s)
/* /*
* Set up a stringequate for parsing * Set up a stringequate for parsing
*/ */
void void
fstk_RunString(char *s) fstk_RunString(char *s)
{ {
struct sSymbol *pSym; struct sSymbol *pSym;
@@ -320,7 +320,7 @@ fstk_RunString(char *s)
/* /*
* Set up a repeat block for parsing * Set up a repeat block for parsing
*/ */
void void
fstk_RunRept(ULONG count) fstk_RunRept(ULONG count)
{ {
if (count) { if (count) {

View File

@@ -17,7 +17,7 @@ bool oDontExpandStrings = false;
SLONG nGBGfxID = -1; SLONG nGBGfxID = -1;
SLONG nBinaryID = -1; SLONG nBinaryID = -1;
SLONG SLONG
gbgfx2bin(char ch) gbgfx2bin(char ch)
{ {
SLONG i; SLONG i;
@@ -31,7 +31,7 @@ gbgfx2bin(char ch)
return (0); return (0);
} }
SLONG SLONG
binary2bin(char ch) binary2bin(char ch)
{ {
SLONG i; SLONG i;
@@ -45,7 +45,7 @@ binary2bin(char ch)
return (0); return (0);
} }
SLONG SLONG
char2bin(char ch) char2bin(char ch)
{ {
if (ch >= 'a' && ch <= 'f') if (ch >= 'a' && ch <= 'f')
@@ -62,7 +62,7 @@ char2bin(char ch)
typedef SLONG(*x2bin) (char ch); typedef SLONG(*x2bin) (char ch);
SLONG SLONG
ascii2bin(char *s) ascii2bin(char *s)
{ {
SLONG radix = 10; SLONG radix = 10;
@@ -107,7 +107,7 @@ ascii2bin(char *s)
return (result); return (result);
} }
ULONG ULONG
ParseFixedPoint(char *s, ULONG size) ParseFixedPoint(char *s, ULONG size)
{ {
//char dest[256]; //char dest[256];
@@ -133,7 +133,7 @@ ParseFixedPoint(char *s, ULONG size)
return (1); return (1);
} }
ULONG ULONG
ParseNumber(char *s, ULONG size) ParseNumber(char *s, ULONG size)
{ {
char dest[256]; char dest[256];
@@ -145,7 +145,7 @@ ParseNumber(char *s, ULONG size)
return (1); return (1);
} }
ULONG ULONG
ParseSymbol(char *src, ULONG size) ParseSymbol(char *src, ULONG size)
{ {
char dest[MAXSYMLEN + 1]; char dest[MAXSYMLEN + 1];
@@ -203,7 +203,7 @@ ParseSymbol(char *src, ULONG size)
} }
} }
ULONG ULONG
PutMacroArg(char *src, ULONG size) PutMacroArg(char *src, ULONG size)
{ {
char *s; char *s;
@@ -221,7 +221,7 @@ PutMacroArg(char *src, ULONG size)
return (0); return (0);
} }
ULONG ULONG
PutUniqueArg(char *src, ULONG size) PutUniqueArg(char *src, ULONG size)
{ {
char *s; char *s;
@@ -390,7 +390,7 @@ struct sLexFloat tMacroUniqueToken = {
T_LEX_MACROUNIQUE T_LEX_MACROUNIQUE
}; };
void void
setuplex(void) setuplex(void)
{ {
ULONG id; ULONG id;

View File

@@ -39,7 +39,7 @@ ULONG tFloatingChars[256];
ULONG nFloating; ULONG nFloating;
enum eLexerState lexerstate = LEX_STATE_NORMAL; enum eLexerState lexerstate = LEX_STATE_NORMAL;
void void
upperstring(char *s) upperstring(char *s)
{ {
while (*s) { while (*s) {
@@ -48,7 +48,7 @@ upperstring(char *s)
} }
} }
void void
lowerstring(char *s) lowerstring(char *s)
{ {
while (*s) { while (*s) {
@@ -57,19 +57,19 @@ lowerstring(char *s)
} }
} }
void void
yyskipbytes(ULONG count) yyskipbytes(ULONG count)
{ {
pLexBuffer += count; pLexBuffer += count;
} }
void void
yyunputbytes(ULONG count) yyunputbytes(ULONG count)
{ {
pLexBuffer -= count; pLexBuffer -= count;
} }
void void
yyunput(char c) yyunput(char c)
{ {
if (pLexBuffer <= pLexBufferRealStart) if (pLexBuffer <= pLexBufferRealStart)
@@ -78,7 +78,7 @@ yyunput(char c)
*(--pLexBuffer) = c; *(--pLexBuffer) = c;
} }
void void
yyunputstr(char *s) yyunputstr(char *s)
{ {
int i, len; int i, len;
@@ -92,26 +92,26 @@ yyunputstr(char *s)
*(--pLexBuffer) = s[i]; *(--pLexBuffer) = s[i];
} }
void void
yy_switch_to_buffer(YY_BUFFER_STATE buf) yy_switch_to_buffer(YY_BUFFER_STATE buf)
{ {
pCurrentBuffer = buf; pCurrentBuffer = buf;
} }
void void
yy_set_state(enum eLexerState i) yy_set_state(enum eLexerState i)
{ {
lexerstate = i; lexerstate = i;
} }
void void
yy_delete_buffer(YY_BUFFER_STATE buf) yy_delete_buffer(YY_BUFFER_STATE buf)
{ {
free(buf->pBufferStart - SAFETYMARGIN); free(buf->pBufferStart - SAFETYMARGIN);
free(buf); free(buf);
} }
YY_BUFFER_STATE YY_BUFFER_STATE
yy_scan_bytes(char *mem, ULONG size) yy_scan_bytes(char *mem, ULONG size)
{ {
YY_BUFFER_STATE pBuffer; YY_BUFFER_STATE pBuffer;
@@ -132,7 +132,7 @@ yy_scan_bytes(char *mem, ULONG size)
return (NULL); return (NULL);
} }
YY_BUFFER_STATE YY_BUFFER_STATE
yy_create_buffer(FILE * f) yy_create_buffer(FILE * f)
{ {
YY_BUFFER_STATE pBuffer; 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_FloatDeleteRange(ULONG id, UWORD start, UWORD end)
{ {
lex_CheckCharacterRange(start, 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_FloatAddRange(ULONG id, UWORD start, UWORD end)
{ {
lex_CheckCharacterRange(start, 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_FloatDeleteFirstRange(ULONG id, UWORD start, UWORD end)
{ {
lex_CheckCharacterRange(start, 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_FloatAddFirstRange(ULONG id, UWORD start, UWORD end)
{ {
lex_CheckCharacterRange(start, 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_FloatDeleteSecondRange(ULONG id, UWORD start, UWORD end)
{ {
lex_CheckCharacterRange(start, 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_FloatAddSecondRange(ULONG id, UWORD start, UWORD end)
{ {
lex_CheckCharacterRange(start, end); lex_CheckCharacterRange(start, end);
@@ -302,7 +302,7 @@ lexgetfloat(ULONG nFloatMask)
return (&tLexFloat[i]); return (&tLexFloat[i]);
} }
ULONG ULONG
lexcalchash(char *s) lexcalchash(char *s)
{ {
ULONG hash = 0; ULONG hash = 0;
@@ -314,7 +314,7 @@ lexcalchash(char *s)
return (hash % LEXHASHSIZE); return (hash % LEXHASHSIZE);
} }
void void
lex_Init(void) lex_Init(void)
{ {
ULONG i; ULONG i;
@@ -333,7 +333,7 @@ lex_Init(void)
nFloating = 0; nFloating = 0;
} }
void void
lex_AddStrings(struct sLexInitString * lex) lex_AddStrings(struct sLexInitString * lex)
{ {
while (lex->tzName) { while (lex->tzName) {
@@ -757,7 +757,7 @@ yylex_MACROARGS()
return 0; return 0;
} }
ULONG ULONG
yylex(void) yylex(void)
{ {
switch (lexerstate) { switch (lexerstate) {

View File

@@ -42,7 +42,7 @@ struct sOptionStackEntry {
struct sOptionStackEntry *pOptionStack = NULL; struct sOptionStackEntry *pOptionStack = NULL;
void void
opt_SetCurrentOptions(struct sOptions * pOpt) opt_SetCurrentOptions(struct sOptions * pOpt)
{ {
if (nGBGfxID != -1) { if (nGBGfxID != -1) {
@@ -105,7 +105,7 @@ opt_SetCurrentOptions(struct sOptions * pOpt)
} }
} }
void void
opt_Parse(char *s) opt_Parse(char *s)
{ {
struct sOptions newopt; struct sOptions newopt;
@@ -154,7 +154,7 @@ opt_Parse(char *s)
opt_SetCurrentOptions(&newopt); opt_SetCurrentOptions(&newopt);
} }
void void
opt_Push(void) opt_Push(void)
{ {
struct sOptionStackEntry *pOpt; struct sOptionStackEntry *pOpt;
@@ -167,7 +167,7 @@ opt_Push(void)
fatalerror("No memory for option stack"); fatalerror("No memory for option stack");
} }
void void
opt_Pop(void) opt_Pop(void)
{ {
if (pOptionStack) { if (pOptionStack) {
@@ -234,7 +234,7 @@ verror(const char *fmt, va_list args)
nErrors += 1; nErrors += 1;
} }
void void
yyerror(const char *fmt, ...) yyerror(const char *fmt, ...)
{ {
va_list args; va_list args;
@@ -243,7 +243,7 @@ yyerror(const char *fmt, ...)
va_end(args); va_end(args);
} }
void void
fatalerror(const char *fmt, ...) fatalerror(const char *fmt, ...)
{ {
va_list args; va_list args;
@@ -268,7 +268,7 @@ warning(const char *fmt, ...)
va_end(args); va_end(args);
} }
static void static void
usage(void) usage(void)
{ {
printf( printf(
@@ -277,7 +277,7 @@ usage(void)
exit(1); exit(1);
} }
int int
main(int argc, char *argv[]) main(int argc, char *argv[])
{ {
int ch; int ch;

View File

@@ -18,7 +18,7 @@
/* /*
* Define the _PI symbol * Define the _PI symbol
*/ */
void void
math_DefinePI(void) math_DefinePI(void)
{ {
sym_AddEqu("_PI", double2fix(PI)); sym_AddEqu("_PI", double2fix(PI));
@@ -27,7 +27,7 @@ math_DefinePI(void)
/* /*
* Print a fixed point value * Print a fixed point value
*/ */
void void
math_Print(SLONG i) math_Print(SLONG i)
{ {
if (i >= 0) if (i >= 0)
@@ -41,7 +41,7 @@ math_Print(SLONG i)
/* /*
* Calculate sine * Calculate sine
*/ */
SLONG SLONG
math_Sin(SLONG i) math_Sin(SLONG i)
{ {
return (double2fix(sin(fix2double(i) * 2 * PI / 65536))); return (double2fix(sin(fix2double(i) * 2 * PI / 65536)));
@@ -50,7 +50,7 @@ math_Sin(SLONG i)
/* /*
* Calculate cosine * Calculate cosine
*/ */
SLONG SLONG
math_Cos(SLONG i) math_Cos(SLONG i)
{ {
return (double2fix(cos(fix2double(i) * 2 * PI / 65536))); return (double2fix(cos(fix2double(i) * 2 * PI / 65536)));
@@ -59,7 +59,7 @@ math_Cos(SLONG i)
/* /*
* Calculate tangent * Calculate tangent
*/ */
SLONG SLONG
math_Tan(SLONG i) math_Tan(SLONG i)
{ {
return (double2fix(tan(fix2double(i) * 2 * PI / 65536))); return (double2fix(tan(fix2double(i) * 2 * PI / 65536)));
@@ -68,7 +68,7 @@ math_Tan(SLONG i)
/* /*
* Calculate arcsine * Calculate arcsine
*/ */
SLONG SLONG
math_ASin(SLONG i) math_ASin(SLONG i)
{ {
return (double2fix(asin(fix2double(i)) / 2 / PI * 65536)); return (double2fix(asin(fix2double(i)) / 2 / PI * 65536));
@@ -77,7 +77,7 @@ math_ASin(SLONG i)
/* /*
* Calculate arccosine * Calculate arccosine
*/ */
SLONG SLONG
math_ACos(SLONG i) math_ACos(SLONG i)
{ {
return (double2fix(acos(fix2double(i)) / 2 / PI * 65536)); return (double2fix(acos(fix2double(i)) / 2 / PI * 65536));
@@ -86,7 +86,7 @@ math_ACos(SLONG i)
/* /*
* Calculate arctangent * Calculate arctangent
*/ */
SLONG SLONG
math_ATan(SLONG i) math_ATan(SLONG i)
{ {
return (double2fix(atan(fix2double(i)) / 2 / PI * 65536)); return (double2fix(atan(fix2double(i)) / 2 / PI * 65536));
@@ -95,7 +95,7 @@ math_ATan(SLONG i)
/* /*
* Calculate atan2 * Calculate atan2
*/ */
SLONG SLONG
math_ATan2(SLONG i, SLONG j) math_ATan2(SLONG i, SLONG j)
{ {
return (double2fix return (double2fix
@@ -105,7 +105,7 @@ math_ATan2(SLONG i, SLONG j)
/* /*
* Multiplication * Multiplication
*/ */
SLONG SLONG
math_Mul(SLONG i, SLONG j) math_Mul(SLONG i, SLONG j)
{ {
return (double2fix(fix2double(i) * fix2double(j))); return (double2fix(fix2double(i) * fix2double(j)));
@@ -114,7 +114,7 @@ math_Mul(SLONG i, SLONG j)
/* /*
* Division * Division
*/ */
SLONG SLONG
math_Div(SLONG i, SLONG j) math_Div(SLONG i, SLONG j)
{ {
return (double2fix(fix2double(i) / fix2double(j))); return (double2fix(fix2double(i) / fix2double(j)));
@@ -123,7 +123,7 @@ math_Div(SLONG i, SLONG j)
/* /*
* Round * Round
*/ */
SLONG SLONG
math_Round(SLONG i) math_Round(SLONG i)
{ {
return double2fix(round(fix2double(i))); return double2fix(round(fix2double(i)));
@@ -132,7 +132,7 @@ math_Round(SLONG i)
/* /*
* Ceil * Ceil
*/ */
SLONG SLONG
math_Ceil(SLONG i) math_Ceil(SLONG i)
{ {
return double2fix(ceil(fix2double(i))); return double2fix(ceil(fix2double(i)));
@@ -141,7 +141,7 @@ math_Ceil(SLONG i)
/* /*
* Floor * Floor
*/ */
SLONG SLONG
math_Floor(SLONG i) math_Floor(SLONG i)
{ {
return double2fix(floor(fix2double(i))); return double2fix(floor(fix2double(i)));

View File

@@ -53,7 +53,7 @@ struct SectionStackEntry *pSectionStack = NULL;
/* /*
* Section stack routines * Section stack routines
*/ */
void void
out_PushSection(void) out_PushSection(void)
{ {
struct SectionStackEntry *pSect; struct SectionStackEntry *pSect;
@@ -66,7 +66,7 @@ out_PushSection(void)
fatalerror("No memory for section stack"); fatalerror("No memory for section stack");
} }
void void
out_PopSection(void) out_PopSection(void)
{ {
if (pSectionStack) { if (pSectionStack) {
@@ -83,7 +83,7 @@ out_PopSection(void)
/* /*
* Count the number of symbols used in this object * Count the number of symbols used in this object
*/ */
ULONG ULONG
countsymbols(void) countsymbols(void)
{ {
struct PatchSymbol *pSym; struct PatchSymbol *pSym;
@@ -102,7 +102,7 @@ countsymbols(void)
/* /*
* Count the number of sections used in this object * Count the number of sections used in this object
*/ */
ULONG ULONG
countsections(void) countsections(void)
{ {
struct Section *pSect; struct Section *pSect;
@@ -121,7 +121,7 @@ countsections(void)
/* /*
* Count the number of patches used in this object * Count the number of patches used in this object
*/ */
ULONG ULONG
countpatches(struct Section * pSect) countpatches(struct Section * pSect)
{ {
struct Patch *pPatch; struct Patch *pPatch;
@@ -139,7 +139,7 @@ countpatches(struct Section * pSect)
/* /*
* Write a long to a file (little-endian) * Write a long to a file (little-endian)
*/ */
void void
fputlong(ULONG i, FILE * f) fputlong(ULONG i, FILE * f)
{ {
fputc(i, f); fputc(i, f);
@@ -151,7 +151,7 @@ fputlong(ULONG i, FILE * f)
/* /*
* Write a NULL-terminated string to a file * Write a NULL-terminated string to a file
*/ */
void void
fputstring(char *s, FILE * f) fputstring(char *s, FILE * f)
{ {
while (*s) while (*s)
@@ -162,7 +162,7 @@ fputstring(char *s, FILE * f)
/* /*
* Return a section's ID * Return a section's ID
*/ */
ULONG ULONG
getsectid(struct Section * pSect) getsectid(struct Section * pSect)
{ {
struct Section *sec; struct Section *sec;
@@ -184,7 +184,7 @@ getsectid(struct Section * pSect)
/* /*
* Write a patch to a file * Write a patch to a file
*/ */
void void
writepatch(struct Patch * pPatch, FILE * f) writepatch(struct Patch * pPatch, FILE * f)
{ {
fputstring(pPatch->tzFilename, f); fputstring(pPatch->tzFilename, f);
@@ -198,7 +198,7 @@ writepatch(struct Patch * pPatch, FILE * f)
/* /*
* Write a section to a file * Write a section to a file
*/ */
void void
writesection(struct Section * pSect, FILE * f) writesection(struct Section * pSect, FILE * f)
{ {
fputstring(pSect->pzName, f); // RGB3 addition fputstring(pSect->pzName, f); // RGB3 addition
@@ -209,7 +209,7 @@ writesection(struct Section * pSect, FILE * f)
fputlong(pSect->nBank, f); fputlong(pSect->nBank, f);
//RGB1 addition //RGB1 addition
fputlong(pSect->nAlign, f); // RGB3 addition fputlong(pSect->nAlign, f); // RGB3 addition
if ((pSect->nType == SECT_ROM0) if ((pSect->nType == SECT_ROM0)
@@ -230,7 +230,7 @@ writesection(struct Section * pSect, FILE * f)
/* /*
* Write a symbol to a file * Write a symbol to a file
*/ */
void void
writesymbol(struct sSymbol * pSym, FILE * f) writesymbol(struct sSymbol * pSym, FILE * f)
{ {
char symname[MAXSYMLEN * 2 + 1]; char symname[MAXSYMLEN * 2 + 1];
@@ -250,7 +250,7 @@ writesymbol(struct sSymbol * pSym, FILE * f)
strcat(symname, pSym->tzName); strcat(symname, pSym->tzName);
} else } else
strcpy(symname, pSym->tzName); strcpy(symname, pSym->tzName);
if (pSym->nType & SYMF_EXPORT) { if (pSym->nType & SYMF_EXPORT) {
/* Symbol should be exported */ /* Symbol should be exported */
type = SYM_EXPORT; type = SYM_EXPORT;
@@ -279,13 +279,12 @@ writesymbol(struct sSymbol * pSym, FILE * f)
/* /*
* Add a symbol to the object * Add a symbol to the object
*/ */
ULONG ULONG
addsymbol(struct sSymbol * pSym) addsymbol(struct sSymbol * pSym)
{ {
struct PatchSymbol *pPSym, **ppPSym; struct PatchSymbol *pPSym, **ppPSym;
static ULONG nextID = 0; static ULONG nextID = 0;
ULONG hash; ULONG hash;
hash = calchash(pSym->tzName); hash = calchash(pSym->tzName);
ppPSym = &(tHashedPatchSymbols[hash]); ppPSym = &(tHashedPatchSymbols[hash]);
@@ -313,7 +312,7 @@ addsymbol(struct sSymbol * pSym)
/* /*
* Add all exported symbols to the object * Add all exported symbols to the object
*/ */
void void
addexports(void) addexports(void)
{ {
int i; int i;
@@ -353,7 +352,7 @@ allocpatch(void)
/* /*
* Create a new patch (includes the rpn expr) * Create a new patch (includes the rpn expr)
*/ */
void void
createpatch(ULONG type, struct Expression * expr) createpatch(ULONG type, struct Expression * expr)
{ {
struct Patch *pPatch; struct Patch *pPatch;
@@ -429,7 +428,7 @@ createpatch(ULONG type, struct Expression * expr)
/* /*
* A quick check to see if we have an initialized section * A quick check to see if we have an initialized section
*/ */
void void
checksection(void) checksection(void)
{ {
if (pCurrentSection) if (pCurrentSection)
@@ -442,7 +441,7 @@ checksection(void)
* A quick check to see if we have an initialized section that can contain * A quick check to see if we have an initialized section that can contain
* this much initialized data * this much initialized data
*/ */
void void
checkcodesection(SLONG size) checkcodesection(SLONG size)
{ {
checksection(); checksection();
@@ -480,7 +479,7 @@ checkcodesection(SLONG size)
/* /*
* Write an objectfile * Write an objectfile
*/ */
void void
out_WriteObject(void) out_WriteObject(void)
{ {
FILE *f; FILE *f;
@@ -514,7 +513,7 @@ out_WriteObject(void)
/* /*
* Prepare for pass #2 * Prepare for pass #2
*/ */
void void
out_PrepPass2(void) out_PrepPass2(void)
{ {
struct Section *pSect; struct Section *pSect;
@@ -531,7 +530,7 @@ out_PrepPass2(void)
/* /*
* Set the objectfilename * Set the objectfilename
*/ */
void void
out_SetFileName(char *s) out_SetFileName(char *s)
{ {
tzObjectname = s; tzObjectname = s;
@@ -597,7 +596,7 @@ out_FindSection(char *pzName, ULONG secttype, SLONG org, SLONG bank, SLONG align
/* /*
* Set the current section * Set the current section
*/ */
void void
out_SetCurrentSection(struct Section * pSect) out_SetCurrentSection(struct Section * pSect)
{ {
pCurrentSection = pSect; pCurrentSection = pSect;
@@ -610,7 +609,7 @@ out_SetCurrentSection(struct Section * pSect)
/* /*
* Set the current section by name and type * Set the current section by name and type
*/ */
void void
out_NewSection(char *pzName, ULONG secttype) out_NewSection(char *pzName, ULONG secttype)
{ {
out_SetCurrentSection(out_FindSection(pzName, secttype, -1, -1, 1)); 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 * Set the current section by name and type
*/ */
void void
out_NewAbsSection(char *pzName, ULONG secttype, SLONG org, SLONG bank) out_NewAbsSection(char *pzName, ULONG secttype, SLONG org, SLONG bank)
{ {
out_SetCurrentSection(out_FindSection(pzName, secttype, org, bank, 1)); 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 * 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) out_NewAlignedSection(char *pzName, ULONG secttype, SLONG alignment, SLONG bank)
{ {
if (alignment < 0 || alignment > 16) { if (alignment < 0 || alignment > 16) {
@@ -640,7 +639,7 @@ out_NewAlignedSection(char *pzName, ULONG secttype, SLONG alignment, SLONG bank)
/* /*
* Output an absolute byte * Output an absolute byte
*/ */
void void
out_AbsByte(int b) out_AbsByte(int b)
{ {
checkcodesection(1); checkcodesection(1);
@@ -653,7 +652,7 @@ out_AbsByte(int b)
pPCSymbol->nValue += 1; pPCSymbol->nValue += 1;
} }
void void
out_AbsByteGroup(char *s, int length) out_AbsByteGroup(char *s, int length)
{ {
checkcodesection(length); checkcodesection(length);
@@ -664,7 +663,7 @@ out_AbsByteGroup(char *s, int length)
/* /*
* Skip this many bytes * Skip this many bytes
*/ */
void void
out_Skip(int skip) out_Skip(int skip)
{ {
checksection(); checksection();
@@ -683,7 +682,7 @@ out_Skip(int skip)
/* /*
* Output a NULL terminated string (excluding the NULL-character) * Output a NULL terminated string (excluding the NULL-character)
*/ */
void void
out_String(char *s) out_String(char *s)
{ {
checkcodesection(strlen(s)); checkcodesection(strlen(s));
@@ -696,7 +695,7 @@ out_String(char *s)
* is an absolute value in disguise. * is an absolute value in disguise.
*/ */
void void
out_RelByte(struct Expression * expr) out_RelByte(struct Expression * expr)
{ {
checkcodesection(1); checkcodesection(1);
@@ -717,7 +716,7 @@ out_RelByte(struct Expression * expr)
/* /*
* Output an absolute word * Output an absolute word
*/ */
void void
out_AbsWord(int b) out_AbsWord(int b)
{ {
checkcodesection(2); checkcodesection(2);
@@ -735,7 +734,7 @@ out_AbsWord(int b)
* Output a relocatable word. Checking will be done to see if * Output a relocatable word. Checking will be done to see if
* it's an absolute value in disguise. * it's an absolute value in disguise.
*/ */
void void
out_RelWord(struct Expression * expr) out_RelWord(struct Expression * expr)
{ {
ULONG b; ULONG b;
@@ -759,7 +758,7 @@ out_RelWord(struct Expression * expr)
/* /*
* Output an absolute longword * Output an absolute longword
*/ */
void void
out_AbsLong(SLONG b) out_AbsLong(SLONG b)
{ {
checkcodesection(sizeof(SLONG)); checkcodesection(sizeof(SLONG));
@@ -778,7 +777,7 @@ out_AbsLong(SLONG b)
* Output a relocatable longword. Checking will be done to see if * Output a relocatable longword. Checking will be done to see if
* is an absolute value in disguise. * is an absolute value in disguise.
*/ */
void void
out_RelLong(struct Expression * expr) out_RelLong(struct Expression * expr)
{ {
SLONG b; SLONG b;
@@ -804,7 +803,7 @@ out_RelLong(struct Expression * expr)
/* /*
* Output a PC-relative byte * Output a PC-relative byte
*/ */
void void
out_PCRelByte(struct Expression * expr) out_PCRelByte(struct Expression * expr)
{ {
SLONG b = expr->nVal; SLONG b = expr->nVal;
@@ -821,7 +820,7 @@ out_PCRelByte(struct Expression * expr)
/* /*
* Output a binary file * Output a binary file
*/ */
void void
out_BinaryFile(char *s) out_BinaryFile(char *s)
{ {
FILE *f; FILE *f;
@@ -852,7 +851,7 @@ out_BinaryFile(char *s)
fclose(f); fclose(f);
} }
void void
out_BinaryFileSlice(char *s, SLONG start_pos, SLONG length) out_BinaryFileSlice(char *s, SLONG start_pos, SLONG length)
{ {
FILE *f; FILE *f;

View File

@@ -12,7 +12,7 @@
#include "asm/main.h" #include "asm/main.h"
#include "asm/rpn.h" #include "asm/rpn.h"
void void
mergetwoexpressions(struct Expression * expr, struct Expression * src1, mergetwoexpressions(struct Expression * expr, struct Expression * src1,
struct Expression * src2) struct Expression * src2)
{ {
@@ -28,7 +28,7 @@ mergetwoexpressions(struct Expression * expr, struct Expression * src1,
/* /*
* Add a byte to the RPN expression * Add a byte to the RPN expression
*/ */
void void
pushbyte(struct Expression * expr, int b) pushbyte(struct Expression * expr, int b)
{ {
expr->tRPN[expr->nRPNLength++] = b & 0xFF; expr->tRPN[expr->nRPNLength++] = b & 0xFF;
@@ -37,7 +37,7 @@ pushbyte(struct Expression * expr, int b)
/* /*
* Reset the RPN module * Reset the RPN module
*/ */
void void
rpn_Reset(struct Expression * expr) rpn_Reset(struct Expression * expr)
{ {
expr->nRPNLength = expr->nRPNOut = expr->isReloc = expr->isPCRel = 0; 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 * Returns the next rpn byte in expression
*/ */
UWORD UWORD
rpn_PopByte(struct Expression * expr) rpn_PopByte(struct Expression * expr)
{ {
if (expr->nRPNOut == expr->nRPNLength) { if (expr->nRPNOut == expr->nRPNLength) {
@@ -58,7 +58,7 @@ rpn_PopByte(struct Expression * expr)
/* /*
* Determine if the current expression is relocatable * Determine if the current expression is relocatable
*/ */
ULONG ULONG
rpn_isReloc(struct Expression * expr) rpn_isReloc(struct Expression * expr)
{ {
return (expr->isReloc); return (expr->isReloc);
@@ -67,7 +67,7 @@ rpn_isReloc(struct Expression * expr)
/* /*
* Determine if the current expression can be pc-relative * Determine if the current expression can be pc-relative
*/ */
ULONG ULONG
rpn_isPCRelative(struct Expression * expr) rpn_isPCRelative(struct Expression * expr)
{ {
return (expr->isPCRel); return (expr->isPCRel);
@@ -76,7 +76,7 @@ rpn_isPCRelative(struct Expression * expr)
/* /*
* Add symbols, constants and operators to expression * Add symbols, constants and operators to expression
*/ */
void void
rpn_Number(struct Expression * expr, ULONG i) rpn_Number(struct Expression * expr, ULONG i)
{ {
rpn_Reset(expr); rpn_Reset(expr);
@@ -88,7 +88,7 @@ rpn_Number(struct Expression * expr, ULONG i)
expr->nVal = i; expr->nVal = i;
} }
void void
rpn_Symbol(struct Expression * expr, char *tzSym) rpn_Symbol(struct Expression * expr, char *tzSym)
{ {
if (!sym_isConstant(tzSym)) { if (!sym_isConstant(tzSym)) {
@@ -110,7 +110,7 @@ rpn_Symbol(struct Expression * expr, char *tzSym)
rpn_Number(expr, sym_GetConstantValue(tzSym)); rpn_Number(expr, sym_GetConstantValue(tzSym));
} }
void void
rpn_Bank(struct Expression * expr, char *tzSym) rpn_Bank(struct Expression * expr, char *tzSym)
{ {
if (!sym_isConstant(tzSym)) { if (!sym_isConstant(tzSym)) {
@@ -128,7 +128,7 @@ rpn_Bank(struct Expression * expr, char *tzSym)
yyerror("BANK argument must be a relocatable identifier"); yyerror("BANK argument must be a relocatable identifier");
} }
int int
rpn_RangeCheck(struct Expression * expr, struct Expression * src, SLONG low, rpn_RangeCheck(struct Expression * expr, struct Expression * src, SLONG low,
SLONG high) 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) rpn_CheckHRAM(struct Expression * expr, struct Expression * src)
{ {
*expr = *src; *expr = *src;
pushbyte(expr, RPN_HRAM); pushbyte(expr, RPN_HRAM);
} }
void void
rpn_LOGNOT(struct Expression * expr, struct Expression * src) rpn_LOGNOT(struct Expression * expr, struct Expression * src)
{ {
*expr = *src; *expr = *src;
pushbyte(expr, RPN_LOGUNNOT); pushbyte(expr, RPN_LOGUNNOT);
} }
void void
rpn_LOGOR(struct Expression * expr, struct Expression * src1, rpn_LOGOR(struct Expression * expr, struct Expression * src1,
struct Expression * src2) struct Expression * src2)
{ {
@@ -173,7 +173,7 @@ rpn_LOGOR(struct Expression * expr, struct Expression * src1,
pushbyte(expr, RPN_LOGOR); pushbyte(expr, RPN_LOGOR);
} }
void void
rpn_LOGAND(struct Expression * expr, struct Expression * src1, rpn_LOGAND(struct Expression * expr, struct Expression * src1,
struct Expression * src2) struct Expression * src2)
{ {
@@ -182,7 +182,7 @@ rpn_LOGAND(struct Expression * expr, struct Expression * src1,
pushbyte(expr, RPN_LOGAND); pushbyte(expr, RPN_LOGAND);
} }
void void
rpn_LOGEQU(struct Expression * expr, struct Expression * src1, rpn_LOGEQU(struct Expression * expr, struct Expression * src1,
struct Expression * src2) struct Expression * src2)
{ {
@@ -191,7 +191,7 @@ rpn_LOGEQU(struct Expression * expr, struct Expression * src1,
pushbyte(expr, RPN_LOGEQ); pushbyte(expr, RPN_LOGEQ);
} }
void void
rpn_LOGGT(struct Expression * expr, struct Expression * src1, rpn_LOGGT(struct Expression * expr, struct Expression * src1,
struct Expression * src2) struct Expression * src2)
{ {
@@ -200,7 +200,7 @@ rpn_LOGGT(struct Expression * expr, struct Expression * src1,
pushbyte(expr, RPN_LOGGT); pushbyte(expr, RPN_LOGGT);
} }
void void
rpn_LOGLT(struct Expression * expr, struct Expression * src1, rpn_LOGLT(struct Expression * expr, struct Expression * src1,
struct Expression * src2) struct Expression * src2)
{ {
@@ -209,7 +209,7 @@ rpn_LOGLT(struct Expression * expr, struct Expression * src1,
pushbyte(expr, RPN_LOGLT); pushbyte(expr, RPN_LOGLT);
} }
void void
rpn_LOGGE(struct Expression * expr, struct Expression * src1, rpn_LOGGE(struct Expression * expr, struct Expression * src1,
struct Expression * src2) struct Expression * src2)
{ {
@@ -218,7 +218,7 @@ rpn_LOGGE(struct Expression * expr, struct Expression * src1,
pushbyte(expr, RPN_LOGGE); pushbyte(expr, RPN_LOGGE);
} }
void void
rpn_LOGLE(struct Expression * expr, struct Expression * src1, rpn_LOGLE(struct Expression * expr, struct Expression * src1,
struct Expression * src2) struct Expression * src2)
{ {
@@ -227,7 +227,7 @@ rpn_LOGLE(struct Expression * expr, struct Expression * src1,
pushbyte(expr, RPN_LOGLE); pushbyte(expr, RPN_LOGLE);
} }
void void
rpn_LOGNE(struct Expression * expr, struct Expression * src1, rpn_LOGNE(struct Expression * expr, struct Expression * src1,
struct Expression * src2) struct Expression * src2)
{ {
@@ -236,7 +236,7 @@ rpn_LOGNE(struct Expression * expr, struct Expression * src1,
pushbyte(expr, RPN_LOGNE); pushbyte(expr, RPN_LOGNE);
} }
void void
rpn_ADD(struct Expression * expr, struct Expression * src1, rpn_ADD(struct Expression * expr, struct Expression * src1,
struct Expression * src2) struct Expression * src2)
{ {
@@ -245,7 +245,7 @@ rpn_ADD(struct Expression * expr, struct Expression * src1,
pushbyte(expr, RPN_ADD); pushbyte(expr, RPN_ADD);
} }
void void
rpn_SUB(struct Expression * expr, struct Expression * src1, rpn_SUB(struct Expression * expr, struct Expression * src1,
struct Expression * src2) struct Expression * src2)
{ {
@@ -254,7 +254,7 @@ rpn_SUB(struct Expression * expr, struct Expression * src1,
pushbyte(expr, RPN_SUB); pushbyte(expr, RPN_SUB);
} }
void void
rpn_XOR(struct Expression * expr, struct Expression * src1, rpn_XOR(struct Expression * expr, struct Expression * src1,
struct Expression * src2) struct Expression * src2)
{ {
@@ -263,7 +263,7 @@ rpn_XOR(struct Expression * expr, struct Expression * src1,
pushbyte(expr, RPN_XOR); pushbyte(expr, RPN_XOR);
} }
void void
rpn_OR(struct Expression * expr, struct Expression * src1, rpn_OR(struct Expression * expr, struct Expression * src1,
struct Expression * src2) struct Expression * src2)
{ {
@@ -272,7 +272,7 @@ rpn_OR(struct Expression * expr, struct Expression * src1,
pushbyte(expr, RPN_OR); pushbyte(expr, RPN_OR);
} }
void void
rpn_AND(struct Expression * expr, struct Expression * src1, rpn_AND(struct Expression * expr, struct Expression * src1,
struct Expression * src2) struct Expression * src2)
{ {
@@ -281,7 +281,7 @@ rpn_AND(struct Expression * expr, struct Expression * src1,
pushbyte(expr, RPN_AND); pushbyte(expr, RPN_AND);
} }
void void
rpn_SHL(struct Expression * expr, struct Expression * src1, rpn_SHL(struct Expression * expr, struct Expression * src1,
struct Expression * src2) struct Expression * src2)
{ {
@@ -290,7 +290,7 @@ rpn_SHL(struct Expression * expr, struct Expression * src1,
pushbyte(expr, RPN_SHL); pushbyte(expr, RPN_SHL);
} }
void void
rpn_SHR(struct Expression * expr, struct Expression * src1, rpn_SHR(struct Expression * expr, struct Expression * src1,
struct Expression * src2) struct Expression * src2)
{ {
@@ -299,7 +299,7 @@ rpn_SHR(struct Expression * expr, struct Expression * src1,
pushbyte(expr, RPN_SHR); pushbyte(expr, RPN_SHR);
} }
void void
rpn_MUL(struct Expression * expr, struct Expression * src1, rpn_MUL(struct Expression * expr, struct Expression * src1,
struct Expression * src2) struct Expression * src2)
{ {
@@ -308,7 +308,7 @@ rpn_MUL(struct Expression * expr, struct Expression * src1,
pushbyte(expr, RPN_MUL); pushbyte(expr, RPN_MUL);
} }
void void
rpn_DIV(struct Expression * expr, struct Expression * src1, rpn_DIV(struct Expression * expr, struct Expression * src1,
struct Expression * src2) struct Expression * src2)
{ {
@@ -320,7 +320,7 @@ rpn_DIV(struct Expression * expr, struct Expression * src1,
pushbyte(expr, RPN_DIV); pushbyte(expr, RPN_DIV);
} }
void void
rpn_MOD(struct Expression * expr, struct Expression * src1, rpn_MOD(struct Expression * expr, struct Expression * src1,
struct Expression * src2) struct Expression * src2)
{ {
@@ -332,7 +332,7 @@ rpn_MOD(struct Expression * expr, struct Expression * src1,
pushbyte(expr, RPN_MOD); pushbyte(expr, RPN_MOD);
} }
void void
rpn_UNNEG(struct Expression * expr, struct Expression * src) rpn_UNNEG(struct Expression * expr, struct Expression * src)
{ {
*expr = *src; *expr = *src;
@@ -340,7 +340,7 @@ rpn_UNNEG(struct Expression * expr, struct Expression * src)
pushbyte(expr, RPN_UNSUB); pushbyte(expr, RPN_UNSUB);
} }
void void
rpn_UNNOT(struct Expression * expr, struct Expression * src) rpn_UNNOT(struct Expression * expr, struct Expression * src)
{ {
*expr = *src; *expr = *src;

View File

@@ -23,7 +23,7 @@ char SavedTIME[256];
char SavedDATE[256]; char SavedDATE[256];
bool exportall; bool exportall;
SLONG SLONG
Callback_NARG(struct sSymbol * sym) Callback_NARG(struct sSymbol * sym)
{ {
ULONG i = 0; ULONG i = 0;
@@ -37,7 +37,7 @@ Callback_NARG(struct sSymbol * sym)
/* /*
* Get the nValue field of a symbol * Get the nValue field of a symbol
*/ */
SLONG SLONG
getvaluefield(struct sSymbol * sym) getvaluefield(struct sSymbol * sym)
{ {
if (sym->Callback) { if (sym->Callback) {
@@ -49,7 +49,7 @@ getvaluefield(struct sSymbol * sym)
/* /*
* Calculate the hash value for a string * Calculate the hash value for a string
*/ */
ULONG ULONG
calchash(char *s) calchash(char *s)
{ {
ULONG hash = 5381; ULONG hash = 5381;
@@ -153,7 +153,7 @@ sym_FindSymbol(char *tzName)
/* /*
* Purge a symbol * Purge a symbol
*/ */
void void
sym_Purge(char *tzName) sym_Purge(char *tzName)
{ {
struct sSymbol **ppSym; struct sSymbol **ppSym;
@@ -184,7 +184,7 @@ sym_Purge(char *tzName)
/* /*
* Determine if a symbol has been defined * Determine if a symbol has been defined
*/ */
ULONG ULONG
sym_isConstDefined(char *tzName) sym_isConstDefined(char *tzName)
{ {
struct sSymbol *psym, *pscope; struct sSymbol *psym, *pscope;
@@ -208,7 +208,7 @@ sym_isConstDefined(char *tzName)
return (0); return (0);
} }
ULONG ULONG
sym_isDefined(char *tzName) sym_isDefined(char *tzName)
{ {
struct sSymbol *psym, *pscope; struct sSymbol *psym, *pscope;
@@ -229,7 +229,7 @@ sym_isDefined(char *tzName)
/* /*
* Determine if the symbol is a constant * Determine if the symbol is a constant
*/ */
ULONG ULONG
sym_isConstant(char *s) sym_isConstant(char *s)
{ {
struct sSymbol *psym, *pscope; struct sSymbol *psym, *pscope;
@@ -266,7 +266,7 @@ sym_GetStringValue(char *tzSym)
/* /*
* Return a constant symbols value * Return a constant symbols value
*/ */
ULONG ULONG
sym_GetConstantValue(char *s) sym_GetConstantValue(char *s)
{ {
struct sSymbol *psym, *pscope; struct sSymbol *psym, *pscope;
@@ -292,7 +292,7 @@ sym_GetConstantValue(char *s)
/* /*
* Return a symbols value... "estimated" if not defined yet * Return a symbols value... "estimated" if not defined yet
*/ */
ULONG ULONG
sym_GetValue(char *s) sym_GetValue(char *s)
{ {
struct sSymbol *psym, *pscope; struct sSymbol *psym, *pscope;
@@ -331,7 +331,7 @@ sym_GetValue(char *s)
/* /*
* Return a defined symbols value... aborts if not defined yet * Return a defined symbols value... aborts if not defined yet
*/ */
ULONG ULONG
sym_GetDefinedValue(char *s) sym_GetDefinedValue(char *s)
{ {
struct sSymbol *psym, *pscope; struct sSymbol *psym, *pscope;
@@ -360,7 +360,7 @@ sym_GetDefinedValue(char *s)
/* /*
* Macro argument stuff * Macro argument stuff
*/ */
void void
sym_ShiftCurrentMacroArgs(void) sym_ShiftCurrentMacroArgs(void)
{ {
SLONG i; SLONG i;
@@ -384,7 +384,7 @@ sym_FindMacroArg(SLONG i)
return (currentmacroargs[i - 1]); return (currentmacroargs[i - 1]);
} }
void void
sym_UseNewMacroArgs(void) sym_UseNewMacroArgs(void)
{ {
SLONG i; SLONG i;
@@ -395,7 +395,7 @@ sym_UseNewMacroArgs(void)
} }
} }
void void
sym_SaveCurrentMacroArgs(char *save[]) sym_SaveCurrentMacroArgs(char *save[])
{ {
SLONG i; SLONG i;
@@ -404,7 +404,7 @@ sym_SaveCurrentMacroArgs(char *save[])
save[i] = currentmacroargs[i]; save[i] = currentmacroargs[i];
} }
void void
sym_RestoreCurrentMacroArgs(char *save[]) sym_RestoreCurrentMacroArgs(char *save[])
{ {
SLONG i; SLONG i;
@@ -413,7 +413,7 @@ sym_RestoreCurrentMacroArgs(char *save[])
currentmacroargs[i] = save[i]; currentmacroargs[i] = save[i];
} }
void void
sym_FreeCurrentMacroArgs(void) sym_FreeCurrentMacroArgs(void)
{ {
SLONG i; SLONG i;
@@ -424,7 +424,7 @@ sym_FreeCurrentMacroArgs(void)
} }
} }
void void
sym_AddNewMacroArg(char *s) sym_AddNewMacroArg(char *s)
{ {
SLONG i = 0; SLONG i = 0;
@@ -441,7 +441,7 @@ sym_AddNewMacroArg(char *s)
yyerror("A maximum of %d arguments allowed", MAXMACROARGS); yyerror("A maximum of %d arguments allowed", MAXMACROARGS);
} }
void void
sym_SetMacroArgID(ULONG nMacroCount) sym_SetMacroArgID(ULONG nMacroCount)
{ {
char s[256]; char s[256];
@@ -450,7 +450,7 @@ sym_SetMacroArgID(ULONG nMacroCount)
newmacroargs[MAXMACROARGS] = strdup(s); newmacroargs[MAXMACROARGS] = strdup(s);
} }
void void
sym_UseCurrentMacroArgs(void) sym_UseCurrentMacroArgs(void)
{ {
SLONG i; SLONG i;
@@ -471,7 +471,7 @@ sym_FindMacro(char *s)
/* /*
* Add an equated symbol * Add an equated symbol
*/ */
void void
sym_AddEqu(char *tzSym, SLONG value) sym_AddEqu(char *tzSym, SLONG value)
{ {
if ((nPass == 1) if ((nPass == 1)
@@ -497,7 +497,7 @@ sym_AddEqu(char *tzSym, SLONG value)
/* /*
* Add a string equated symbol * Add a string equated symbol
*/ */
void void
sym_AddString(char *tzSym, char *tzValue) sym_AddString(char *tzSym, char *tzValue)
{ {
struct sSymbol *nsym; struct sSymbol *nsym;
@@ -523,7 +523,7 @@ sym_AddString(char *tzSym, char *tzValue)
/* /*
* check if symbol is a string equated symbol * check if symbol is a string equated symbol
*/ */
ULONG ULONG
sym_isString(char *tzSym) sym_isString(char *tzSym)
{ {
struct sSymbol *pSym; struct sSymbol *pSym;
@@ -538,7 +538,7 @@ sym_isString(char *tzSym)
/* /*
* Alter a SET symbols value * Alter a SET symbols value
*/ */
void void
sym_AddSet(char *tzSym, SLONG value) sym_AddSet(char *tzSym, SLONG value)
{ {
struct sSymbol *nsym; struct sSymbol *nsym;
@@ -557,7 +557,7 @@ sym_AddSet(char *tzSym, SLONG value)
/* /*
* Add a local (.name) relocatable symbol * Add a local (.name) relocatable symbol
*/ */
void void
sym_AddLocalReloc(char *tzSym) sym_AddLocalReloc(char *tzSym)
{ {
if ((nPass == 1) if ((nPass == 1)
@@ -591,7 +591,7 @@ sym_AddLocalReloc(char *tzSym)
/* /*
* Add a relocatable symbol * Add a relocatable symbol
*/ */
void void
sym_AddReloc(char *tzSym) sym_AddReloc(char *tzSym)
{ {
if ((nPass == 1) if ((nPass == 1)
@@ -622,7 +622,7 @@ sym_AddReloc(char *tzSym)
/* /*
* Export a symbol * Export a symbol
*/ */
void void
sym_Export(char *tzSym) sym_Export(char *tzSym)
{ {
if (nPass == 1) { if (nPass == 1) {
@@ -649,7 +649,7 @@ sym_Export(char *tzSym)
/* /*
* Import a symbol * Import a symbol
*/ */
void void
sym_Import(char *tzSym) sym_Import(char *tzSym)
{ {
if (nPass == 1) { if (nPass == 1) {
@@ -667,7 +667,7 @@ sym_Import(char *tzSym)
/* /*
* Globalize a symbol (export if defined, import if not) * Globalize a symbol (export if defined, import if not)
*/ */
void void
sym_Global(char *tzSym) sym_Global(char *tzSym)
{ {
if (nPass == 2) { if (nPass == 2) {
@@ -692,7 +692,7 @@ sym_Global(char *tzSym)
/* /*
* Add a macro definition * Add a macro definition
*/ */
void void
sym_AddMacro(char *tzSym) sym_AddMacro(char *tzSym)
{ {
if ((nPass == 1) if ((nPass == 1)
@@ -717,7 +717,7 @@ sym_AddMacro(char *tzSym)
} }
} }
/* /*
* Set whether to export all relocable symbols by default * Set whether to export all relocable symbols by default
*/ */
void sym_SetExportAll(BBOOL set) { void sym_SetExportAll(BBOOL set) {
@@ -727,7 +727,7 @@ void sym_SetExportAll(BBOOL set) {
/* /*
* Prepare for pass #1 * Prepare for pass #1
*/ */
void void
sym_PrepPass1(void) sym_PrepPass1(void)
{ {
sym_Init(); sym_Init();
@@ -736,7 +736,7 @@ sym_PrepPass1(void)
/* /*
* Prepare for pass #2 * Prepare for pass #2
*/ */
void void
sym_PrepPass2(void) sym_PrepPass2(void)
{ {
SLONG i; SLONG i;
@@ -773,7 +773,7 @@ sym_PrepPass2(void)
/* /*
* Initialize the symboltable * Initialize the symboltable
*/ */
void void
sym_Init(void) sym_Init(void)
{ {
SLONG i; SLONG i;

View File

@@ -63,7 +63,7 @@ ensureSectionTypeIsValid(enum eSectionType type)
} }
} }
SLONG SLONG
area_Avail(SLONG bank) area_Avail(SLONG bank)
{ {
SLONG r; SLONG r;
@@ -554,7 +554,7 @@ AssignSections(void)
} }
} }
void void
CreateSymbolTable(void) CreateSymbolTable(void)
{ {
struct sSection *pSect; struct sSection *pSect;

View File

@@ -7,7 +7,7 @@
#include "link/mylink.h" #include "link/mylink.h"
#include "link/main.h" #include "link/main.h"
static BBOOL static BBOOL
symboldefined(char *name) symboldefined(char *name)
{ {
struct sSection *pSect; struct sSection *pSect;
@@ -31,7 +31,7 @@ symboldefined(char *name)
return (0); return (0);
} }
static BBOOL static BBOOL
addmodulecontaining(char *name) addmodulecontaining(char *name)
{ {
struct sSection **ppLSect; struct sSection **ppLSect;
@@ -66,7 +66,7 @@ addmodulecontaining(char *name)
return (0); return (0);
} }
void void
AddNeededModules(void) AddNeededModules(void)
{ {
struct sSection *pSect; struct sSection *pSect;

View File

@@ -13,7 +13,7 @@ FILE *sf = NULL;
SLONG currentbank = 0; SLONG currentbank = 0;
SLONG sfbank; SLONG sfbank;
void void
SetMapfileName(char *name) SetMapfileName(char *name)
{ {
mf = fopen(name, "w"); mf = fopen(name, "w");
@@ -23,7 +23,7 @@ SetMapfileName(char *name)
} }
} }
void void
SetSymfileName(char *name) SetSymfileName(char *name)
{ {
sf = fopen(name, "w"); sf = fopen(name, "w");
@@ -35,7 +35,7 @@ SetSymfileName(char *name)
fprintf(sf, ";File generated by rgblink\n\n"); fprintf(sf, ";File generated by rgblink\n\n");
} }
void void
CloseMapfile(void) CloseMapfile(void)
{ {
if (mf) { if (mf) {
@@ -48,7 +48,7 @@ CloseMapfile(void)
} }
} }
void void
MapfileInitBank(SLONG bank) MapfileInitBank(SLONG bank)
{ {
if (mf) { if (mf) {
@@ -90,7 +90,7 @@ MapfileInitBank(SLONG bank)
} }
} }
void void
MapfileWriteSection(struct sSection * pSect) MapfileWriteSection(struct sSection * pSect)
{ {
SLONG i; SLONG i;
@@ -125,7 +125,7 @@ MapfileWriteSection(struct sSection * pSect)
} }
} }
void void
MapfileCloseBank(SLONG slack) MapfileCloseBank(SLONG slack)
{ {
if (!mf) if (!mf)

View File

@@ -29,7 +29,7 @@ enum ObjectFileContents {
* *
*/ */
SLONG SLONG
readlong(FILE * f) readlong(FILE * f)
{ {
SLONG r; SLONG r;
@@ -42,7 +42,7 @@ readlong(FILE * f)
return (r); return (r);
} }
UWORD UWORD
readword(FILE * f) readword(FILE * f)
{ {
UWORD r; UWORD r;
@@ -224,7 +224,7 @@ obj_ReadRGB0Section(FILE * f)
return pSection; return pSection;
} }
void void
obj_ReadRGB0(FILE * pObjfile) obj_ReadRGB0(FILE * pObjfile)
{ {
struct sSection *pFirstSection; struct sSection *pFirstSection;
@@ -375,7 +375,7 @@ obj_ReadRGBSection(FILE * f, enum ObjectFileContents contents)
return pSection; return pSection;
} }
void void
obj_ReadRGB(FILE * pObjfile, enum ObjectFileContents contents) obj_ReadRGB(FILE * pObjfile, enum ObjectFileContents contents)
{ {
struct sSection *pFirstSection; struct sSection *pFirstSection;
@@ -435,7 +435,7 @@ obj_ReadRGB(FILE * pObjfile, enum ObjectFileContents contents)
* *
*/ */
void void
obj_ReadOpenFile(FILE * pObjfile, char *tzObjectfile) obj_ReadOpenFile(FILE * pObjfile, char *tzObjectfile)
{ {
char tzHeader[8]; char tzHeader[8];
@@ -464,7 +464,7 @@ obj_ReadOpenFile(FILE * pObjfile, char *tzObjectfile)
} }
} }
void void
obj_Readfile(char *tzObjectfile) obj_Readfile(char *tzObjectfile)
{ {
FILE *pObjfile; FILE *pObjfile;
@@ -484,7 +484,7 @@ obj_Readfile(char *tzObjectfile)
oReadLib = 0; oReadLib = 0;
} }
SLONG SLONG
file_Length(FILE * f) file_Length(FILE * f)
{ {
ULONG r, p; ULONG r, p;
@@ -497,7 +497,7 @@ file_Length(FILE * f)
return (r); return (r);
} }
void void
lib_ReadXLB0(FILE * f) lib_ReadXLB0(FILE * f)
{ {
SLONG size; SLONG size;

View File

@@ -12,7 +12,7 @@ char *tzOverlayname = NULL;
SLONG MaxOverlayBank; SLONG MaxOverlayBank;
void void
writehome(FILE * f, FILE * f_overlay) writehome(FILE * f, FILE * f_overlay)
{ {
struct sSection *pSect; struct sSection *pSect;
@@ -46,7 +46,7 @@ writehome(FILE * f, FILE * f_overlay)
free(mem); free(mem);
} }
void void
writebank(FILE * f, FILE * f_overlay, SLONG bank) writebank(FILE * f, FILE * f_overlay, SLONG bank)
{ {
struct sSection *pSect; struct sSection *pSect;
@@ -80,20 +80,20 @@ writebank(FILE * f, FILE * f_overlay, SLONG bank)
free(mem); free(mem);
} }
void void
out_Setname(char *tzOutputfile) out_Setname(char *tzOutputfile)
{ {
tzOutname = tzOutputfile; tzOutname = tzOutputfile;
} }
void void
out_SetOverlayname(char *tzOverlayfile) out_SetOverlayname(char *tzOverlayfile)
{ {
tzOverlayname = tzOverlayfile; tzOverlayname = tzOverlayfile;
} }
void void
Output(void) Output(void)
{ {
SLONG i; SLONG i;

View File

@@ -13,19 +13,19 @@ SLONG rpnstack[256];
SLONG rpnp; SLONG rpnp;
SLONG nPC; SLONG nPC;
void void
rpnpush(SLONG i) rpnpush(SLONG i)
{ {
rpnstack[rpnp++] = i; rpnstack[rpnp++] = i;
} }
SLONG SLONG
rpnpop(void) rpnpop(void)
{ {
return (rpnstack[--rpnp]); return (rpnstack[--rpnp]);
} }
SLONG SLONG
getsymvalue(SLONG symid) getsymvalue(SLONG symid)
{ {
switch (pCurrentSection->tSymbols[symid]->Type) { switch (pCurrentSection->tSymbols[symid]->Type) {
@@ -51,7 +51,7 @@ getsymvalue(SLONG symid)
errx(1, "*INTERNAL* UNKNOWN SYMBOL TYPE"); errx(1, "*INTERNAL* UNKNOWN SYMBOL TYPE");
} }
SLONG SLONG
getsymbank(SLONG symid) getsymbank(SLONG symid)
{ {
SLONG nBank; SLONG nBank;
@@ -79,7 +79,7 @@ getsymbank(SLONG symid)
return nBank; return nBank;
} }
SLONG SLONG
calcrpn(struct sPatch * pPatch) calcrpn(struct sPatch * pPatch)
{ {
SLONG t, size; SLONG t, size;
@@ -231,7 +231,7 @@ calcrpn(struct sPatch * pPatch)
return (rpnpop()); return (rpnpop());
} }
void void
Patch(void) Patch(void)
{ {
struct sSection *pSect; struct sSection *pSect;

View File

@@ -19,7 +19,7 @@ struct ISymbol {
struct ISymbol *tHash[HASHSIZE]; struct ISymbol *tHash[HASHSIZE];
SLONG SLONG
calchash(char *s) calchash(char *s)
{ {
SLONG r = 0; SLONG r = 0;
@@ -29,7 +29,7 @@ calchash(char *s)
return (r % HASHSIZE); return (r % HASHSIZE);
} }
void void
sym_Init(void) sym_Init(void)
{ {
SLONG i; SLONG i;
@@ -37,7 +37,7 @@ sym_Init(void)
tHash[i] = NULL; tHash[i] = NULL;
} }
SLONG SLONG
sym_GetValue(char *tzName) sym_GetValue(char *tzName)
{ {
if (strcmp(tzName, "@") == 0) { if (strcmp(tzName, "@") == 0) {
@@ -58,7 +58,7 @@ sym_GetValue(char *tzName)
} }
} }
SLONG SLONG
sym_GetBank(char *tzName) sym_GetBank(char *tzName)
{ {
struct ISymbol **ppSym; struct ISymbol **ppSym;
@@ -75,7 +75,7 @@ sym_GetBank(char *tzName)
errx(1, "Unknown symbol '%s'", tzName); errx(1, "Unknown symbol '%s'", tzName);
} }
void void
sym_CreateSymbol(char *tzName, SLONG nValue, SLONG nBank) sym_CreateSymbol(char *tzName, SLONG nValue, SLONG nBank)
{ {
if (strcmp(tzName, "@") == 0) if (strcmp(tzName, "@") == 0)