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);