shithub: rgbds

Download patch

ref: d8070a10ebf5ec6cd8fbafb04236f447f9c0b13b
parent: a014537837b5078593de740badc153e4472be309
author: anthony <[email protected]>
date: Wed Dec 30 07:59:36 EST 2009

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

--- a/include/asm/asm.h
+++ b/include/asm/asm.h
@@ -33,4 +33,4 @@
 #define MAXMACROARGS	9
 #define MAXINCPATHS		16
 
-#endif				//       ASM_H
+#endif	/* //       ASM_H */
--- a/include/asm/gameboy/localasm.h
+++ b/include/asm/gameboy/localasm.h
@@ -105,7 +105,6 @@
 	REG_HL_IND,
 	REG_A
 };
-
 /* "rr" defs */
 
 enum {
@@ -114,7 +113,6 @@
 	REG_HL_INDINC,
 	REG_HL_INDDEC,
 };
-
 /* "ss" defs */
 
 enum {
@@ -123,7 +121,6 @@
 	REG_HL,
 	REG_SP
 };
-
 /* "tt" defs */
 
 /*
--- a/include/asm/lexer.h
+++ b/include/asm/lexer.h
@@ -28,7 +28,6 @@
 	LEX_STATE_NORMAL,
 	LEX_STATE_MACROARGS
 };
-
 #define INITIAL			0
 #define macroarg		3
 
@@ -39,7 +38,7 @@
 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_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);
--- a/include/asm/main.h
+++ b/include/asm/main.h
@@ -5,7 +5,8 @@
 	ULONG endian;
 	char gbgfx[4];
 	char binary[2];
-	SLONG fillchar;		//      -1 == random
+	SLONG fillchar;
+	    //-1 == random
 };
 
 extern char *tzNewMacro;
--- a/include/asm/mylink.h
+++ b/include/asm/mylink.h
@@ -115,5 +115,4 @@
 	PATCH_WORD_B,
 	PATCH_LONG_B
 };
-
 #endif
--- a/include/asm/output.h
+++ b/include/asm/output.h
@@ -20,15 +20,15 @@
 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);
 
--- a/include/asm/rpn.h
+++ b/include/asm/rpn.h
@@ -10,59 +10,78 @@
 	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
--- a/include/asm/symbol.h
+++ b/include/asm/symbol.h
@@ -15,19 +15,25 @@
 	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);
--- a/include/link/assign.h
+++ b/include/link/assign.h
@@ -9,7 +9,6 @@
 	BANK_VRAM,
 	BANK_HRAM
 };
-
 #define MAXBANKS	259
 
 extern SLONG area_Avail(SLONG bank);
--- 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);