mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Move externs to header files
Follow Linux kernel coding style. Remove exception from checkpatch.pl configuration file. Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
This commit is contained in:
@@ -19,9 +19,6 @@
|
|||||||
# List of ignored rules
|
# List of ignored rules
|
||||||
# ---------------------
|
# ---------------------
|
||||||
|
|
||||||
# Allow the usage of 'extern' in .c files
|
|
||||||
--ignore AVOID_EXTERNS
|
|
||||||
|
|
||||||
# There's no BIT macro
|
# There's no BIT macro
|
||||||
--ignore BIT_MACRO
|
--ignore BIT_MACRO
|
||||||
|
|
||||||
|
|||||||
@@ -36,4 +36,6 @@ extern struct sSymbol *tHashedSymbols[HASHSIZE];
|
|||||||
extern struct sSymbol *pPCSymbol;
|
extern struct sSymbol *pPCSymbol;
|
||||||
extern bool oDontExpandStrings;
|
extern bool oDontExpandStrings;
|
||||||
|
|
||||||
|
size_t symvaluetostring(char *dest, size_t maxLength, char *sym);
|
||||||
|
|
||||||
#endif /* RGBDS_ASM_ASM_H */
|
#endif /* RGBDS_ASM_ASM_H */
|
||||||
|
|||||||
@@ -41,6 +41,4 @@ void fstk_RunRept(uint32_t count);
|
|||||||
FILE *fstk_FindFile(char *fname);
|
FILE *fstk_FindFile(char *fname);
|
||||||
int32_t fstk_GetLine(void);
|
int32_t fstk_GetLine(void);
|
||||||
|
|
||||||
extern int yywrap(void);
|
|
||||||
|
|
||||||
#endif /* RGBDS_ASM_FSTACK_H */
|
#endif /* RGBDS_ASM_FSTACK_H */
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ enum eLexerState {
|
|||||||
|
|
||||||
typedef struct yy_buffer_state *YY_BUFFER_STATE;
|
typedef struct yy_buffer_state *YY_BUFFER_STATE;
|
||||||
|
|
||||||
|
void setup_lexer(void);
|
||||||
|
|
||||||
void yy_set_state(enum eLexerState i);
|
void yy_set_state(enum eLexerState i);
|
||||||
YY_BUFFER_STATE yy_create_buffer(FILE *f);
|
YY_BUFFER_STATE yy_create_buffer(FILE *f);
|
||||||
YY_BUFFER_STATE yy_scan_bytes(char *mem, uint32_t size);
|
YY_BUFFER_STATE yy_scan_bytes(char *mem, uint32_t size);
|
||||||
@@ -52,6 +54,7 @@ void lex_FloatDeleteSecondRange(uint32_t id, uint16_t start, uint16_t end);
|
|||||||
void lex_Init(void);
|
void lex_Init(void);
|
||||||
void lex_AddStrings(const struct sLexInitString *lex);
|
void lex_AddStrings(const struct sLexInitString *lex);
|
||||||
void lex_SetBuffer(char *buffer, uint32_t len);
|
void lex_SetBuffer(char *buffer, uint32_t len);
|
||||||
|
int yywrap(void);
|
||||||
uint32_t yylex(void);
|
uint32_t yylex(void);
|
||||||
void yyunput(char c);
|
void yyunput(char c);
|
||||||
void yyunputstr(char *s);
|
void yyunputstr(char *s);
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ extern int32_t nBinaryID;
|
|||||||
extern struct sOptions DefaultOptions;
|
extern struct sOptions DefaultOptions;
|
||||||
extern struct sOptions CurrentOptions;
|
extern struct sOptions CurrentOptions;
|
||||||
|
|
||||||
|
extern FILE *dependfile;
|
||||||
|
|
||||||
void opt_Push(void);
|
void opt_Push(void);
|
||||||
void opt_Pop(void);
|
void opt_Pop(void);
|
||||||
void opt_Parse(char *s);
|
void opt_Parse(char *s);
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ struct Section {
|
|||||||
uint8_t *tData;
|
uint8_t *tData;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extern char *tzObjectname;
|
||||||
|
|
||||||
void out_PrepPass2(void);
|
void out_PrepPass2(void);
|
||||||
void out_SetFileName(char *s);
|
void out_SetFileName(char *s);
|
||||||
void out_NewSection(char *pzName, uint32_t secttype);
|
void out_NewSection(char *pzName, uint32_t secttype);
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
#include "asm/fstack.h"
|
#include "asm/fstack.h"
|
||||||
#include "asm/lexer.h"
|
#include "asm/lexer.h"
|
||||||
#include "asm/main.h"
|
#include "asm/main.h"
|
||||||
|
#include "asm/output.h"
|
||||||
#include "asm/symbol.h"
|
#include "asm/symbol.h"
|
||||||
|
|
||||||
#include "extern/err.h"
|
#include "extern/err.h"
|
||||||
@@ -35,9 +36,6 @@ static uint32_t nCurrentREPTBlockCount;
|
|||||||
|
|
||||||
uint32_t ulMacroReturnValue;
|
uint32_t ulMacroReturnValue;
|
||||||
|
|
||||||
extern char *tzObjectname;
|
|
||||||
extern FILE *dependfile;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* defines for nCurrentStatus
|
* defines for nCurrentStatus
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -460,8 +460,7 @@ const struct sLexFloat tMacroUniqueToken = {
|
|||||||
T_LEX_MACROUNIQUE
|
T_LEX_MACROUNIQUE
|
||||||
};
|
};
|
||||||
|
|
||||||
void
|
void setup_lexer(void)
|
||||||
setuplex(void)
|
|
||||||
{
|
{
|
||||||
uint32_t id;
|
uint32_t id;
|
||||||
|
|
||||||
|
|||||||
@@ -28,8 +28,6 @@ struct sLexString {
|
|||||||
|
|
||||||
#define SAFETYMARGIN 1024
|
#define SAFETYMARGIN 1024
|
||||||
|
|
||||||
extern size_t symvaluetostring(char *dest, size_t maxLength, char *sym);
|
|
||||||
|
|
||||||
struct sLexFloat tLexFloat[32];
|
struct sLexFloat tLexFloat[32];
|
||||||
struct sLexString *tLexHash[LEXHASHSIZE];
|
struct sLexString *tLexHash[LEXHASHSIZE];
|
||||||
YY_BUFFER_STATE pCurrentBuffer;
|
YY_BUFFER_STATE pCurrentBuffer;
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
#include "asm/symbol.h"
|
#include "asm/symbol.h"
|
||||||
#include "asm/fstack.h"
|
#include "asm/fstack.h"
|
||||||
|
#include "asm/lexer.h"
|
||||||
#include "asm/output.h"
|
#include "asm/output.h"
|
||||||
#include "asm/main.h"
|
#include "asm/main.h"
|
||||||
|
|
||||||
@@ -16,8 +17,7 @@
|
|||||||
#include "extern/reallocarray.h"
|
#include "extern/reallocarray.h"
|
||||||
#include "extern/version.h"
|
#include "extern/version.h"
|
||||||
|
|
||||||
int yyparse(void);
|
extern int yyparse(void);
|
||||||
void setuplex(void);
|
|
||||||
|
|
||||||
int32_t cldefines_index;
|
int32_t cldefines_index;
|
||||||
int32_t cldefines_size;
|
int32_t cldefines_size;
|
||||||
@@ -32,7 +32,6 @@ uint32_t unionStart[128], unionSize[128];
|
|||||||
/* extern int yydebug; */
|
/* extern int yydebug; */
|
||||||
|
|
||||||
FILE *dependfile;
|
FILE *dependfile;
|
||||||
extern char *tzObjectname;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Option stack
|
* Option stack
|
||||||
@@ -384,7 +383,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
tzMainfile = argv[argc - 1];
|
tzMainfile = argv[argc - 1];
|
||||||
|
|
||||||
setuplex();
|
setup_lexer();
|
||||||
|
|
||||||
if (CurrentOptions.verbose)
|
if (CurrentOptions.verbose)
|
||||||
printf("Assembling %s\n", tzMainfile);
|
printf("Assembling %s\n", tzMainfile);
|
||||||
|
|||||||
Reference in New Issue
Block a user