Merge pull request #457 from pfusik/const-arrays
Make some arrays const.
This commit is contained in:
commit
26a2d8a5c6
18 changed files with 90 additions and 90 deletions
|
@ -53,11 +53,11 @@
|
||||||
size_t __fastcall__ strftime (char* buf, size_t bufsize, const char* format,
|
size_t __fastcall__ strftime (char* buf, size_t bufsize, const char* format,
|
||||||
const struct tm* tm)
|
const struct tm* tm)
|
||||||
{
|
{
|
||||||
static const char* days[7] = {
|
static const char* const days[7] = {
|
||||||
"Sunday", "Monday", "Tuesday", "Wednesday",
|
"Sunday", "Monday", "Tuesday", "Wednesday",
|
||||||
"Thursday", "Friday", "Saturday"
|
"Thursday", "Friday", "Saturday"
|
||||||
};
|
};
|
||||||
static const char* months[12] = {
|
static const char* const months[12] = {
|
||||||
"January", "February", "March", "April", "May", "June",
|
"January", "February", "March", "April", "May", "June",
|
||||||
"July", "August", "September", "October", "November", "December"
|
"July", "August", "September", "October", "November", "December"
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
;
|
;
|
||||||
; Ullrich von Bassewitz, 06.08.1998
|
; Ullrich von Bassewitz, 06.08.1998
|
||||||
;
|
;
|
||||||
; void cputsxy (unsigned char x, unsigned char y, char* s);
|
; void cputsxy (unsigned char x, unsigned char y, const char* s);
|
||||||
; void cputs (char* s);
|
; void cputs (const char* s);
|
||||||
;
|
;
|
||||||
|
|
||||||
.export _cputsxy, _cputs
|
.export _cputsxy, _cputs
|
||||||
|
|
|
@ -32,7 +32,7 @@ static char DumpHandler (void);
|
||||||
static char HelpHandler (void);
|
static char HelpHandler (void);
|
||||||
|
|
||||||
/* Forwards for other functions */
|
/* Forwards for other functions */
|
||||||
static void DisplayPrompt (char* s);
|
static void DisplayPrompt (const char* s);
|
||||||
static void SingleStep (char StepInto);
|
static void SingleStep (char StepInto);
|
||||||
static void RedrawStatic (char Frame);
|
static void RedrawStatic (char Frame);
|
||||||
static void Redraw (char Frame);
|
static void Redraw (char Frame);
|
||||||
|
@ -166,7 +166,7 @@ extern unsigned DbgHI; /* High 16 bit of primary reg */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
unsigned char x;
|
unsigned char x;
|
||||||
unsigned char y;
|
unsigned char y;
|
||||||
char* text;
|
const char* text;
|
||||||
} TextDesc;
|
} TextDesc;
|
||||||
|
|
||||||
/* Window descriptor */
|
/* Window descriptor */
|
||||||
|
@ -181,13 +181,13 @@ typedef struct {
|
||||||
unsigned char fd_visible; /* Is the window currently visible? */
|
unsigned char fd_visible; /* Is the window currently visible? */
|
||||||
char (*fd_func) (void); /* Handler function */
|
char (*fd_func) (void); /* Handler function */
|
||||||
unsigned char fd_textcount; /* Number of text lines to print */
|
unsigned char fd_textcount; /* Number of text lines to print */
|
||||||
TextDesc* fd_text; /* Static text in the window */
|
const TextDesc* fd_text; /* Static text in the window */
|
||||||
} FrameDesc;
|
} FrameDesc;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Texts for the windows */
|
/* Texts for the windows */
|
||||||
static TextDesc RegText [] = {
|
static const TextDesc RegText [] = {
|
||||||
{ 1, 0, "PC" },
|
{ 1, 0, "PC" },
|
||||||
{ 1, 1, "SR" },
|
{ 1, 1, "SR" },
|
||||||
{ 1, 2, "A" },
|
{ 1, 2, "A" },
|
||||||
|
@ -197,7 +197,7 @@ static TextDesc RegText [] = {
|
||||||
{ 1, 6, "CS" },
|
{ 1, 6, "CS" },
|
||||||
{ 1, 7, "HI" }
|
{ 1, 7, "HI" }
|
||||||
};
|
};
|
||||||
static TextDesc HelpText [] = {
|
static const TextDesc HelpText [] = {
|
||||||
{ 1, 0, "F1, ? Help" },
|
{ 1, 0, "F1, ? Help" },
|
||||||
{ 1, 1, "F2, t Toggle breakpoint" },
|
{ 1, 1, "F2, t Toggle breakpoint" },
|
||||||
{ 1, 2, "F3, u Run until subroutine returns" },
|
{ 1, 2, "F3, u Run until subroutine returns" },
|
||||||
|
@ -220,7 +220,7 @@ static TextDesc HelpText [] = {
|
||||||
|
|
||||||
|
|
||||||
/* Window data */
|
/* Window data */
|
||||||
static FrameDesc AsmFrame = {
|
static const FrameDesc AsmFrame = {
|
||||||
CH_ULCORNER, CH_TTEE, CH_LTEE, CH_CROSS,
|
CH_ULCORNER, CH_TTEE, CH_LTEE, CH_CROSS,
|
||||||
0, 0, MAX_X - 10, 15,
|
0, 0, MAX_X - 10, 15,
|
||||||
MAX_X - 11, 14,
|
MAX_X - 11, 14,
|
||||||
|
@ -228,7 +228,7 @@ static FrameDesc AsmFrame = {
|
||||||
AsmHandler,
|
AsmHandler,
|
||||||
0, 0
|
0, 0
|
||||||
};
|
};
|
||||||
static FrameDesc RegFrame = {
|
static const FrameDesc RegFrame = {
|
||||||
CH_TTEE, CH_URCORNER, CH_LTEE, CH_RTEE,
|
CH_TTEE, CH_URCORNER, CH_LTEE, CH_RTEE,
|
||||||
MAX_X - 10, 0, MAX_X - 1, 9,
|
MAX_X - 10, 0, MAX_X - 1, 9,
|
||||||
8, 8,
|
8, 8,
|
||||||
|
@ -236,7 +236,7 @@ static FrameDesc RegFrame = {
|
||||||
RegHandler,
|
RegHandler,
|
||||||
sizeof (RegText) / sizeof (RegText [0]), RegText
|
sizeof (RegText) / sizeof (RegText [0]), RegText
|
||||||
};
|
};
|
||||||
static FrameDesc StackFrame = {
|
static const FrameDesc StackFrame = {
|
||||||
CH_LTEE, CH_RTEE, CH_CROSS, CH_RTEE,
|
CH_LTEE, CH_RTEE, CH_CROSS, CH_RTEE,
|
||||||
MAX_X - 10, 9, MAX_X - 1, 15,
|
MAX_X - 10, 9, MAX_X - 1, 15,
|
||||||
8, 5,
|
8, 5,
|
||||||
|
@ -244,7 +244,7 @@ static FrameDesc StackFrame = {
|
||||||
StackHandler,
|
StackHandler,
|
||||||
0, 0
|
0, 0
|
||||||
};
|
};
|
||||||
static FrameDesc CStackFrame = {
|
static const FrameDesc CStackFrame = {
|
||||||
CH_CROSS, CH_RTEE, CH_BTEE, CH_LRCORNER,
|
CH_CROSS, CH_RTEE, CH_BTEE, CH_LRCORNER,
|
||||||
MAX_X - 10, 15, MAX_X - 1, MAX_Y - 1,
|
MAX_X - 10, 15, MAX_X - 1, MAX_Y - 1,
|
||||||
8, MAX_Y - 17,
|
8, MAX_Y - 17,
|
||||||
|
@ -252,7 +252,7 @@ static FrameDesc CStackFrame = {
|
||||||
CStackHandler,
|
CStackHandler,
|
||||||
0, 0
|
0, 0
|
||||||
};
|
};
|
||||||
static FrameDesc DumpFrame = {
|
static const FrameDesc DumpFrame = {
|
||||||
CH_LTEE, CH_CROSS, CH_LLCORNER, CH_BTEE,
|
CH_LTEE, CH_CROSS, CH_LLCORNER, CH_BTEE,
|
||||||
0, 15, MAX_X - 10, MAX_Y-1,
|
0, 15, MAX_X - 10, MAX_Y-1,
|
||||||
MAX_X - 11, MAX_Y - 17,
|
MAX_X - 11, MAX_Y - 17,
|
||||||
|
@ -260,7 +260,7 @@ static FrameDesc DumpFrame = {
|
||||||
DumpHandler,
|
DumpHandler,
|
||||||
0, 0
|
0, 0
|
||||||
};
|
};
|
||||||
static FrameDesc HelpFrame = {
|
static const FrameDesc HelpFrame = {
|
||||||
CH_ULCORNER, CH_URCORNER, CH_LLCORNER, CH_LRCORNER,
|
CH_ULCORNER, CH_URCORNER, CH_LLCORNER, CH_LRCORNER,
|
||||||
0, 0, MAX_X - 1, MAX_Y-1,
|
0, 0, MAX_X - 1, MAX_Y-1,
|
||||||
MAX_X - 2, MAX_Y - 2,
|
MAX_X - 2, MAX_Y - 2,
|
||||||
|
@ -268,7 +268,7 @@ static FrameDesc HelpFrame = {
|
||||||
HelpHandler,
|
HelpHandler,
|
||||||
sizeof (HelpText) / sizeof (HelpText [0]), HelpText
|
sizeof (HelpText) / sizeof (HelpText [0]), HelpText
|
||||||
};
|
};
|
||||||
static FrameDesc* Frames [] = {
|
static const FrameDesc* const Frames [] = {
|
||||||
&AsmFrame,
|
&AsmFrame,
|
||||||
&RegFrame,
|
&RegFrame,
|
||||||
&StackFrame,
|
&StackFrame,
|
||||||
|
@ -297,7 +297,7 @@ static unsigned char StackAddr; /* Start address of output */
|
||||||
|
|
||||||
|
|
||||||
/* Prompt line data */
|
/* Prompt line data */
|
||||||
static char* ActivePrompt = 0; /* Last prompt line displayed */
|
static const char* ActivePrompt = 0; /* Last prompt line displayed */
|
||||||
static char PromptColor; /* Color behind prompt */
|
static char PromptColor; /* Color behind prompt */
|
||||||
static char PromptLength; /* Length of current prompt string */
|
static char PromptLength; /* Length of current prompt string */
|
||||||
|
|
||||||
|
@ -346,10 +346,10 @@ BreakPoint* DbgIsBreak (unsigned Addr);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void DrawFrame (register FrameDesc* F, char Active)
|
static void DrawFrame (register const FrameDesc* F, char Active)
|
||||||
/* Draw one window frame */
|
/* Draw one window frame */
|
||||||
{
|
{
|
||||||
TextDesc* T;
|
const TextDesc* T;
|
||||||
unsigned char Count;
|
unsigned char Count;
|
||||||
unsigned char tl, tr, bl, br;
|
unsigned char tl, tr, bl, br;
|
||||||
unsigned char x1, y1, width;
|
unsigned char x1, y1, width;
|
||||||
|
@ -410,7 +410,7 @@ static void DrawFrames (void)
|
||||||
/* Draw all frames */
|
/* Draw all frames */
|
||||||
{
|
{
|
||||||
unsigned char I;
|
unsigned char I;
|
||||||
FrameDesc* F;
|
const FrameDesc* F;
|
||||||
|
|
||||||
/* Build the frame layout of the screen */
|
/* Build the frame layout of the screen */
|
||||||
for (I = 0; I < sizeof (Frames) / sizeof (Frames [0]); ++I) {
|
for (I = 0; I < sizeof (Frames) / sizeof (Frames [0]); ++I) {
|
||||||
|
@ -427,7 +427,7 @@ static void ActivateFrame (int Num, unsigned char Clear)
|
||||||
/* Activate a new frame, deactivate the old one */
|
/* Activate a new frame, deactivate the old one */
|
||||||
{
|
{
|
||||||
unsigned char y;
|
unsigned char y;
|
||||||
register FrameDesc* F;
|
register const FrameDesc* F;
|
||||||
|
|
||||||
if (ActiveFrame != Num) {
|
if (ActiveFrame != Num) {
|
||||||
|
|
||||||
|
@ -462,7 +462,7 @@ static void ActivateFrame (int Num, unsigned char Clear)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void DisplayPrompt (char* s)
|
static void DisplayPrompt (const char* s)
|
||||||
/* Display a prompt */
|
/* Display a prompt */
|
||||||
{
|
{
|
||||||
unsigned char OldColor;
|
unsigned char OldColor;
|
||||||
|
@ -626,11 +626,11 @@ static char InputHex (char* Prompt, unsigned* Val)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void ErrorPrompt (char* Msg)
|
static void ErrorPrompt (const char* Msg)
|
||||||
/* Display an error message and wait for a key */
|
/* Display an error message and wait for a key */
|
||||||
{
|
{
|
||||||
/* Save the current prompt */
|
/* Save the current prompt */
|
||||||
char* OldPrompt = ActivePrompt;
|
const char* OldPrompt = ActivePrompt;
|
||||||
|
|
||||||
/* Display the new one */
|
/* Display the new one */
|
||||||
DisplayPrompt (Msg);
|
DisplayPrompt (Msg);
|
||||||
|
|
|
@ -10,21 +10,21 @@
|
||||||
|
|
||||||
void _mbprintout(void);
|
void _mbprintout(void);
|
||||||
|
|
||||||
static dlgBoxStr _mbdlg_EMPTY = {
|
static const dlgBoxStr _mbdlg_EMPTY = {
|
||||||
DB_DEFPOS(1),
|
DB_DEFPOS(1),
|
||||||
DB_OPVEC(&RstrFrmDialogue),
|
DB_OPVEC(&RstrFrmDialogue),
|
||||||
DB_USRROUT(&_mbprintout),
|
DB_USRROUT(&_mbprintout),
|
||||||
DB_END,
|
DB_END,
|
||||||
};
|
};
|
||||||
|
|
||||||
static dlgBoxStr _mbdlg_OK = {
|
static const dlgBoxStr _mbdlg_OK = {
|
||||||
DB_DEFPOS(1),
|
DB_DEFPOS(1),
|
||||||
DB_USRROUT(&_mbprintout),
|
DB_USRROUT(&_mbprintout),
|
||||||
DB_ICON(OK, DBI_X_1, DBI_Y_2),
|
DB_ICON(OK, DBI_X_1, DBI_Y_2),
|
||||||
DB_END,
|
DB_END,
|
||||||
};
|
};
|
||||||
|
|
||||||
static dlgBoxStr _mbdlg_OKCANCEL = {
|
static const dlgBoxStr _mbdlg_OKCANCEL = {
|
||||||
DB_DEFPOS(1),
|
DB_DEFPOS(1),
|
||||||
DB_USRROUT(&_mbprintout),
|
DB_USRROUT(&_mbprintout),
|
||||||
DB_ICON(OK, DBI_X_0, DBI_Y_2),
|
DB_ICON(OK, DBI_X_0, DBI_Y_2),
|
||||||
|
@ -32,7 +32,7 @@ static dlgBoxStr _mbdlg_OKCANCEL = {
|
||||||
DB_END,
|
DB_END,
|
||||||
};
|
};
|
||||||
|
|
||||||
static dlgBoxStr _mbdlg_YESNO = {
|
static const dlgBoxStr _mbdlg_YESNO = {
|
||||||
DB_DEFPOS(1),
|
DB_DEFPOS(1),
|
||||||
DB_USRROUT(&_mbprintout),
|
DB_USRROUT(&_mbprintout),
|
||||||
DB_ICON(YES, DBI_X_0, DBI_Y_2),
|
DB_ICON(YES, DBI_X_0, DBI_Y_2),
|
||||||
|
@ -40,7 +40,7 @@ static dlgBoxStr _mbdlg_YESNO = {
|
||||||
DB_END,
|
DB_END,
|
||||||
};
|
};
|
||||||
|
|
||||||
static dlgBoxStr *_mbboxes[] = {
|
static const dlgBoxStr * const _mbboxes[] = {
|
||||||
&_mbdlg_EMPTY,
|
&_mbdlg_EMPTY,
|
||||||
&_mbdlg_OK,
|
&_mbdlg_OK,
|
||||||
&_mbdlg_OKCANCEL,
|
&_mbdlg_OKCANCEL,
|
||||||
|
|
|
@ -211,7 +211,7 @@ void DbgInfoFile (void)
|
||||||
void DbgInfoFunc (void)
|
void DbgInfoFunc (void)
|
||||||
/* Parse and handle func subcommand of the .dbg pseudo instruction */
|
/* Parse and handle func subcommand of the .dbg pseudo instruction */
|
||||||
{
|
{
|
||||||
static const char* StorageKeys[] = {
|
static const char* const StorageKeys[] = {
|
||||||
"EXTERN",
|
"EXTERN",
|
||||||
"STATIC",
|
"STATIC",
|
||||||
};
|
};
|
||||||
|
@ -352,7 +352,7 @@ void DbgInfoLine (void)
|
||||||
void DbgInfoSym (void)
|
void DbgInfoSym (void)
|
||||||
/* Parse and handle SYM subcommand of the .dbg pseudo instruction */
|
/* Parse and handle SYM subcommand of the .dbg pseudo instruction */
|
||||||
{
|
{
|
||||||
static const char* StorageKeys[] = {
|
static const char* const StorageKeys[] = {
|
||||||
"AUTO",
|
"AUTO",
|
||||||
"EXTERN",
|
"EXTERN",
|
||||||
"REGISTER",
|
"REGISTER",
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
|
|
||||||
|
|
||||||
/* Names of the features */
|
/* Names of the features */
|
||||||
static const char* FeatureKeys[FEAT_COUNT] = {
|
static const char* const FeatureKeys[FEAT_COUNT] = {
|
||||||
"dollar_is_pc",
|
"dollar_is_pc",
|
||||||
"labels_without_colons",
|
"labels_without_colons",
|
||||||
"loose_string_term",
|
"loose_string_term",
|
||||||
|
|
|
@ -151,7 +151,7 @@ static unsigned char OptionalAddrSize (void)
|
||||||
static void SetBoolOption (unsigned char* Flag)
|
static void SetBoolOption (unsigned char* Flag)
|
||||||
/* Read a on/off/+/- option and set flag accordingly */
|
/* Read a on/off/+/- option and set flag accordingly */
|
||||||
{
|
{
|
||||||
static const char* Keys[] = {
|
static const char* const Keys[] = {
|
||||||
"OFF",
|
"OFF",
|
||||||
"ON",
|
"ON",
|
||||||
};
|
};
|
||||||
|
@ -451,7 +451,7 @@ static void DoASCIIZ (void)
|
||||||
static void DoAssert (void)
|
static void DoAssert (void)
|
||||||
/* Add an assertion */
|
/* Add an assertion */
|
||||||
{
|
{
|
||||||
static const char* ActionTab [] = {
|
static const char* const ActionTab [] = {
|
||||||
"WARN", "WARNING",
|
"WARN", "WARNING",
|
||||||
"ERROR",
|
"ERROR",
|
||||||
"LDWARN", "LDWARNING",
|
"LDWARN", "LDWARNING",
|
||||||
|
@ -659,7 +659,7 @@ static void DoCode (void)
|
||||||
static void DoConDes (void)
|
static void DoConDes (void)
|
||||||
/* Export a symbol as constructor/destructor */
|
/* Export a symbol as constructor/destructor */
|
||||||
{
|
{
|
||||||
static const char* Keys[] = {
|
static const char* const Keys[] = {
|
||||||
"CONSTRUCTOR",
|
"CONSTRUCTOR",
|
||||||
"DESTRUCTOR",
|
"DESTRUCTOR",
|
||||||
"INTERRUPTOR",
|
"INTERRUPTOR",
|
||||||
|
@ -744,7 +744,7 @@ static void DoData (void)
|
||||||
static void DoDbg (void)
|
static void DoDbg (void)
|
||||||
/* Add debug information from high level code */
|
/* Add debug information from high level code */
|
||||||
{
|
{
|
||||||
static const char* Keys[] = {
|
static const char* const Keys[] = {
|
||||||
"FILE",
|
"FILE",
|
||||||
"FUNC",
|
"FUNC",
|
||||||
"LINE",
|
"LINE",
|
||||||
|
@ -1039,7 +1039,7 @@ static void DoFileOpt (void)
|
||||||
if (CurTok.Tok == TOK_IDENT) {
|
if (CurTok.Tok == TOK_IDENT) {
|
||||||
|
|
||||||
/* Option given as keyword */
|
/* Option given as keyword */
|
||||||
static const char* Keys [] = {
|
static const char* const Keys [] = {
|
||||||
"AUTHOR", "COMMENT", "COMPILER"
|
"AUTHOR", "COMMENT", "COMPILER"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1477,7 +1477,7 @@ CharAgain:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int GetSubKey (const char** Keys, unsigned Count)
|
int GetSubKey (const char* const* Keys, unsigned Count)
|
||||||
/* Search for a subkey in a table of keywords. The current token must be an
|
/* Search for a subkey in a table of keywords. The current token must be an
|
||||||
** identifier and all keys must be in upper case. The identifier will be
|
** identifier and all keys must be in upper case. The identifier will be
|
||||||
** uppercased in the process. The function returns the index of the keyword,
|
** uppercased in the process. The function returns the index of the keyword,
|
||||||
|
|
|
@ -84,7 +84,7 @@ void UpcaseSVal (void);
|
||||||
void NextRawTok (void);
|
void NextRawTok (void);
|
||||||
/* Read the next raw token from the input stream */
|
/* Read the next raw token from the input stream */
|
||||||
|
|
||||||
int GetSubKey (const char** Keys, unsigned Count);
|
int GetSubKey (const char* const* Keys, unsigned Count);
|
||||||
/* Search for a subkey in a table of keywords. The current token must be an
|
/* Search for a subkey in a table of keywords. The current token must be an
|
||||||
** identifier and all keys must be in upper case. The identifier will be
|
** identifier and all keys must be in upper case. The identifier will be
|
||||||
** uppercased in the process. The function returns the index of the keyword,
|
** uppercased in the process. The function returns the index of the keyword,
|
||||||
|
|
|
@ -2211,7 +2211,7 @@ void g_cmp (unsigned flags, unsigned long val)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void oper (unsigned Flags, unsigned long Val, const char** Subs)
|
static void oper (unsigned Flags, unsigned long Val, const char* const* Subs)
|
||||||
/* Encode a binary operation. subs is a pointer to four strings:
|
/* Encode a binary operation. subs is a pointer to four strings:
|
||||||
** 0 --> Operate on ints
|
** 0 --> Operate on ints
|
||||||
** 1 --> Operate on unsigneds
|
** 1 --> Operate on unsigneds
|
||||||
|
@ -2499,7 +2499,7 @@ void g_stackcheck (void)
|
||||||
void g_add (unsigned flags, unsigned long val)
|
void g_add (unsigned flags, unsigned long val)
|
||||||
/* Primary = TOS + Primary */
|
/* Primary = TOS + Primary */
|
||||||
{
|
{
|
||||||
static const char* ops[12] = {
|
static const char* const ops[4] = {
|
||||||
"tosaddax", "tosaddax", "tosaddeax", "tosaddeax"
|
"tosaddax", "tosaddax", "tosaddeax", "tosaddeax"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2515,8 +2515,8 @@ void g_add (unsigned flags, unsigned long val)
|
||||||
void g_sub (unsigned flags, unsigned long val)
|
void g_sub (unsigned flags, unsigned long val)
|
||||||
/* Primary = TOS - Primary */
|
/* Primary = TOS - Primary */
|
||||||
{
|
{
|
||||||
static const char* ops[12] = {
|
static const char* const ops[4] = {
|
||||||
"tossubax", "tossubax", "tossubeax", "tossubeax",
|
"tossubax", "tossubax", "tossubeax", "tossubeax"
|
||||||
};
|
};
|
||||||
|
|
||||||
if (flags & CF_CONST) {
|
if (flags & CF_CONST) {
|
||||||
|
@ -2531,8 +2531,8 @@ void g_sub (unsigned flags, unsigned long val)
|
||||||
void g_rsub (unsigned flags, unsigned long val)
|
void g_rsub (unsigned flags, unsigned long val)
|
||||||
/* Primary = Primary - TOS */
|
/* Primary = Primary - TOS */
|
||||||
{
|
{
|
||||||
static const char* ops[12] = {
|
static const char* const ops[4] = {
|
||||||
"tosrsubax", "tosrsubax", "tosrsubeax", "tosrsubeax",
|
"tosrsubax", "tosrsubax", "tosrsubeax", "tosrsubeax"
|
||||||
};
|
};
|
||||||
oper (flags, val, ops);
|
oper (flags, val, ops);
|
||||||
}
|
}
|
||||||
|
@ -2542,8 +2542,8 @@ void g_rsub (unsigned flags, unsigned long val)
|
||||||
void g_mul (unsigned flags, unsigned long val)
|
void g_mul (unsigned flags, unsigned long val)
|
||||||
/* Primary = TOS * Primary */
|
/* Primary = TOS * Primary */
|
||||||
{
|
{
|
||||||
static const char* ops[12] = {
|
static const char* const ops[4] = {
|
||||||
"tosmulax", "tosumulax", "tosmuleax", "tosumuleax",
|
"tosmulax", "tosumulax", "tosmuleax", "tosumuleax"
|
||||||
};
|
};
|
||||||
|
|
||||||
int p2;
|
int p2;
|
||||||
|
@ -2649,8 +2649,8 @@ void g_mul (unsigned flags, unsigned long val)
|
||||||
void g_div (unsigned flags, unsigned long val)
|
void g_div (unsigned flags, unsigned long val)
|
||||||
/* Primary = TOS / Primary */
|
/* Primary = TOS / Primary */
|
||||||
{
|
{
|
||||||
static const char* ops[12] = {
|
static const char* const ops[4] = {
|
||||||
"tosdivax", "tosudivax", "tosdiveax", "tosudiveax",
|
"tosdivax", "tosudivax", "tosdiveax", "tosudiveax"
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Do strength reduction if the value is constant and a power of two */
|
/* Do strength reduction if the value is constant and a power of two */
|
||||||
|
@ -2674,8 +2674,8 @@ void g_div (unsigned flags, unsigned long val)
|
||||||
void g_mod (unsigned flags, unsigned long val)
|
void g_mod (unsigned flags, unsigned long val)
|
||||||
/* Primary = TOS % Primary */
|
/* Primary = TOS % Primary */
|
||||||
{
|
{
|
||||||
static const char* ops[12] = {
|
static const char* const ops[4] = {
|
||||||
"tosmodax", "tosumodax", "tosmodeax", "tosumodeax",
|
"tosmodax", "tosumodax", "tosmodeax", "tosumodeax"
|
||||||
};
|
};
|
||||||
int p2;
|
int p2;
|
||||||
|
|
||||||
|
@ -2699,8 +2699,8 @@ void g_mod (unsigned flags, unsigned long val)
|
||||||
void g_or (unsigned flags, unsigned long val)
|
void g_or (unsigned flags, unsigned long val)
|
||||||
/* Primary = TOS | Primary */
|
/* Primary = TOS | Primary */
|
||||||
{
|
{
|
||||||
static const char* ops[12] = {
|
static const char* const ops[4] = {
|
||||||
"tosorax", "tosorax", "tosoreax", "tosoreax",
|
"tosorax", "tosorax", "tosoreax", "tosoreax"
|
||||||
};
|
};
|
||||||
|
|
||||||
/* If the right hand side is const, the lhs is not on stack but still
|
/* If the right hand side is const, the lhs is not on stack but still
|
||||||
|
@ -2769,8 +2769,8 @@ void g_or (unsigned flags, unsigned long val)
|
||||||
void g_xor (unsigned flags, unsigned long val)
|
void g_xor (unsigned flags, unsigned long val)
|
||||||
/* Primary = TOS ^ Primary */
|
/* Primary = TOS ^ Primary */
|
||||||
{
|
{
|
||||||
static const char* ops[12] = {
|
static const char* const ops[4] = {
|
||||||
"tosxorax", "tosxorax", "tosxoreax", "tosxoreax",
|
"tosxorax", "tosxorax", "tosxoreax", "tosxoreax"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -2837,8 +2837,8 @@ void g_xor (unsigned flags, unsigned long val)
|
||||||
void g_and (unsigned Flags, unsigned long Val)
|
void g_and (unsigned Flags, unsigned long Val)
|
||||||
/* Primary = TOS & Primary */
|
/* Primary = TOS & Primary */
|
||||||
{
|
{
|
||||||
static const char* ops[12] = {
|
static const char* const ops[4] = {
|
||||||
"tosandax", "tosandax", "tosandeax", "tosandeax",
|
"tosandax", "tosandax", "tosandeax", "tosandeax"
|
||||||
};
|
};
|
||||||
|
|
||||||
/* If the right hand side is const, the lhs is not on stack but still
|
/* If the right hand side is const, the lhs is not on stack but still
|
||||||
|
@ -2929,8 +2929,8 @@ void g_and (unsigned Flags, unsigned long Val)
|
||||||
void g_asr (unsigned flags, unsigned long val)
|
void g_asr (unsigned flags, unsigned long val)
|
||||||
/* Primary = TOS >> Primary */
|
/* Primary = TOS >> Primary */
|
||||||
{
|
{
|
||||||
static const char* ops[12] = {
|
static const char* const ops[4] = {
|
||||||
"tosasrax", "tosshrax", "tosasreax", "tosshreax",
|
"tosasrax", "tosshrax", "tosasreax", "tosshreax"
|
||||||
};
|
};
|
||||||
|
|
||||||
/* If the right hand side is const, the lhs is not on stack but still
|
/* If the right hand side is const, the lhs is not on stack but still
|
||||||
|
@ -3060,8 +3060,8 @@ void g_asr (unsigned flags, unsigned long val)
|
||||||
void g_asl (unsigned flags, unsigned long val)
|
void g_asl (unsigned flags, unsigned long val)
|
||||||
/* Primary = TOS << Primary */
|
/* Primary = TOS << Primary */
|
||||||
{
|
{
|
||||||
static const char* ops[12] = {
|
static const char* const ops[4] = {
|
||||||
"tosaslax", "tosshlax", "tosasleax", "tosshleax",
|
"tosaslax", "tosshlax", "tosasleax", "tosshleax"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -3438,8 +3438,8 @@ void g_dec (unsigned flags, unsigned long val)
|
||||||
void g_eq (unsigned flags, unsigned long val)
|
void g_eq (unsigned flags, unsigned long val)
|
||||||
/* Test for equal */
|
/* Test for equal */
|
||||||
{
|
{
|
||||||
static const char* ops[12] = {
|
static const char* const ops[4] = {
|
||||||
"toseqax", "toseqax", "toseqeax", "toseqeax",
|
"toseqax", "toseqax", "toseqeax", "toseqeax"
|
||||||
};
|
};
|
||||||
|
|
||||||
unsigned L;
|
unsigned L;
|
||||||
|
@ -3492,8 +3492,8 @@ void g_eq (unsigned flags, unsigned long val)
|
||||||
void g_ne (unsigned flags, unsigned long val)
|
void g_ne (unsigned flags, unsigned long val)
|
||||||
/* Test for not equal */
|
/* Test for not equal */
|
||||||
{
|
{
|
||||||
static const char* ops[12] = {
|
static const char* const ops[4] = {
|
||||||
"tosneax", "tosneax", "tosneeax", "tosneeax",
|
"tosneax", "tosneax", "tosneeax", "tosneeax"
|
||||||
};
|
};
|
||||||
|
|
||||||
unsigned L;
|
unsigned L;
|
||||||
|
@ -3546,8 +3546,8 @@ void g_ne (unsigned flags, unsigned long val)
|
||||||
void g_lt (unsigned flags, unsigned long val)
|
void g_lt (unsigned flags, unsigned long val)
|
||||||
/* Test for less than */
|
/* Test for less than */
|
||||||
{
|
{
|
||||||
static const char* ops[12] = {
|
static const char* const ops[4] = {
|
||||||
"tosltax", "tosultax", "toslteax", "tosulteax",
|
"tosltax", "tosultax", "toslteax", "tosulteax"
|
||||||
};
|
};
|
||||||
|
|
||||||
unsigned Label;
|
unsigned Label;
|
||||||
|
@ -3708,8 +3708,8 @@ void g_lt (unsigned flags, unsigned long val)
|
||||||
void g_le (unsigned flags, unsigned long val)
|
void g_le (unsigned flags, unsigned long val)
|
||||||
/* Test for less than or equal to */
|
/* Test for less than or equal to */
|
||||||
{
|
{
|
||||||
static const char* ops[12] = {
|
static const char* const ops[4] = {
|
||||||
"tosleax", "tosuleax", "tosleeax", "tosuleeax",
|
"tosleax", "tosuleax", "tosleeax", "tosuleeax"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -3823,8 +3823,8 @@ void g_le (unsigned flags, unsigned long val)
|
||||||
void g_gt (unsigned flags, unsigned long val)
|
void g_gt (unsigned flags, unsigned long val)
|
||||||
/* Test for greater than */
|
/* Test for greater than */
|
||||||
{
|
{
|
||||||
static const char* ops[12] = {
|
static const char* const ops[4] = {
|
||||||
"tosgtax", "tosugtax", "tosgteax", "tosugteax",
|
"tosgtax", "tosugtax", "tosgteax", "tosugteax"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -3954,8 +3954,8 @@ void g_gt (unsigned flags, unsigned long val)
|
||||||
void g_ge (unsigned flags, unsigned long val)
|
void g_ge (unsigned flags, unsigned long val)
|
||||||
/* Test for greater than or equal to */
|
/* Test for greater than or equal to */
|
||||||
{
|
{
|
||||||
static const char* ops[12] = {
|
static const char* const ops[4] = {
|
||||||
"tosgeax", "tosugeax", "tosgeeax", "tosugeeax",
|
"tosgeax", "tosugeax", "tosgeeax", "tosugeeax"
|
||||||
};
|
};
|
||||||
|
|
||||||
unsigned Label;
|
unsigned Label;
|
||||||
|
|
|
@ -1711,7 +1711,7 @@ static int HarmlessCall (const char* Name)
|
||||||
** the pushax/op sequence when encountered.
|
** the pushax/op sequence when encountered.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
static const char* Tab[] = {
|
static const char* const Tab[] = {
|
||||||
"aslax1",
|
"aslax1",
|
||||||
"aslax2",
|
"aslax2",
|
||||||
"aslax3",
|
"aslax3",
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
IntStack Standard = INTSTACK(STD_UNKNOWN);
|
IntStack Standard = INTSTACK(STD_UNKNOWN);
|
||||||
|
|
||||||
/* Table mapping names to standards, sorted by standard. */
|
/* Table mapping names to standards, sorted by standard. */
|
||||||
static const char* StdNames[STD_COUNT] = {
|
static const char* const StdNames[STD_COUNT] = {
|
||||||
"c89", "c99", "cc65"
|
"c89", "c99", "cc65"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
O65Model Model = O65_MODEL_NONE;
|
O65Model Model = O65_MODEL_NONE;
|
||||||
|
|
||||||
/* Name table */
|
/* Name table */
|
||||||
static const char* NameTable[O65_MODEL_COUNT] = {
|
static const char* const NameTable[O65_MODEL_COUNT] = {
|
||||||
"none",
|
"none",
|
||||||
"os/a65",
|
"os/a65",
|
||||||
"lunix",
|
"lunix",
|
||||||
|
|
|
@ -264,11 +264,11 @@ const char* GetLabel (unsigned Addr, unsigned RefFrom)
|
||||||
** of unnamed labels, to determine the name.
|
** of unnamed labels, to determine the name.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
static const char* FwdLabels[] = {
|
static const char* const FwdLabels[] = {
|
||||||
":+", ":++", ":+++", ":++++", ":+++++", ":++++++", ":+++++++",
|
":+", ":++", ":+++", ":++++", ":+++++", ":++++++", ":+++++++",
|
||||||
":++++++++", ":+++++++++", ":++++++++++"
|
":++++++++", ":+++++++++", ":++++++++++"
|
||||||
};
|
};
|
||||||
static const char* BackLabels[] = {
|
static const char* const BackLabels[] = {
|
||||||
":-", ":--", ":---", ":----", ":-----", ":------", ":-------",
|
":-", ":--", ":---", ":----", ":-----", ":------", ":-------",
|
||||||
":--------", ":---------", ":----------"
|
":--------", ":---------", ":----------"
|
||||||
};
|
};
|
||||||
|
|
|
@ -226,18 +226,18 @@ static void openSFile (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int findToken (const char **tokenTbl, const char *token)
|
static int findToken (const char * const *tokenTbl, const char *token)
|
||||||
{
|
{
|
||||||
/* takes as input table of tokens and token, returns position in table or -1 if not found */
|
/* takes as input table of tokens and token, returns position in table or -1 if not found */
|
||||||
int a = 0;
|
int i;
|
||||||
|
|
||||||
while (strlen (tokenTbl[a]) != 0) {
|
for (i = 0; tokenTbl[i][0]; i++) {
|
||||||
if (strcmp (tokenTbl[a], token) == 0) break;
|
if (strcmp (tokenTbl[i], token) == 0) {
|
||||||
a++;
|
return i;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strlen (tokenTbl[a]) == 0) a = -1;
|
return -1;
|
||||||
return a;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -240,7 +240,7 @@ void SplitAddAttr (Collection* C, const char* Combined, const char* Name)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Collection* ParseAttrList (const char* List, const char** NameList, unsigned NameCount)
|
Collection* ParseAttrList (const char* List, const char* const* NameList, unsigned NameCount)
|
||||||
/* Parse a list containing name/value pairs into a sorted collection. Some
|
/* Parse a list containing name/value pairs into a sorted collection. Some
|
||||||
** attributes may not need a name, so NameList contains these names. If there
|
** attributes may not need a name, so NameList contains these names. If there
|
||||||
** were no errors, the function returns a alphabetically sorted collection
|
** were no errors, the function returns a alphabetically sorted collection
|
||||||
|
|
|
@ -111,7 +111,7 @@ void SplitAddAttr (Collection* C, const char* Combined, const char* Name);
|
||||||
** Name is NULL, terminate with an error.
|
** Name is NULL, terminate with an error.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Collection* ParseAttrList (const char* List, const char** NameList, unsigned NameCount);
|
Collection* ParseAttrList (const char* List, const char* const* NameList, unsigned NameCount);
|
||||||
/* Parse a list containing name/value pairs into a sorted collection. Some
|
/* Parse a list containing name/value pairs into a sorted collection. Some
|
||||||
** attributes may not need a name, so NameList contains these names. If there
|
** attributes may not need a name, so NameList contains these names. If there
|
||||||
** were no errors, the function returns a alphabetically sorted collection
|
** were no errors, the function returns a alphabetically sorted collection
|
||||||
|
|
|
@ -141,7 +141,7 @@ static void SetOutputData (StrBuf* N)
|
||||||
static void OptConvertTo (const char* Opt attribute ((unused)), const char* Arg)
|
static void OptConvertTo (const char* Opt attribute ((unused)), const char* Arg)
|
||||||
/* Convert the bitmap into a target format */
|
/* Convert the bitmap into a target format */
|
||||||
{
|
{
|
||||||
static const char* NameList[] = {
|
static const char* const NameList[] = {
|
||||||
"format"
|
"format"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -220,7 +220,7 @@ static void OptPop (const char* Opt attribute ((unused)),
|
||||||
static void OptRead (const char* Opt attribute ((unused)), const char* Arg)
|
static void OptRead (const char* Opt attribute ((unused)), const char* Arg)
|
||||||
/* Read an input file */
|
/* Read an input file */
|
||||||
{
|
{
|
||||||
static const char* NameList[] = {
|
static const char* const NameList[] = {
|
||||||
"name", "format"
|
"name", "format"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -294,7 +294,7 @@ static void OptVersion (const char* Opt attribute ((unused)),
|
||||||
static void OptWrite (const char* Opt attribute ((unused)), const char* Arg)
|
static void OptWrite (const char* Opt attribute ((unused)), const char* Arg)
|
||||||
/* Write an output file */
|
/* Write an output file */
|
||||||
{
|
{
|
||||||
static const char* NameList[] = {
|
static const char* const NameList[] = {
|
||||||
"name", "format"
|
"name", "format"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue