1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-27 15:29:46 +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:
cuz 2001-09-15 13:36:59 +00:00
parent 7c67a35771
commit 1a65e30fa0
15 changed files with 27 additions and 28 deletions

View File

@ -68,8 +68,7 @@ unsigned long PC; /* Current PC */
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;

View File

@ -60,7 +60,7 @@ unsigned long StartAddr = 0xC000; /* Start/load address of the program */
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 */

View File

@ -64,7 +64,7 @@ extern unsigned char Pass; /* Disassembler pass */
/* 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 */

View File

@ -168,7 +168,7 @@ static void OptPageLength (const char* Opt, const char* Arg)
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;
@ -323,7 +323,7 @@ int main (int argc, char* argv [])
{ "--version", 0, OptVersion },
};
int I;
unsigned I;
/* Initialize the cmdline module */
InitCmdLine (&argc, &argv, "da65");

View File

@ -5,7 +5,7 @@
# 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=

View File

@ -138,7 +138,7 @@ void Indent (unsigned N)
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) {

View File

@ -58,7 +58,7 @@
/* Current token and attributes */
unsigned CfgTok;
char CfgSVal [CFG_MAX_IDENT_LEN+1];
unsigned long CfgIVal;
long CfgIVal;
/* Error location */
unsigned CfgErrorLine;
@ -90,7 +90,7 @@ void CfgWarning (const char* Format, ...)
va_start (ap, Format);
xvsprintf (Buf, sizeof (Buf), Format, ap);
va_end (ap);
va_end (ap);
Warning ("%s(%u): %s", CfgFile, CfgErrorLine, Buf);
}
@ -109,7 +109,7 @@ void CfgError (const char* Format, ...)
Error ("%s(%u): %s", CfgFile, CfgErrorLine, Buf);
}
/*****************************************************************************/
@ -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 */
{
if (CfgIVal < Lo || CfgIVal > Hi) {

View File

@ -107,7 +107,7 @@ struct IdentTok_ {
#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;
@ -160,7 +160,7 @@ void CfgAssureStr (void);
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);

View File

@ -112,9 +112,9 @@ char *nextWord() {
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) {

View File

@ -2,7 +2,7 @@
# gcc Makefile for grc
#
CFLAGS = -g -O2 -Wall
CFLAGS = -g -O2 -Wall -W
CC = gcc
LDFLAGS =
EBIND = emxbind

View File

@ -213,7 +213,7 @@ void ConDesSetSegName (unsigned Type, const char* SegName)
/* 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);
@ -228,7 +228,7 @@ void ConDesSetLabel (unsigned Type, const char* Name)
/* 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);
@ -243,7 +243,7 @@ void ConDesSetCountSym (unsigned Type, const char* Name)
/* 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);
@ -258,7 +258,7 @@ void ConDesSetOrder (unsigned Type, ConDesOrder Order)
/* 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;
@ -270,7 +270,7 @@ int ConDesHasSegName (unsigned Type)
/* 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);
}
@ -281,7 +281,7 @@ int ConDesHasLabel (unsigned Type)
/* 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);
}

View File

@ -304,7 +304,7 @@ int main (int argc, char* argv [])
{ "--version", 0, OptVersion },
};
int I;
unsigned I;
/* Initialize the cmdline module */
InitCmdLine (&argc, &argv, "ld65");
@ -433,7 +433,7 @@ int main (int argc, char* argv [])
}
if (LabelFileName) {
CreateLabelFile ();
}
}
if (DbgFileName) {
CreateDbgFile ();
}

View File

@ -7,7 +7,7 @@ COMMON = ../common
# 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=

View File

@ -265,7 +265,7 @@ int main (int argc, char* argv [])
{ "--version", 0, OptVersion },
};
int I;
unsigned I;
/* Initialize the cmdline module */
InitCmdLine (&argc, &argv, "od65");

View File

@ -6,7 +6,7 @@
# 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=