/* Predefined packages */
-static const char MacGeneric [] = /* Generic macros */
+static char MacGeneric [] = /* Generic macros */
".macro add Arg1, Arg2\n"
" clc\n"
" .if .paramcount = 2\n"
-static const char MacLongBranch [] = /* Long branch macros */
+static char MacLongBranch [] = /* Long branch macros */
".macro jeq Target\n"
" .if .match(Target, 0)\n"
" bne *+5\n"
/* Table with pointers to the different packages */
-static const char* MacPackages [] = {
+static char* MacPackages [] = {
MacGeneric,
MacLongBranch,
};
/* Struct to handle textual input data */
typedef struct InputData_ InputData;
struct InputData_ {
- const char* Data; /* Pointer to the data */
+ char* Data; /* Pointer to the data */
const char* Pos; /* Pointer to current position */
int Malloced; /* Memory was malloced */
enum Token Tok; /* Last token */
-void NewInputData (const char* Data, int Malloced)
+void NewInputData (char* Data, int Malloced)
/* Add a chunk of input data to the input stream */
{
InputData* I;
TOK_P816,
TOK_PAGELENGTH,
TOK_PARAMCOUNT,
- TOK_PC02,
+ TOK_PC02,
TOK_POPSEG,
TOK_PROC,
TOK_PUSHSEG,
void DoneInputFile (void);
/* Close the current input file */
-void NewInputData (const char* Data, int Malloced);
+void NewInputData (char* Data, int Malloced);
/* Add a chunk of input data to the input stream */
void LocaseSVal (void);
/* common */
#include "chartype.h"
#include "check.h"
+#include "debugflag.h"
#include "xmalloc.h"
#include "xsprintf.h"
/* common */
#include "chartype.h"
#include "check.h"
+#include "debugflag.h"
#include "global.h"
#include "hashstr.h"
#include "strutil.h"
#include <time.h>
/* common */
+#include "debugflag.h"
#include "version.h"
#include "xmalloc.h"
#include "xsprintf.h"
/* common */
#include "check.h"
+#include "debugflag.h"
#include "xmalloc.h"
/* cc65 */
/* If the expression is already a pointer to function, the
* additional dereferencing operator must be ignored.
*/
- if (IsTypeFuncPtr (lval->Type)) {
+ if (IsTypeFuncPtr (lval->Type)) {
/* Expression not storable */
return 0;
} else {
- if (IsClassPtr (lval->Type)) {
+ if (IsClassPtr (lval->Type)) {
lval->Type = Indirect (lval->Type);
} else {
Error ("Illegal indirection");
unsigned char SignedChars = 0; /* Make characters signed by default */
unsigned char AddSource = 0; /* Add source lines as comments */
unsigned char DebugInfo = 0; /* Add debug info to the obj */
-unsigned char Debug = 0; /* Debug mode */
unsigned char CreateDep = 0; /* Create a dependency file */
unsigned char CheckStack = 0; /* Generate stack overflow checks */
extern unsigned char SignedChars; /* Make characters signed by default */
extern unsigned char AddSource; /* Add source lines as comments */
extern unsigned char DebugInfo; /* Add debug info to the obj */
-extern unsigned char Debug; /* Debug mode */
extern unsigned char CreateDep; /* Create a dependency file */
extern unsigned char CheckStack; /* Generate stack overflow checks */
#include "abend.h"
#include "chartype.h"
#include "cmdline.h"
+#include "debugflag.h"
#include "fname.h"
#include "print.h"
#include "segdefs.h"
static void OptDebug (const char* Opt attribute ((unused)),
- const char* Arg attribute ((unused)))
+ const char* Arg attribute ((unused)))
/* Compiler debug mode */
{
- Debug = 1;
+ ++Debug;
}
/* common */
#include "check.h"
+#include "debugflag.h"
#include "hashstr.h"
#include "xmalloc.h"
--- /dev/null
+/*****************************************************************************/
+/* */
+/* debugflag.c */
+/* */
+/* Global debug flag */
+/* */
+/* */
+/* */
+/* (C) 2002 Ullrich von Bassewitz */
+/* Wacholderweg 14 */
+/* D-70597 Stuttgart */
+/* EMail: uz@cc65.org */
+/* */
+/* */
+/* This software is provided 'as-is', without any expressed or implied */
+/* warranty. In no event will the authors be held liable for any damages */
+/* arising from the use of this software. */
+/* */
+/* Permission is granted to anyone to use this software for any purpose, */
+/* including commercial applications, and to alter it and redistribute it */
+/* freely, subject to the following restrictions: */
+/* */
+/* 1. The origin of this software must not be misrepresented; you must not */
+/* claim that you wrote the original software. If you use this software */
+/* in a product, an acknowledgment in the product documentation would be */
+/* appreciated but is not required. */
+/* 2. Altered source versions must be plainly marked as such, and must not */
+/* be misrepresented as being the original software. */
+/* 3. This notice may not be removed or altered from any source */
+/* distribution. */
+/* */
+/*****************************************************************************/
+
+
+
+/* common */
+#include "debugflag.h"
+
+
+
+/*****************************************************************************/
+/* Data */
+/*****************************************************************************/
+
+
+
+unsigned char Debug = 0; /* Debug mode */
+
+
+
--- /dev/null
+/*****************************************************************************/
+/* */
+/* debugflag.h */
+/* */
+/* Global debug flag */
+/* */
+/* */
+/* */
+/* (C) 2002 Ullrich von Bassewitz */
+/* Wacholderweg 14 */
+/* D-70597 Stuttgart */
+/* EMail: uz@cc65.org */
+/* */
+/* */
+/* This software is provided 'as-is', without any expressed or implied */
+/* warranty. In no event will the authors be held liable for any damages */
+/* arising from the use of this software. */
+/* */
+/* Permission is granted to anyone to use this software for any purpose, */
+/* including commercial applications, and to alter it and redistribute it */
+/* freely, subject to the following restrictions: */
+/* */
+/* 1. The origin of this software must not be misrepresented; you must not */
+/* claim that you wrote the original software. If you use this software */
+/* in a product, an acknowledgment in the product documentation would be */
+/* appreciated but is not required. */
+/* 2. Altered source versions must be plainly marked as such, and must not */
+/* be misrepresented as being the original software. */
+/* 3. This notice may not be removed or altered from any source */
+/* distribution. */
+/* */
+/*****************************************************************************/
+
+
+
+#ifndef DEBUGFLAG_H
+#define DEBUGFLAG_H
+
+
+
+/*****************************************************************************/
+/* Data */
+/*****************************************************************************/
+
+
+
+extern unsigned char Debug; /* Debug mode */
+
+
+
+/* End of debugflag.h */
+#endif
+
+
+
check.o \
cmdline.o \
coll.o \
+ debugflag.o \
exprdefs.o \
filepos.o \
fname.o \
check.obj \
cmdline.obj \
coll.obj \
+ debugflag.obj \
exprdefs.obj \
filepos.obj \
fname.obj \
/* Segment definition */
typedef struct SegDef SegDef;
struct SegDef {
- const char* Name; /* Segment name */
+ char* Name; /* Segment name */
unsigned Type; /* Segment type, see above */
};
#include <string.h>
#include "abend.h"
+#include "debugflag.h"
#include "xmalloc.h"
/*****************************************************************************/
-/* code */
+/* code */
/*****************************************************************************/
-void xfree (const void* Block)
+void xfree (void* Block)
/* Free the block, do some debugging */
{
- free ((void*) Block);
+ free (Block);
}
void* xrealloc (void* P, size_t Size);
/* Reallocate a memory block, check for out of memory */
-void xfree (const void* Block);
+void xfree (void* Block);
/* Free the block, do some debugging */
char* xstrdup (const char* S);
unsigned HashVal;
/* As long as the import is not inserted, V.Name is valid */
- const char* Name = I->V.Name;
+ char* Name = I->V.Name;
/* Create a hash value for the given name */
HashVal = HashStr (Name) % HASHTAB_SIZE;
FilePos Pos; /* File position of reference */
union {
struct Export* Exp; /* Matching export for this import */
- const char* Name; /* Name if not in table */
+ char* Name; /* Name if not in table */
} V;
unsigned char Type; /* Type of import */
};