Use __attribute ((unused)) instead of -Wno-unused-parameter

git-svn-id: svn://svn.cc65.org/cc65/trunk@988 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2001-09-30 22:19:39 +00:00
parent 453a8b704f
commit 91dac51780
13 changed files with 125 additions and 103 deletions

View File

@@ -129,7 +129,8 @@ void ClearLineInfo (void)
static int CmpLineInfo (void* Data, const void* LI1_, const void* LI2_)
static int CmpLineInfo (void* Data attribute ((unused)),
const void* LI1_, const void* LI2_)
/* Compare function for the sort */
{
/* Cast the pointers */
@@ -161,7 +162,7 @@ static int CmpLineInfo (void* Data, const void* LI1_, const void* LI2_)
}
}
void MakeLineInfoIndex (void)
/* Sort the line infos and drop all unreferenced ones */

View File

@@ -758,7 +758,7 @@ void MacAbort (void)
int IsMacro (const char* Name)
/* Return true if the given name is the name of a macro */
{
return MacFind (SVal, HashStr (SVal) % HASHTAB_SIZE) != 0;
return MacFind (Name, HashStr (Name) % HASHTAB_SIZE) != 0;
}
@@ -766,7 +766,7 @@ int IsMacro (const char* Name)
int IsDefine (const char* Name)
/* Return true if the given name is the name of a define style macro */
{
Macro* M = MacFind (SVal, HashStr (SVal) % HASHTAB_SIZE);
Macro* M = MacFind (Name, HashStr (Name) % HASHTAB_SIZE);
return (M != 0 && M->Style == MAC_STYLE_DEFINE);
}

View File

@@ -186,7 +186,8 @@ static void DefineSymbol (const char* Def)
static void OptAutoImport (const char* Opt, const char* Arg)
static void OptAutoImport (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Mark unresolved symbols as imported */
{
AutoImport = 1;
@@ -194,12 +195,9 @@ static void OptAutoImport (const char* Opt, const char* Arg)
static void OptCPU (const char* Opt, const char* Arg)
static void OptCPU (const char* Opt attribute ((unused)), const char* Arg)
/* Handle the --cpu option */
{
if (Arg == 0) {
NeedArg (Opt);
}
if (strcmp (Arg, "6502") == 0) {
SetCPU (CPU_6502);
} else if (strcmp (Arg, "65C02") == 0) {
@@ -217,7 +215,8 @@ static void OptCPU (const char* Opt, const char* Arg)
static void OptDebugInfo (const char* Opt, const char* Arg)
static void OptDebugInfo (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Add debug info to the object file */
{
DbgSyms = 1;
@@ -225,7 +224,7 @@ static void OptDebugInfo (const char* Opt, const char* Arg)
static void OptFeature (const char* Opt, const char* Arg)
static void OptFeature (const char* Opt attribute ((unused)), const char* Arg)
/* Set an emulation feature */
{
/* Set the feature, check for errors */
@@ -236,7 +235,8 @@ static void OptFeature (const char* Opt, const char* Arg)
static void OptHelp (const char* Opt, const char* Arg)
static void OptHelp (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Print usage information and exit */
{
Usage ();
@@ -245,7 +245,8 @@ static void OptHelp (const char* Opt, const char* Arg)
static void OptIgnoreCase (const char* Opt, const char* Arg)
static void OptIgnoreCase (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Ignore case on symbols */
{
IgnoreCase = 1;
@@ -253,18 +254,16 @@ static void OptIgnoreCase (const char* Opt, const char* Arg)
static void OptIncludeDir (const char* Opt, const char* Arg)
static void OptIncludeDir (const char* Opt attribute ((unused)), const char* Arg)
/* Add an include search path */
{
if (Arg == 0) {
NeedArg (Opt);
}
AddIncludePath (Arg);
}
static void OptListing (const char* Opt, const char* Arg)
static void OptListing (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Create a listing file */
{
Listing = 1;
@@ -272,14 +271,10 @@ static void OptListing (const char* Opt, const char* Arg)
static void OptPageLength (const char* Opt, const char* Arg)
static void OptPageLength (const char* Opt attribute ((unused)), const char* Arg)
/* Handle the --pagelength option */
{
int Len;
if (Arg == 0) {
NeedArg (Opt);
}
Len = atoi (Arg);
int Len = atoi (Arg);
if (Len != -1 && (Len < MIN_PAGE_LEN || Len > MAX_PAGE_LEN)) {
AbEnd ("Invalid page length: %d", Len);
}
@@ -288,7 +283,8 @@ static void OptPageLength (const char* Opt, const char* Arg)
static void OptSmart (const char* Opt, const char* Arg)
static void OptSmart (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Handle the -s/--smart options */
{
SmartMode = 1;
@@ -296,13 +292,9 @@ static void OptSmart (const char* Opt, const char* Arg)
static void OptTarget (const char* Opt, const char* Arg)
static void OptTarget (const char* Opt attribute ((unused)), const char* Arg)
/* Set the target system */
{
if (Arg == 0) {
NeedArg (Opt);
}
/* Map the target name to a target id */
Target = FindTarget (Arg);
if (Target == TGT_UNKNOWN) {
@@ -312,7 +304,8 @@ static void OptTarget (const char* Opt, const char* Arg)
static void OptVerbose (const char* Opt, const char* Arg)
static void OptVerbose (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Increase verbosity */
{
++Verbosity;
@@ -320,7 +313,8 @@ static void OptVerbose (const char* Opt, const char* Arg)
static void OptVersion (const char* Opt, const char* Arg)
static void OptVersion (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Print the assembler version */
{
fprintf (stderr,

View File

@@ -5,7 +5,7 @@
# Library dir
COMMON = ../common
CFLAGS = -g -O2 -Wall -W -Wno-unused-parameter -I$(COMMON)
CFLAGS = -g -O2 -Wall -W -I$(COMMON)
CC = gcc
EBIND = emxbind
LDFLAGS =

View File

@@ -596,7 +596,7 @@ void SymConDes (const char* Name, unsigned Type, unsigned Prio)
CHECK (Type >= CD_TYPE_MIN && Type <= CD_TYPE_MAX);
#else
CHECK (Type <= CD_TYPE_MAX);
#endif
#endif
CHECK (Prio >= CD_PRIO_MIN && Prio <= CD_PRIO_MAX);
/* Don't accept local symbols */
@@ -1023,13 +1023,14 @@ void SymDump (FILE* F)
while (S) {
/* Ignore trampoline symbols */
if ((S->Flags & SF_TRAMPOLINE) != 0) {
printf ("%-24s %s %s %s %s %s\n",
S->Name,
(S->Flags & SF_DEFINED)? "DEF" : "---",
(S->Flags & SF_REFERENCED)? "REF" : "---",
(S->Flags & SF_IMPORT)? "IMP" : "---",
(S->Flags & SF_EXPORT)? "EXP" : "---",
(S->Flags & SF_ZP)? "ZP" : "--");
fprintf (F,
"%-24s %s %s %s %s %s\n",
S->Name,
(S->Flags & SF_DEFINED)? "DEF" : "---",
(S->Flags & SF_REFERENCED)? "REF" : "---",
(S->Flags & SF_IMPORT)? "IMP" : "---",
(S->Flags & SF_EXPORT)? "EXP" : "---",
(S->Flags & SF_ZP)? "ZP" : "--");
}
/* Next symbol */
S = S->List;