X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=common.h;h=0e865c482707af25dceb6fcaee7d48f799e5b201;hb=6ecd0010931a988792e672e1fe0a1192fca7b002;hp=3df8b0cdff3922dd149b420354734f4e84062829;hpb=04eca720d9a5282b47f51c5d19910a094f3d1882;p=open-adventure.git diff --git a/common.h b/common.h index 3df8b0c..0e865c4 100644 --- a/common.h +++ b/common.h @@ -9,7 +9,7 @@ extern const char advent_to_ascii[128]; extern const char ascii_to_advent[128]; -enum bug_e { +enum bugtype { MESSAGE_LINE_GT_70_CHARACTERS, // 0 NULL_LINE_IN_MESSAGE, // 1 TOO_MANY_WORDS_OF_MESSAGES, // 2 @@ -30,18 +30,13 @@ enum bug_e { CONDITIONAL_TRAVEL_ENTRY_WITH_NO_ALTERATION, // 25 LOCATION_HAS_NO_TRAVEL_ENTRIES, // 26 HINT_NUMBER_EXCEEDS_GOTO_LIST, // 27 - INVALID_MOTH_RETURNED_BY_DATA_FUNCTION, // 28 - TOO_MANY_PARAMETERS_GIVEN_TO_SETPRM, // 29 + TOO_MANY_PARAMETERS_GIVEN_TO_SETPRM, // 28 SPEECHPART_NOT_TRANSITIVE_OR_INTRANSITIVE_OR_UNKNOWN=99, // 99 ACTION_RETURNED_PHASE_CODE_BEYOND_END_OF_SWITCH, // 100 }; -static inline void bug(enum bug_e num, const char *error_string) __attribute__((__noreturn__)); -static inline void bug(enum bug_e num, const char *error_string) -{ - fprintf(stderr, "Fatal error %d, %s.\n", num, error_string); - exit(EXIT_FAILURE); -} +/* Alas, declaring this static confuses the coverage analyzer */ +void bug(enum bugtype, const char *) __attribute__((__noreturn__)); #define BUG(x) bug(x, #x)