mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-24 12:02:08 +00:00
Replace ULONG by uint32_t
All affected `printf` have been fixed. Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
This commit is contained in:
@@ -14,24 +14,22 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "types.h"
|
||||
#include "asm/symbol.h"
|
||||
|
||||
#include "asm/localasm.h"
|
||||
#include "asm/symbol.h"
|
||||
|
||||
#define MAXUNIONS 128
|
||||
#define MAXMACROARGS 256
|
||||
#define MAXINCPATHS 128
|
||||
|
||||
extern int32_t nLineNo;
|
||||
extern ULONG nTotalLines;
|
||||
extern ULONG nPC;
|
||||
extern ULONG nPass;
|
||||
extern ULONG nIFDepth;
|
||||
extern uint32_t nTotalLines;
|
||||
extern uint32_t nPC;
|
||||
extern uint32_t nPass;
|
||||
extern uint32_t nIFDepth;
|
||||
extern bool skipElif;
|
||||
extern ULONG nUnionDepth;
|
||||
extern ULONG unionStart[MAXUNIONS];
|
||||
extern ULONG unionSize[MAXUNIONS];
|
||||
extern uint32_t nUnionDepth;
|
||||
extern uint32_t unionStart[MAXUNIONS];
|
||||
extern uint32_t unionSize[MAXUNIONS];
|
||||
extern char tzCurrentFileName[_MAX_PATH + 1];
|
||||
extern struct Section *pCurrentSection;
|
||||
extern struct sSymbol *tHashedSymbols[HASHSIZE];
|
||||
|
||||
@@ -13,9 +13,10 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include "asm/asm.h"
|
||||
#include "types.h"
|
||||
#include "asm/lexer.h"
|
||||
|
||||
#include "types.h"
|
||||
|
||||
struct sContext {
|
||||
YY_BUFFER_STATE FlexHandle;
|
||||
struct sSymbol *pMacro;
|
||||
@@ -23,11 +24,11 @@ struct sContext {
|
||||
char tzFileName[_MAX_PATH + 1];
|
||||
char *tzMacroArgs[MAXMACROARGS + 1];
|
||||
int32_t nLine;
|
||||
ULONG nStatus;
|
||||
uint32_t nStatus;
|
||||
FILE *pFile;
|
||||
char *pREPTBlock;
|
||||
ULONG nREPTBlockCount;
|
||||
ULONG nREPTBlockSize;
|
||||
uint32_t nREPTBlockCount;
|
||||
uint32_t nREPTBlockSize;
|
||||
};
|
||||
|
||||
void
|
||||
@@ -37,8 +38,8 @@ void
|
||||
fstk_Init(char *);
|
||||
extern void fstk_Dump(void);
|
||||
extern void fstk_AddIncludePath(char *s);
|
||||
extern ULONG fstk_RunMacro(char *s);
|
||||
extern void fstk_RunRept(ULONG count);
|
||||
extern uint32_t fstk_RunMacro(char *s);
|
||||
extern void fstk_RunRept(uint32_t count);
|
||||
FILE *
|
||||
fstk_FindFile(char *);
|
||||
|
||||
|
||||
@@ -4,19 +4,17 @@
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#define LEXHASHSIZE (1 << 11)
|
||||
#define MAXSTRLEN 255
|
||||
|
||||
struct sLexInitString {
|
||||
char *tzName;
|
||||
ULONG nToken;
|
||||
uint32_t nToken;
|
||||
};
|
||||
|
||||
struct sLexFloat {
|
||||
ULONG(*Callback) (char *s, ULONG size);
|
||||
ULONG nToken;
|
||||
uint32_t(*Callback) (char *s, uint32_t size);
|
||||
uint32_t nToken;
|
||||
};
|
||||
|
||||
struct yy_buffer_state {
|
||||
@@ -24,8 +22,8 @@ struct yy_buffer_state {
|
||||
char *pBufferStart; // address where the data is initially written
|
||||
// after the "safety margin"
|
||||
char *pBuffer;
|
||||
ULONG nBufferSize;
|
||||
ULONG oAtLineStart;
|
||||
uint32_t nBufferSize;
|
||||
uint32_t oAtLineStart;
|
||||
};
|
||||
|
||||
enum eLexerState {
|
||||
@@ -39,24 +37,24 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
|
||||
|
||||
extern void yy_set_state(enum eLexerState i);
|
||||
extern YY_BUFFER_STATE yy_create_buffer(FILE * f);
|
||||
extern YY_BUFFER_STATE yy_scan_bytes(char *mem, ULONG size);
|
||||
extern YY_BUFFER_STATE yy_scan_bytes(char *mem, uint32_t 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 void lex_FloatAddRange(ULONG id, uint16_t start, uint16_t end);
|
||||
extern void lex_FloatDeleteRange(ULONG id, uint16_t start, uint16_t end);
|
||||
extern void lex_FloatAddFirstRange(ULONG id, uint16_t start, uint16_t end);
|
||||
extern void lex_FloatDeleteFirstRange(ULONG id, uint16_t start, uint16_t end);
|
||||
extern void lex_FloatAddSecondRange(ULONG id, uint16_t start, uint16_t end);
|
||||
extern void lex_FloatDeleteSecondRange(ULONG id, uint16_t start, uint16_t end);
|
||||
extern uint32_t lex_FloatAlloc(struct sLexFloat * tok);
|
||||
extern void lex_FloatAddRange(uint32_t id, uint16_t start, uint16_t end);
|
||||
extern void lex_FloatDeleteRange(uint32_t id, uint16_t start, uint16_t end);
|
||||
extern void lex_FloatAddFirstRange(uint32_t id, uint16_t start, uint16_t end);
|
||||
extern void lex_FloatDeleteFirstRange(uint32_t id, uint16_t start, uint16_t end);
|
||||
extern void lex_FloatAddSecondRange(uint32_t id, uint16_t start, uint16_t end);
|
||||
extern void lex_FloatDeleteSecondRange(uint32_t id, uint16_t start, uint16_t end);
|
||||
extern void lex_Init(void);
|
||||
extern void lex_AddStrings(struct sLexInitString * lex);
|
||||
extern void lex_SetBuffer(char *buffer, ULONG len);
|
||||
extern ULONG yylex(void);
|
||||
extern void lex_SetBuffer(char *buffer, uint32_t len);
|
||||
extern uint32_t yylex(void);
|
||||
extern void yyunput(char c);
|
||||
extern void yyunputstr(char *s);
|
||||
extern void yyskipbytes(ULONG count);
|
||||
extern void yyunputbytes(ULONG count);
|
||||
extern void yyskipbytes(uint32_t count);
|
||||
extern void yyunputbytes(uint32_t count);
|
||||
|
||||
extern YY_BUFFER_STATE pCurrentBuffer;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ struct sOptions {
|
||||
};
|
||||
|
||||
extern char *tzNewMacro;
|
||||
extern ULONG ulNewMacroSize;
|
||||
extern uint32_t ulNewMacroSize;
|
||||
extern int32_t nGBGfxID;
|
||||
extern int32_t nBinaryID;
|
||||
|
||||
|
||||
@@ -4,15 +4,14 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include "asm/rpn.h"
|
||||
#include "types.h"
|
||||
|
||||
struct Section {
|
||||
char *pzName;
|
||||
uint8_t nType;
|
||||
ULONG nPC;
|
||||
ULONG nOrg;
|
||||
ULONG nBank;
|
||||
ULONG nAlign;
|
||||
uint32_t nPC;
|
||||
uint32_t nOrg;
|
||||
uint32_t nBank;
|
||||
uint32_t nAlign;
|
||||
struct Section *pNext;
|
||||
struct Patch *pPatches;
|
||||
struct Charmap *charmap;
|
||||
@@ -21,9 +20,9 @@ struct Section {
|
||||
|
||||
void out_PrepPass2(void);
|
||||
void out_SetFileName(char *s);
|
||||
void out_NewSection(char *pzName, ULONG secttype);
|
||||
void out_NewAbsSection(char *pzName, ULONG secttype, int32_t org, int32_t bank);
|
||||
void out_NewAlignedSection(char *pzName, ULONG secttype, int32_t alignment, int32_t bank);
|
||||
void out_NewSection(char *pzName, uint32_t secttype);
|
||||
void out_NewAbsSection(char *pzName, uint32_t secttype, int32_t org, int32_t bank);
|
||||
void out_NewAlignedSection(char *pzName, uint32_t secttype, int32_t alignment, int32_t bank);
|
||||
void out_AbsByte(int b);
|
||||
void out_AbsByteGroup(char *s, int length);
|
||||
void out_RelByte(struct Expression * expr);
|
||||
|
||||
@@ -4,18 +4,18 @@
|
||||
#include <stdint.h>
|
||||
|
||||
struct Expression {
|
||||
int32_t nVal;
|
||||
uint8_t tRPN[256];
|
||||
ULONG nRPNLength;
|
||||
ULONG nRPNOut;
|
||||
ULONG isReloc;
|
||||
ULONG isPCRel;
|
||||
int32_t nVal;
|
||||
uint8_t tRPN[256];
|
||||
uint32_t nRPNLength;
|
||||
uint32_t nRPNOut;
|
||||
uint32_t isReloc;
|
||||
uint32_t isPCRel;
|
||||
};
|
||||
|
||||
ULONG rpn_isReloc(struct Expression * expr);
|
||||
ULONG rpn_isPCRelative(struct Expression * expr);
|
||||
uint32_t rpn_isReloc(struct Expression * expr);
|
||||
uint32_t rpn_isPCRelative(struct Expression * expr);
|
||||
void rpn_Symbol(struct Expression * expr, char *tzSym);
|
||||
void rpn_Number(struct Expression * expr, ULONG i);
|
||||
void rpn_Number(struct Expression * expr, uint32_t i);
|
||||
void rpn_LOGNOT(struct Expression * expr, struct Expression * src1);
|
||||
void
|
||||
rpn_LOGOR(struct Expression * expr, struct Expression * src1,
|
||||
|
||||
@@ -11,15 +11,15 @@
|
||||
struct sSymbol {
|
||||
char tzName[MAXSYMLEN + 1];
|
||||
int32_t nValue;
|
||||
ULONG nType;
|
||||
uint32_t nType;
|
||||
struct sSymbol *pScope;
|
||||
struct sSymbol *pNext;
|
||||
struct Section *pSection;
|
||||
ULONG ulMacroSize;
|
||||
uint32_t ulMacroSize;
|
||||
char *pMacro;
|
||||
int32_t(*Callback) (struct sSymbol *);
|
||||
char tzFileName[_MAX_PATH + 1]; /* File where the symbol was defined. */
|
||||
ULONG nFileLine; /* Line where the symbol was defined. */
|
||||
uint32_t nFileLine; /* Line where the symbol was defined. */
|
||||
};
|
||||
#define SYMF_RELOC 0x001 /* symbol will be reloc'ed during
|
||||
* linking, it's absolute value is
|
||||
@@ -39,7 +39,7 @@ struct sSymbol {
|
||||
#define SYMF_CONST 0x200 /* symbol has a constant value, will
|
||||
* not be changed during linking */
|
||||
|
||||
ULONG calchash(char *s);
|
||||
uint32_t calchash(char *s);
|
||||
void sym_SetExportAll(uint8_t set);
|
||||
void sym_PrepPass1(void);
|
||||
void sym_PrepPass2(void);
|
||||
@@ -57,23 +57,23 @@ void sym_FreeCurrentMacroArgs(void);
|
||||
void sym_AddEqu(char *tzSym, int32_t value);
|
||||
void sym_AddSet(char *tzSym, int32_t value);
|
||||
void sym_Init(void);
|
||||
ULONG sym_GetConstantValue(char *s);
|
||||
ULONG sym_isConstant(char *s);
|
||||
uint32_t sym_GetConstantValue(char *s);
|
||||
uint32_t sym_isConstant(char *s);
|
||||
struct sSymbol *sym_FindSymbol(char *tzName);
|
||||
void sym_Global(char *tzSym);
|
||||
char *sym_FindMacroArg(int32_t i);
|
||||
char *sym_GetStringValue(char *tzSym);
|
||||
void sym_UseCurrentMacroArgs(void);
|
||||
void sym_SetMacroArgID(ULONG nMacroCount);
|
||||
ULONG sym_isString(char *tzSym);
|
||||
void sym_SetMacroArgID(uint32_t nMacroCount);
|
||||
uint32_t sym_isString(char *tzSym);
|
||||
void sym_AddMacro(char *tzSym);
|
||||
void sym_ShiftCurrentMacroArgs(void);
|
||||
void sym_AddString(char *tzSym, char *tzValue);
|
||||
ULONG sym_GetValue(char *s);
|
||||
ULONG sym_GetDefinedValue(char *s);
|
||||
ULONG sym_isDefined(char *tzName);
|
||||
uint32_t sym_GetValue(char *s);
|
||||
uint32_t sym_GetDefinedValue(char *s);
|
||||
uint32_t sym_isDefined(char *tzName);
|
||||
void sym_Purge(char *tzName);
|
||||
ULONG sym_isConstDefined(char *tzName);
|
||||
uint32_t sym_isConstDefined(char *tzName);
|
||||
int sym_IsRelocDiffDefined(char *tzSym1, char *tzSym2);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user