mirror of
https://github.com/cc65/cc65.git
synced 2024-12-28 22:30:12 +00:00
Fixed a few warnings
git-svn-id: svn://svn.cc65.org/cc65/trunk@938 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
7c67a35771
commit
1a65e30fa0
@ -68,8 +68,7 @@ unsigned long PC; /* Current PC */
|
|||||||
void LoadCode (const char* Name, unsigned long StartAddress)
|
void LoadCode (const char* Name, unsigned long StartAddress)
|
||||||
/* Load the code from the given file */
|
/* Load the code from the given file */
|
||||||
{
|
{
|
||||||
unsigned Count, MaxCount;
|
long Count, MaxCount, Size;
|
||||||
long Size;
|
|
||||||
FILE* F;
|
FILE* F;
|
||||||
|
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ unsigned long StartAddr = 0xC000; /* Start/load address of the program */
|
|||||||
unsigned char Pass = 0; /* Disassembler pass */
|
unsigned char Pass = 0; /* Disassembler pass */
|
||||||
|
|
||||||
/* Page formatting */
|
/* Page formatting */
|
||||||
int PageLength = -1; /* Length of a listing page */
|
unsigned PageLength = 0; /* Length of a listing page */
|
||||||
unsigned MIndent = 9; /* Mnemonic indent */
|
unsigned MIndent = 9; /* Mnemonic indent */
|
||||||
unsigned AIndent = 17; /* Argument indent */
|
unsigned AIndent = 17; /* Argument indent */
|
||||||
unsigned CIndent = 49; /* Comment indent */
|
unsigned CIndent = 49; /* Comment indent */
|
||||||
|
@ -64,7 +64,7 @@ extern unsigned char Pass; /* Disassembler pass */
|
|||||||
/* Page formatting */
|
/* Page formatting */
|
||||||
#define MIN_PAGE_LEN 32
|
#define MIN_PAGE_LEN 32
|
||||||
#define MAX_PAGE_LEN 127
|
#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 MIndent; /* Mnemonic indent */
|
||||||
extern unsigned AIndent; /* Argument indent */
|
extern unsigned AIndent; /* Argument indent */
|
||||||
extern unsigned CIndent; /* Comment indent */
|
extern unsigned CIndent; /* Comment indent */
|
||||||
|
@ -168,7 +168,7 @@ static void OptPageLength (const char* Opt, const char* Arg)
|
|||||||
NeedArg (Opt);
|
NeedArg (Opt);
|
||||||
}
|
}
|
||||||
Len = atoi (Arg);
|
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);
|
AbEnd ("Invalid page length: %d", Len);
|
||||||
}
|
}
|
||||||
PageLength = Len;
|
PageLength = Len;
|
||||||
@ -323,7 +323,7 @@ int main (int argc, char* argv [])
|
|||||||
{ "--version", 0, OptVersion },
|
{ "--version", 0, OptVersion },
|
||||||
};
|
};
|
||||||
|
|
||||||
int I;
|
unsigned I;
|
||||||
|
|
||||||
/* Initialize the cmdline module */
|
/* Initialize the cmdline module */
|
||||||
InitCmdLine (&argc, &argv, "da65");
|
InitCmdLine (&argc, &argv, "da65");
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
# Library dir
|
# Library dir
|
||||||
COMMON = ../common
|
COMMON = ../common
|
||||||
|
|
||||||
CFLAGS = -g -O2 -Wall -I$(COMMON)
|
CFLAGS = -g -O2 -Wall -W -Wno-unused-parameter -I$(COMMON)
|
||||||
CC=gcc
|
CC=gcc
|
||||||
EBIND=emxbind
|
EBIND=emxbind
|
||||||
LDFLAGS=
|
LDFLAGS=
|
||||||
|
@ -138,7 +138,7 @@ void Indent (unsigned N)
|
|||||||
void LineFeed (void)
|
void LineFeed (void)
|
||||||
/* Add a linefeed to the output file */
|
/* Add a linefeed to the output file */
|
||||||
{
|
{
|
||||||
if (Pass == PassCount) {
|
if (Pass == PassCount && PageLength > 0) {
|
||||||
fputc ('\n', F);
|
fputc ('\n', F);
|
||||||
if (++Line >= PageLength) {
|
if (++Line >= PageLength) {
|
||||||
if (FormFeeds) {
|
if (FormFeeds) {
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
/* Current token and attributes */
|
/* Current token and attributes */
|
||||||
unsigned CfgTok;
|
unsigned CfgTok;
|
||||||
char CfgSVal [CFG_MAX_IDENT_LEN+1];
|
char CfgSVal [CFG_MAX_IDENT_LEN+1];
|
||||||
unsigned long CfgIVal;
|
long CfgIVal;
|
||||||
|
|
||||||
/* Error location */
|
/* Error location */
|
||||||
unsigned CfgErrorLine;
|
unsigned CfgErrorLine;
|
||||||
@ -389,7 +389,7 @@ void CfgAssureIdent (void)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void CfgRangeCheck (unsigned long Lo, unsigned long Hi)
|
void CfgRangeCheck (long Lo, long Hi)
|
||||||
/* Check the range of CfgIVal */
|
/* Check the range of CfgIVal */
|
||||||
{
|
{
|
||||||
if (CfgIVal < Lo || CfgIVal > Hi) {
|
if (CfgIVal < Lo || CfgIVal > Hi) {
|
||||||
|
@ -107,7 +107,7 @@ struct IdentTok_ {
|
|||||||
#define CFG_MAX_IDENT_LEN 255
|
#define CFG_MAX_IDENT_LEN 255
|
||||||
extern unsigned CfgTok;
|
extern unsigned CfgTok;
|
||||||
extern char CfgSVal [CFG_MAX_IDENT_LEN+1];
|
extern char CfgSVal [CFG_MAX_IDENT_LEN+1];
|
||||||
extern unsigned long CfgIVal;
|
extern long CfgIVal;
|
||||||
|
|
||||||
/* Error location */
|
/* Error location */
|
||||||
extern unsigned CfgErrorLine;
|
extern unsigned CfgErrorLine;
|
||||||
@ -160,7 +160,7 @@ void CfgAssureStr (void);
|
|||||||
void CfgAssureIdent (void);
|
void CfgAssureIdent (void);
|
||||||
/* Make sure the next token is an identifier */
|
/* 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 */
|
/* Check the range of CfgIVal */
|
||||||
|
|
||||||
void CfgSpecialToken (const IdentTok* Table, unsigned Size, const char* Name);
|
void CfgSpecialToken (const IdentTok* Table, unsigned Size, const char* Name);
|
||||||
|
@ -112,9 +112,9 @@ char *nextWord() {
|
|||||||
return strtok(NULL, " ");
|
return strtok(NULL, " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
void setLen (char *name, int len) {
|
void setLen (char *name, unsigned len) {
|
||||||
if (strlen(name)>len)
|
if (strlen(name)>len)
|
||||||
name[len]='\0';
|
name[len]='\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
void fillOut (char *name, int len, char *filler) {
|
void fillOut (char *name, int len, char *filler) {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
# gcc Makefile for grc
|
# gcc Makefile for grc
|
||||||
#
|
#
|
||||||
|
|
||||||
CFLAGS = -g -O2 -Wall
|
CFLAGS = -g -O2 -Wall -W
|
||||||
CC = gcc
|
CC = gcc
|
||||||
LDFLAGS =
|
LDFLAGS =
|
||||||
EBIND = emxbind
|
EBIND = emxbind
|
||||||
|
@ -213,7 +213,7 @@ void ConDesSetSegName (unsigned Type, const char* SegName)
|
|||||||
/* Set the segment name where the table should go */
|
/* Set the segment name where the table should go */
|
||||||
{
|
{
|
||||||
/* Check the parameters */
|
/* 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 */
|
/* Setting the segment name twice is bad */
|
||||||
CHECK (ConDes[Type].SegName == 0);
|
CHECK (ConDes[Type].SegName == 0);
|
||||||
@ -228,7 +228,7 @@ void ConDesSetLabel (unsigned Type, const char* Name)
|
|||||||
/* Set the label for the given ConDes type */
|
/* Set the label for the given ConDes type */
|
||||||
{
|
{
|
||||||
/* Check the parameters */
|
/* 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 */
|
/* Setting the label twice is bad */
|
||||||
CHECK (ConDes[Type].Label == 0);
|
CHECK (ConDes[Type].Label == 0);
|
||||||
@ -243,7 +243,7 @@ void ConDesSetCountSym (unsigned Type, const char* Name)
|
|||||||
/* Set the name for the given ConDes count symbol */
|
/* Set the name for the given ConDes count symbol */
|
||||||
{
|
{
|
||||||
/* Check the parameters */
|
/* 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 */
|
/* Setting the symbol twice is bad */
|
||||||
CHECK (ConDes[Type].CountSym == 0);
|
CHECK (ConDes[Type].CountSym == 0);
|
||||||
@ -258,7 +258,7 @@ void ConDesSetOrder (unsigned Type, ConDesOrder Order)
|
|||||||
/* Set the sorting oder for the given ConDes table */
|
/* Set the sorting oder for the given ConDes table */
|
||||||
{
|
{
|
||||||
/* Check the parameters */
|
/* Check the parameters */
|
||||||
PRECONDITION (Type >= CD_TYPE_MIN && Type <= CD_TYPE_MAX);
|
PRECONDITION (Type <= CD_TYPE_MAX);
|
||||||
|
|
||||||
/* Set the order */
|
/* Set the order */
|
||||||
ConDes[Type].Order = Order;
|
ConDes[Type].Order = Order;
|
||||||
@ -270,7 +270,7 @@ int ConDesHasSegName (unsigned Type)
|
|||||||
/* Return true if a segment name is already defined for this ConDes type */
|
/* Return true if a segment name is already defined for this ConDes type */
|
||||||
{
|
{
|
||||||
/* Check the parameters */
|
/* Check the parameters */
|
||||||
PRECONDITION (Type >= CD_TYPE_MIN && Type <= CD_TYPE_MAX);
|
PRECONDITION (Type <= CD_TYPE_MAX);
|
||||||
|
|
||||||
return (ConDes[Type].SegName != 0);
|
return (ConDes[Type].SegName != 0);
|
||||||
}
|
}
|
||||||
@ -281,7 +281,7 @@ int ConDesHasLabel (unsigned Type)
|
|||||||
/* Return true if a label is already defined for this ConDes type */
|
/* Return true if a label is already defined for this ConDes type */
|
||||||
{
|
{
|
||||||
/* Check the parameters */
|
/* Check the parameters */
|
||||||
PRECONDITION (Type >= CD_TYPE_MIN && Type <= CD_TYPE_MAX);
|
PRECONDITION (Type <= CD_TYPE_MAX);
|
||||||
|
|
||||||
return (ConDes[Type].Label != 0);
|
return (ConDes[Type].Label != 0);
|
||||||
}
|
}
|
||||||
|
@ -304,7 +304,7 @@ int main (int argc, char* argv [])
|
|||||||
{ "--version", 0, OptVersion },
|
{ "--version", 0, OptVersion },
|
||||||
};
|
};
|
||||||
|
|
||||||
int I;
|
unsigned I;
|
||||||
|
|
||||||
/* Initialize the cmdline module */
|
/* Initialize the cmdline module */
|
||||||
InitCmdLine (&argc, &argv, "ld65");
|
InitCmdLine (&argc, &argv, "ld65");
|
||||||
|
@ -7,7 +7,7 @@ COMMON = ../common
|
|||||||
|
|
||||||
# Default for the compiler lib search path as compiler define
|
# Default for the compiler lib search path as compiler define
|
||||||
CDEFS=-DCC65_LIB=\"/usr/lib/cc65/lib/\"
|
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
|
CC=gcc
|
||||||
EBIND=emxbind
|
EBIND=emxbind
|
||||||
LDFLAGS=
|
LDFLAGS=
|
||||||
|
@ -265,7 +265,7 @@ int main (int argc, char* argv [])
|
|||||||
{ "--version", 0, OptVersion },
|
{ "--version", 0, OptVersion },
|
||||||
};
|
};
|
||||||
|
|
||||||
int I;
|
unsigned I;
|
||||||
|
|
||||||
/* Initialize the cmdline module */
|
/* Initialize the cmdline module */
|
||||||
InitCmdLine (&argc, &argv, "od65");
|
InitCmdLine (&argc, &argv, "od65");
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
# Library dir
|
# Library dir
|
||||||
COMMON = ../common
|
COMMON = ../common
|
||||||
|
|
||||||
CFLAGS = -O2 -g -Wall -I$(COMMON)
|
CFLAGS = -O2 -g -Wall -W -Wno-unused-parameter -I$(COMMON)
|
||||||
CC=gcc
|
CC=gcc
|
||||||
EBIND=emxbind
|
EBIND=emxbind
|
||||||
LDFLAGS=
|
LDFLAGS=
|
||||||
|
Loading…
Reference in New Issue
Block a user