From d8070a10ebf5ec6cd8fbafb04236f447f9c0b13b Mon Sep 17 00:00:00 2001 From: anthony Date: Wed, 30 Dec 2009 12:59:36 -0700 Subject: [PATCH] run indent on header files (whitespace changes) Merging lai's source with this one is very irritating because they have different indentation styles. I couldn't find what profile vegard used for his version, so I used these flags (which should bring the source close to KNF): -bap -br -ce -ci4 -cli0 -d0 -di0 -i8 -ip -l79 -nbc -ncdb -ndj -ei -nfc1 -nlp -npcs -psl -sc -sob --- include/asm/asm.h | 2 +- include/asm/gameboy/localasm.h | 3 - include/asm/lexer.h | 5 +- include/asm/main.h | 3 +- include/asm/mylink.h | 1 - include/asm/output.h | 8 +-- include/asm/rpn.h | 119 +++++++++++++++++++-------------- include/asm/symbol.h | 22 +++--- include/link/assign.h | 1 - include/link/mapfile.h | 2 +- 10 files changed, 93 insertions(+), 73 deletions(-) diff --git a/include/asm/asm.h b/include/asm/asm.h index fc2ecfed..bde48eb3 100644 --- a/include/asm/asm.h +++ b/include/asm/asm.h @@ -33,4 +33,4 @@ extern UBYTE oDontExpandStrings; #define MAXMACROARGS 9 #define MAXINCPATHS 16 -#endif // ASM_H +#endif /* // ASM_H */ diff --git a/include/asm/gameboy/localasm.h b/include/asm/gameboy/localasm.h index d26683da..b2931639 100644 --- a/include/asm/gameboy/localasm.h +++ b/include/asm/gameboy/localasm.h @@ -105,7 +105,6 @@ enum { REG_HL_IND, REG_A }; - /* "rr" defs */ enum { @@ -114,7 +113,6 @@ enum { REG_HL_INDINC, REG_HL_INDDEC, }; - /* "ss" defs */ enum { @@ -123,7 +121,6 @@ enum { REG_HL, REG_SP }; - /* "tt" defs */ /* diff --git a/include/asm/lexer.h b/include/asm/lexer.h index 522b1216..27fe475c 100644 --- a/include/asm/lexer.h +++ b/include/asm/lexer.h @@ -28,7 +28,6 @@ enum eLexerState { LEX_STATE_NORMAL, LEX_STATE_MACROARGS }; - #define INITIAL 0 #define macroarg 3 @@ -39,7 +38,7 @@ extern YY_BUFFER_STATE yy_create_buffer(FILE * f); extern YY_BUFFER_STATE yy_scan_bytes(char *mem, ULONG size); extern void yy_delete_buffer(YY_BUFFER_STATE); extern void yy_switch_to_buffer(YY_BUFFER_STATE); -extern ULONG lex_FloatAlloc(struct sLexFloat *tok); +extern ULONG lex_FloatAlloc(struct sLexFloat * tok); extern void lex_FloatAddRange(ULONG id, UWORD start, UWORD end); extern void lex_FloatDeleteRange(ULONG id, UWORD start, UWORD end); extern void lex_FloatAddFirstRange(ULONG id, UWORD start, UWORD end); @@ -47,7 +46,7 @@ extern void lex_FloatDeleteFirstRange(ULONG id, UWORD start, UWORD end); extern void lex_FloatAddSecondRange(ULONG id, UWORD start, UWORD end); extern void lex_FloatDeleteSecondRange(ULONG id, UWORD start, UWORD end); extern void lex_Init(void); -extern void lex_AddStrings(struct sLexInitString *lex); +extern void lex_AddStrings(struct sLexInitString * lex); extern void lex_SetBuffer(char *buffer, ULONG len); extern ULONG yylex(void); extern void yyunput(char c); diff --git a/include/asm/main.h b/include/asm/main.h index 9a5621d1..0867bbe3 100644 --- a/include/asm/main.h +++ b/include/asm/main.h @@ -5,7 +5,8 @@ struct sOptions { ULONG endian; char gbgfx[4]; char binary[2]; - SLONG fillchar; // -1 == random + SLONG fillchar; + //-1 == random }; extern char *tzNewMacro; diff --git a/include/asm/mylink.h b/include/asm/mylink.h index 94a76eee..0586b77b 100644 --- a/include/asm/mylink.h +++ b/include/asm/mylink.h @@ -115,5 +115,4 @@ enum { PATCH_WORD_B, PATCH_LONG_B }; - #endif diff --git a/include/asm/output.h b/include/asm/output.h index 94272b50..a6406ca5 100644 --- a/include/asm/output.h +++ b/include/asm/output.h @@ -20,15 +20,15 @@ void out_SetFileName(char *s); void out_NewSection(char *pzName, ULONG secttype); void out_NewAbsSection(char *pzName, ULONG secttype, SLONG org, SLONG bank); void out_AbsByte(int b); -void out_RelByte(struct Expression *expr); -void out_RelWord(struct Expression *expr); -void out_PCRelByte(struct Expression *expr); +void out_RelByte(struct Expression * expr); +void out_RelWord(struct Expression * expr); +void out_PCRelByte(struct Expression * expr); void out_WriteObject(void); void out_Skip(int skip); void out_BinaryFile(char *s); void out_String(char *s); void out_AbsLong(SLONG b); -void out_RelLong(struct Expression *expr); +void out_RelLong(struct Expression * expr); void out_PushSection(void); void out_PopSection(void); diff --git a/include/asm/rpn.h b/include/asm/rpn.h index b9c0aec0..59194351 100644 --- a/include/asm/rpn.h +++ b/include/asm/rpn.h @@ -10,59 +10,78 @@ struct Expression { ULONG isPCRel; }; -ULONG rpn_isReloc(struct Expression *expr); -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 rpn_LOGOR(struct Expression *expr, struct Expression *src1, - struct Expression *src2); -void rpn_LOGAND(struct Expression *expr, struct Expression *src1, - struct Expression *src2); -void rpn_LOGEQU(struct Expression *expr, struct Expression *src1, - struct Expression *src2); -void rpn_LOGGT(struct Expression *expr, struct Expression *src1, - struct Expression *src2); -void rpn_LOGLT(struct Expression *expr, struct Expression *src1, - struct Expression *src2); -void rpn_LOGGE(struct Expression *expr, struct Expression *src1, - struct Expression *src2); -void rpn_LOGLE(struct Expression *expr, struct Expression *src1, - struct Expression *src2); -void rpn_LOGNE(struct Expression *expr, struct Expression *src1, - struct Expression *src2); -void rpn_ADD(struct Expression *expr, struct Expression *src1, - struct Expression *src2); -void rpn_SUB(struct Expression *expr, struct Expression *src1, - struct Expression *src2); -void rpn_XOR(struct Expression *expr, struct Expression *src1, - struct Expression *src2); -void rpn_OR(struct Expression *expr, struct Expression *src1, - struct Expression *src2); -void rpn_AND(struct Expression *expr, struct Expression *src1, - struct Expression *src2); -void rpn_SHL(struct Expression *expr, struct Expression *src1, - struct Expression *src2); -void rpn_SHR(struct Expression *expr, struct Expression *src1, - struct Expression *src2); -void rpn_MUL(struct Expression *expr, struct Expression *src1, - struct Expression *src2); -void rpn_DIV(struct Expression *expr, struct Expression *src1, - struct Expression *src2); -void rpn_MOD(struct Expression *expr, struct Expression *src1, - struct Expression *src2); -void rpn_UNNEG(struct Expression *expr, struct Expression *src); -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 rpn_RangeCheck(struct Expression *expr, struct Expression *src, SLONG low, - SLONG high); +ULONG rpn_isReloc(struct Expression * expr); +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 +rpn_LOGOR(struct Expression * expr, struct Expression * src1, + struct Expression * src2); +void +rpn_LOGAND(struct Expression * expr, struct Expression * src1, + struct Expression * src2); +void +rpn_LOGEQU(struct Expression * expr, struct Expression * src1, + struct Expression * src2); +void +rpn_LOGGT(struct Expression * expr, struct Expression * src1, + struct Expression * src2); +void +rpn_LOGLT(struct Expression * expr, struct Expression * src1, + struct Expression * src2); +void +rpn_LOGGE(struct Expression * expr, struct Expression * src1, + struct Expression * src2); +void +rpn_LOGLE(struct Expression * expr, struct Expression * src1, + struct Expression * src2); +void +rpn_LOGNE(struct Expression * expr, struct Expression * src1, + struct Expression * src2); +void +rpn_ADD(struct Expression * expr, struct Expression * src1, + struct Expression * src2); +void +rpn_SUB(struct Expression * expr, struct Expression * src1, + struct Expression * src2); +void +rpn_XOR(struct Expression * expr, struct Expression * src1, + struct Expression * src2); +void +rpn_OR(struct Expression * expr, struct Expression * src1, + struct Expression * src2); +void +rpn_AND(struct Expression * expr, struct Expression * src1, + struct Expression * src2); +void +rpn_SHL(struct Expression * expr, struct Expression * src1, + struct Expression * src2); +void +rpn_SHR(struct Expression * expr, struct Expression * src1, + struct Expression * src2); +void +rpn_MUL(struct Expression * expr, struct Expression * src1, + struct Expression * src2); +void +rpn_DIV(struct Expression * expr, struct Expression * src1, + struct Expression * src2); +void +rpn_MOD(struct Expression * expr, struct Expression * src1, + struct Expression * src2); +void rpn_UNNEG(struct Expression * expr, struct Expression * src); +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 +rpn_RangeCheck(struct Expression * expr, struct Expression * src, SLONG low, + SLONG high); #ifdef GAMEBOY -void rpn_CheckHRAM(struct Expression *expr, struct Expression *src1); +void rpn_CheckHRAM(struct Expression * expr, struct Expression * src1); #endif #ifdef PCENGINE -void rpn_CheckZP(struct Expression *expr, struct Expression *src); +void rpn_CheckZP(struct Expression * expr, struct Expression * src); #endif #endif diff --git a/include/asm/symbol.h b/include/asm/symbol.h index ad36cb63..e63aa196 100644 --- a/include/asm/symbol.h +++ b/include/asm/symbol.h @@ -15,19 +15,25 @@ struct sSymbol { struct Section *pSection; ULONG ulMacroSize; char *pMacro; - SLONG(*Callback) (struct sSymbol *); + SLONG(*Callback) (struct sSymbol *); }; - -#define SYMF_RELOC 0x001 /* symbol will be reloc'ed during linking, it's absolute value is unknown */ -#define SYMF_EQU 0x002 /* symbol is defined using EQU, will not be changed during linking */ -#define SYMF_SET 0x004 /* symbol is (re)defined using SET, will not be changed during linking */ +#define SYMF_RELOC 0x001 /* symbol will be reloc'ed during + * linking, it's absolute value is + * unknown */ +#define SYMF_EQU 0x002 /* symbol is defined using EQU, will + * not be changed during linking */ +#define SYMF_SET 0x004 /* symbol is (re)defined using SET, + * will not be changed during linking */ #define SYMF_EXPORT 0x008 /* symbol should be exported */ -#define SYMF_IMPORT 0x010 /* symbol is imported, it's value is unknown */ +#define SYMF_IMPORT 0x010 /* symbol is imported, it's value is + * unknown */ #define SYMF_LOCAL 0x020 /* symbol is a local symbol */ -#define SYMF_DEFINED 0x040 /* symbol has been defined, not only referenced */ +#define SYMF_DEFINED 0x040 /* symbol has been defined, not only + * referenced */ #define SYMF_MACRO 0x080 /* symbol is a macro */ #define SYMF_STRING 0x100 /* symbol is a stringsymbol */ -#define SYMF_CONST 0x200 /* symbol has a constant value, will not be changed during linking */ +#define SYMF_CONST 0x200 /* symbol has a constant value, will + * not be changed during linking */ void sym_PrepPass1(void); void sym_PrepPass2(void); diff --git a/include/link/assign.h b/include/link/assign.h index 9c9f8c79..3657ad23 100644 --- a/include/link/assign.h +++ b/include/link/assign.h @@ -9,7 +9,6 @@ enum eBankDefine { BANK_VRAM, BANK_HRAM }; - #define MAXBANKS 259 extern SLONG area_Avail(SLONG bank); diff --git a/include/link/mapfile.h b/include/link/mapfile.h index a677e25e..305f70fe 100644 --- a/include/link/mapfile.h +++ b/include/link/mapfile.h @@ -4,7 +4,7 @@ extern void SetMapfileName(char *name); extern void SetSymfileName(char *name); extern void CloseMapfile(void); -extern void MapfileWriteSection(struct sSection *pSect); +extern void MapfileWriteSection(struct sSection * pSect); extern void MapfileInitBank(SLONG bank); extern void MapfileCloseBank(SLONG slack);