void LoadCode (const char* Name, unsigned long StartAddress)
/* Load the code from the given file */
{
- unsigned Count, MaxCount;
- long Size;
+ long Count, MaxCount, Size;
FILE* F;
unsigned char Pass = 0; /* Disassembler pass */
/* Page formatting */
-int PageLength = -1; /* Length of a listing page */
+unsigned PageLength = 0; /* Length of a listing page */
unsigned MIndent = 9; /* Mnemonic indent */
unsigned AIndent = 17; /* Argument indent */
unsigned CIndent = 49; /* Comment indent */
/* Page formatting */
#define MIN_PAGE_LEN 32
#define MAX_PAGE_LEN 127
-extern int PageLength; /* Length of a listing page */
+extern unsigned PageLength; /* Length of a listing page */
extern unsigned MIndent; /* Mnemonic indent */
extern unsigned AIndent; /* Argument indent */
extern unsigned CIndent; /* Comment indent */
NeedArg (Opt);
}
Len = atoi (Arg);
- if (Len != -1 && (Len < MIN_PAGE_LEN || Len > MAX_PAGE_LEN)) {
+ if (Len != 0 && (Len < MIN_PAGE_LEN || Len > MAX_PAGE_LEN)) {
AbEnd ("Invalid page length: %d", Len);
}
PageLength = Len;
{ "--version", 0, OptVersion },
};
- int I;
+ unsigned I;
/* Initialize the cmdline module */
InitCmdLine (&argc, &argv, "da65");
# Library dir
COMMON = ../common
-CFLAGS = -g -O2 -Wall -I$(COMMON)
+CFLAGS = -g -O2 -Wall -W -Wno-unused-parameter -I$(COMMON)
CC=gcc
EBIND=emxbind
LDFLAGS=
void LineFeed (void)
/* Add a linefeed to the output file */
{
- if (Pass == PassCount) {
+ if (Pass == PassCount && PageLength > 0) {
fputc ('\n', F);
if (++Line >= PageLength) {
if (FormFeeds) {
/* Current token and attributes */
unsigned CfgTok;
char CfgSVal [CFG_MAX_IDENT_LEN+1];
-unsigned long CfgIVal;
+long CfgIVal;
/* Error location */
unsigned CfgErrorLine;
va_start (ap, Format);
xvsprintf (Buf, sizeof (Buf), Format, ap);
- va_end (ap);
+ va_end (ap);
Warning ("%s(%u): %s", CfgFile, CfgErrorLine, Buf);
}
Error ("%s(%u): %s", CfgFile, CfgErrorLine, Buf);
}
-
+
/*****************************************************************************/
-void CfgRangeCheck (unsigned long Lo, unsigned long Hi)
+void CfgRangeCheck (long Lo, long Hi)
/* Check the range of CfgIVal */
{
if (CfgIVal < Lo || CfgIVal > Hi) {
#define CFG_MAX_IDENT_LEN 255
extern unsigned CfgTok;
extern char CfgSVal [CFG_MAX_IDENT_LEN+1];
-extern unsigned long CfgIVal;
+extern long CfgIVal;
/* Error location */
extern unsigned CfgErrorLine;
void CfgAssureIdent (void);
/* Make sure the next token is an identifier */
-void CfgRangeCheck (unsigned long Lo, unsigned long Hi);
+void CfgRangeCheck (long Lo, long Hi);
/* Check the range of CfgIVal */
void CfgSpecialToken (const IdentTok* Table, unsigned Size, const char* Name);
return strtok(NULL, " ");
}
-void setLen (char *name, int len) {
+void setLen (char *name, unsigned len) {
if (strlen(name)>len)
- name[len]='\0';
+ name[len]='\0';
}
void fillOut (char *name, int len, char *filler) {
# gcc Makefile for grc
#
-CFLAGS = -g -O2 -Wall
+CFLAGS = -g -O2 -Wall -W
CC = gcc
LDFLAGS =
EBIND = emxbind
/* Set the segment name where the table should go */
{
/* Check the parameters */
- PRECONDITION (Type >= CD_TYPE_MIN && Type <= CD_TYPE_MAX && SegName != 0);
+ PRECONDITION (Type <= CD_TYPE_MAX && SegName != 0);
/* Setting the segment name twice is bad */
CHECK (ConDes[Type].SegName == 0);
/* Set the label for the given ConDes type */
{
/* Check the parameters */
- PRECONDITION (Type >= CD_TYPE_MIN && Type <= CD_TYPE_MAX && Name != 0);
+ PRECONDITION (Type <= CD_TYPE_MAX && Name != 0);
/* Setting the label twice is bad */
CHECK (ConDes[Type].Label == 0);
/* Set the name for the given ConDes count symbol */
{
/* Check the parameters */
- PRECONDITION (Type >= CD_TYPE_MIN && Type <= CD_TYPE_MAX && Name != 0);
+ PRECONDITION (Type <= CD_TYPE_MAX && Name != 0);
/* Setting the symbol twice is bad */
CHECK (ConDes[Type].CountSym == 0);
/* Set the sorting oder for the given ConDes table */
{
/* Check the parameters */
- PRECONDITION (Type >= CD_TYPE_MIN && Type <= CD_TYPE_MAX);
+ PRECONDITION (Type <= CD_TYPE_MAX);
/* Set the order */
ConDes[Type].Order = Order;
/* Return true if a segment name is already defined for this ConDes type */
{
/* Check the parameters */
- PRECONDITION (Type >= CD_TYPE_MIN && Type <= CD_TYPE_MAX);
+ PRECONDITION (Type <= CD_TYPE_MAX);
return (ConDes[Type].SegName != 0);
}
/* Return true if a label is already defined for this ConDes type */
{
/* Check the parameters */
- PRECONDITION (Type >= CD_TYPE_MIN && Type <= CD_TYPE_MAX);
+ PRECONDITION (Type <= CD_TYPE_MAX);
return (ConDes[Type].Label != 0);
}
{ "--version", 0, OptVersion },
};
- int I;
+ unsigned I;
/* Initialize the cmdline module */
InitCmdLine (&argc, &argv, "ld65");
}
if (LabelFileName) {
CreateLabelFile ();
- }
+ }
if (DbgFileName) {
CreateDbgFile ();
}
# Default for the compiler lib search path as compiler define
CDEFS=-DCC65_LIB=\"/usr/lib/cc65/lib/\"
-CFLAGS = -g -O2 -Wall -I$(COMMON) $(CDEFS)
+CFLAGS = -g -O2 -Wall -W -Wno-unused-parameter -I$(COMMON) $(CDEFS)
CC=gcc
EBIND=emxbind
LDFLAGS=
{ "--version", 0, OptVersion },
};
- int I;
+ unsigned I;
/* Initialize the cmdline module */
InitCmdLine (&argc, &argv, "od65");
# Library dir
COMMON = ../common
-CFLAGS = -O2 -g -Wall -I$(COMMON)
+CFLAGS = -O2 -g -Wall -W -Wno-unused-parameter -I$(COMMON)
CC=gcc
EBIND=emxbind
LDFLAGS=