/* Tokens for the #pragmas */
typedef enum {
+ PR_ILLEGAL = -1,
PR_BSSSEG,
PR_CHARMAP,
PR_CHECKSTACK,
PR_RODATASEG,
PR_SIGNEDCHARS,
PR_STATICLOCALS,
- PR_ZPSYM,
- PR_ILLEGAL
+ PR_ZPSYM,
+ PR_COUNT
} pragma_t;
/* Pragma table */
static const struct Pragma {
const char* Key; /* Keyword */
pragma_t Tok; /* Token */
-} Pragmas[] = {
+} Pragmas[PR_COUNT] = {
{ "bssseg", PR_BSSSEG },
{ "charmap", PR_CHARMAP },
{ "checkstack", PR_CHECKSTACK },
{ "zpsym", PR_ZPSYM },
};
-/* Number of pragmas */
-#define PRAGMA_COUNT (sizeof(Pragmas) / sizeof(Pragmas[0]))
-
/*****************************************************************************/
*/
{
struct Pragma* P;
- P = bsearch (Key, Pragmas, PRAGMA_COUNT, sizeof (Pragmas[0]), CmpKey);
+ P = bsearch (Key, Pragmas, PR_COUNT, sizeof (Pragmas[0]), CmpKey);
return P? P->Tok : PR_ILLEGAL;
}