/* */
/* */
/* (C) 1998-2003 Ullrich von Bassewitz */
-/* Römerstrasse 52 */
+/* Römerstraße 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* */
/* Given a pointer to the user entry data, return a pointer to the hash node */
static int HT_Compare (const void* Key1, const void* Key2);
-/* Compare two keys for equality */
+/* Compare two keys. The function must return a value less than zero if
+ * Key1 is smaller than Key2, zero if both are equal, and a value greater
+ * than zero if Key1 is greater then Key2.
+ */
static int HT_Compare (const void* Key1, const void* Key2)
-/* Compare two keys for equality */
+/* Compare two keys. The function must return a value less than zero if
+ * Key1 is smaller than Key2, zero if both are equal, and a value greater
+ * than zero if Key1 is greater then Key2.
+ */
{
- return (strcmp (Key1, Key2) == 0);
+ return strcmp (Key1, Key2);
}
if (Tok != TOK_EOF) {
SkipUntilSep ();
} else {
- Error (ERR_ENDMACRO_EXPECTED);
+ Error ("`.ENDMACRO' expected");
}
} else {
/* Skip until end of line */
/* We expect a macro name here */
if (Tok != TOK_IDENT) {
- Error (ERR_IDENT_EXPECTED);
+ Error ("Identifier expected");
MacSkipDef (Style);
return;
}
/* Did we already define that macro? */
if (HT_Find (&MacroTab, SVal) != 0) {
/* Macro is already defined */
- Error (ERR_SYM_ALREADY_DEFINED, SVal);
+ Error ("A macro named `%s' is already defined", SVal);
/* Skip tokens until we reach the final .endmacro */
MacSkipDef (Style);
return;
IdDesc* List = M->Params;
while (1) {
if (strcmp (List->Id, SVal) == 0) {
- Error (ERR_SYM_ALREADY_DEFINED, SVal);
- }
+ Error ("Duplicate symbol `%s'", SVal);
+ }
if (List->Next == 0) {
break;
} else {
}
/* May not have end of file in a macro definition */
if (Tok == TOK_EOF) {
- Error (ERR_ENDMACRO_EXPECTED);
+ Error ("`.ENDMACRO' expected");
goto Done;
}
} else {
/* Need an identifer */
if (Tok != TOK_IDENT) {
- Error (ERR_IDENT_EXPECTED);
+ Error ("Identifier expected");
SkipUntilSep ();
break;
}
/* Check for maximum parameter count */
if (E->ParamCount >= M->ParamCount) {
- Error (ERR_TOO_MANY_PARAMS);
- SkipUntilSep ();
+ Error ("Too many macro parameters");
+ SkipUntilSep ();
break;
}
/* Check for end of file */
if (Tok == TOK_EOF) {
- Error (ERR_UNEXPECTED_EOF);
+ Error ("Unexpected end of file");
return;
}
/* Check if there is really a parameter */
if (TokIsSep (Tok) || Tok == TOK_COMMA) {
- Error (ERR_MACRO_PARAM_EXPECTED);
+ Error ("Macro parameter expected");
SkipUntilSep ();
return;
}
if (Tok == TOK_COMMA) {
NextTok ();
} else {
- Error (ERR_COMMA_EXPECTED);
+ Error ("`,' expected");
}
}
}