diff --git a/cobc/error.c b/cobc/error.c index 61421b95d..203b67094 100644 --- a/cobc/error.c +++ b/cobc/error.c @@ -136,11 +136,14 @@ print_error (const char *file, int line, enum cb_error_kind kind, { const char *prefix; - switch( kind ){ + switch (kind) { case CB_KIND_ERROR: prefix = _("error: "); break; case CB_KIND_WARNING: prefix = _("warning: "); break; case CB_KIND_NOTE: prefix = _("note: "); break; case CB_KIND_GENERAL: prefix = ""; break; + default: + cobc_err_msg ("call to print_error with unexpected error kind"); + cobc_abort_terminate (1); } if (!file) { diff --git a/cobc/replace.c b/cobc/replace.c index ab04beeb9..49e28619e 100644 --- a/cobc/replace.c +++ b/cobc/replace.c @@ -244,26 +244,24 @@ token_list_add (WITH_DEPTH struct cb_token_list *list, return p; } else { struct cb_token_list *cursor = list; - for(;cursor->next != NULL; cursor = cursor->next); + for (; cursor->next != NULL; cursor = cursor->next); cursor->next = p; return list; } } - - static -const void pop_token (WITH_DEPTH struct cb_replacement_state *repls, +void pop_token (WITH_DEPTH struct cb_replacement_state *repls, const char **text, const char **token) { - const struct cb_token_list *q = repls->token_queue ; + const struct cb_token_list *q = repls->token_queue; repls->token_queue = q->next ; #ifdef DEBUG_REPLACE_TRACE fprintf (stderr, "%spop_token(%s) -> '%s'\n", DEPTH, repls->name, q->text); #endif - if (text) *text = q->text ; - if (token) *token = q->token ; + if (text) *text = q->text; + if (token) *token = q->token; } static @@ -417,7 +415,7 @@ void check_replace (WITH_DEPTH struct cb_replacement_state* repls, replace_list = replace_list->next; if (src->lead_trail == CB_REPLACE_LEADING - || src->lead_trail == CB_REPLACE_TRAILING){ + || src->lead_trail == CB_REPLACE_TRAILING){ /* LEADING and TRAILING replacements are * different: they match only on one text, so * we just need one test to decide if it is a