From 8f057fd84d35db427d779b6295be5f9308c275a2 Mon Sep 17 00:00:00 2001 From: cuz Date: Sat, 15 Sep 2001 12:13:33 +0000 Subject: [PATCH] Fixed a few warnings git-svn-id: svn://svn.cc65.org/cc65/trunk@936 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/cc65/coptind.c | 10 +++++----- src/cc65/expr.c | 2 +- src/cc65/exprnode.c | 2 +- src/cc65/make/gcc.mak | 2 +- src/cc65/preproc.c | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/cc65/coptind.c b/src/cc65/coptind.c index 24bc260db..ddd78a325 100644 --- a/src/cc65/coptind.c +++ b/src/cc65/coptind.c @@ -673,7 +673,7 @@ unsigned OptDuplicateLoads (CodeSeg* S) case OP65_LDA: if (E->RI->In.RegA >= 0 && /* Value of A is known */ CE_KnownImm (E) && /* Value to be loaded is known */ - E->RI->In.RegA == E->Num && /* Both are equal */ + E->RI->In.RegA == (long) E->Num && /* Both are equal */ (N = CS_GetNextEntry (S, I)) != 0 && /* There is a next entry */ (N->Info & OF_FBRA) == 0) { /* Which is not a cond branch */ Delete = 1; @@ -683,7 +683,7 @@ unsigned OptDuplicateLoads (CodeSeg* S) case OP65_LDX: if (E->RI->In.RegX >= 0 && /* Value of X is known */ CE_KnownImm (E) && /* Value to be loaded is known */ - E->RI->In.RegX == E->Num && /* Both are equal */ + E->RI->In.RegX == (long) E->Num && /* Both are equal */ (N = CS_GetNextEntry (S, I)) != 0 && /* There is a next entry */ (N->Info & OF_FBRA) == 0) { /* Which is not a cond branch */ Delete = 1; @@ -693,7 +693,7 @@ unsigned OptDuplicateLoads (CodeSeg* S) case OP65_LDY: if (E->RI->In.RegY >= 0 && /* Value of Y is known */ CE_KnownImm (E) && /* Value to be loaded is known */ - E->RI->In.RegY == E->Num && /* Both are equal */ + E->RI->In.RegY == (long) E->Num && /* Both are equal */ (N = CS_GetNextEntry (S, I)) != 0 && /* There is a next entry */ (N->Info & OF_FBRA) == 0) { /* Which is not a cond branch */ Delete = 1; @@ -900,11 +900,11 @@ unsigned OptTransfers (CodeSeg* S) goto NextEntry; } } - + /* Remove both transfers */ CS_DelEntry (S, I+1); CS_DelEntry (S, I); - + /* Remember, we had changes */ ++Changes; } diff --git a/src/cc65/expr.c b/src/cc65/expr.c index 525651945..a26935902 100644 --- a/src/cc65/expr.c +++ b/src/cc65/expr.c @@ -411,7 +411,7 @@ static int kcalc (int tok, long val1, long val2) -static GenDesc* FindGen (int Tok, GenDesc** Table) +static GenDesc* FindGen (token_t Tok, GenDesc** Table) { GenDesc* G; while ((G = *Table) != 0) { diff --git a/src/cc65/exprnode.c b/src/cc65/exprnode.c index a5cf4aef1..8bffe688f 100644 --- a/src/cc65/exprnode.c +++ b/src/cc65/exprnode.c @@ -92,7 +92,7 @@ void SetItem (ExprNode* N, void* Item, unsigned Index) { if (Index >= CollCount (&N->List)) { /* Fill up with NULL pointers */ - while (Index >= CollCount (&N->List) < Index) { + while (Index >= CollCount (&N->List)) { CollAppend (&N->List, 0); } /* Append the new item */ diff --git a/src/cc65/make/gcc.mak b/src/cc65/make/gcc.mak index 5facfeaaa..fb5478529 100644 --- a/src/cc65/make/gcc.mak +++ b/src/cc65/make/gcc.mak @@ -14,7 +14,7 @@ COMMON = ../common # Default for the compiler lib search path as compiler define CDEFS=-DCC65_INC=\"/usr/lib/cc65/include/\" -CFLAGS = -O2 -g -Wall -I$(COMMON) $(CDEFS) +CFLAGS = -O2 -g -Wall -W -Wno-unused-parameter -I$(COMMON) $(CDEFS) CC=gcc EBIND=emxbind LDFLAGS= diff --git a/src/cc65/preproc.c b/src/cc65/preproc.c index c95bbb92c..8922c7733 100644 --- a/src/cc65/preproc.c +++ b/src/cc65/preproc.c @@ -314,7 +314,7 @@ static void ExpandMacroArgs (Macro* M) static int MacroCall (Macro* M) /* Process a function like macro */ { - unsigned ArgCount; /* Macro argument count */ + int ArgCount; /* Macro argument count */ unsigned ParCount; /* Number of open parenthesis */ char Buf[LINESIZE]; /* Argument buffer */ const char* ArgStart; @@ -355,7 +355,7 @@ static int MacroCall (Macro* M) if (ArgCount < M->ArgCount) { M->ActualArgs[ArgCount++] = ArgStart; } else if (CurC != ')' || *ArgStart != '\0' || M->ArgCount > 0) { - /* Be sure not to count the single empty argument for a + /* Be sure not to count the single empty argument for a * macro that does not have arguments. */ ++ArgCount;