From: ceriel Date: Fri, 13 Nov 1987 16:21:33 +0000 (+0000) Subject: generate CSA for empty case statement, replaced an #ifdef that was on the wrong spot X-Git-Tag: release-5-5~3727 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=7bbfcac62ba5077147d0b533d6c84d4a73ceaf73;p=ack.git generate CSA for empty case statement, replaced an #ifdef that was on the wrong spot --- diff --git a/lang/cem/cemcom/options.c b/lang/cem/cemcom/options.c index b333734dd..66dda1a3d 100644 --- a/lang/cem/cemcom/options.c +++ b/lang/cem/cemcom/options.c @@ -112,6 +112,7 @@ deleted, is now a debug-flag } #ifdef ___XXX___ +deleted, is now a debug-flag case 'E' : /* run preprocessor only, with # */ #ifndef NOPP options['E'] = 1; @@ -161,6 +162,7 @@ deleted, is now a debug-flag break; #ifdef ___XXX___ +deleted, is now a debug-flag case 'P' : /* run preprocessor stand-alone, without #'s */ #ifndef NOPP options['E'] = 1; @@ -171,8 +173,8 @@ deleted, is now a debug-flag break; #endif ___XXX___ -#ifdef USE_TMP case 'T' : { +#ifdef USE_TMP extern char *C_tmpdir; if (*text) C_tmpdir = text; diff --git a/lang/cem/cemcom/switch.c b/lang/cem/cemcom/switch.c index 80b6a96ee..3f4f63ad8 100644 --- a/lang/cem/cemcom/switch.c +++ b/lang/cem/cemcom/switch.c @@ -33,7 +33,7 @@ compact(nr, low, up) */ arith diff = up - low; - return (nr != 0 && diff >= 0 && diff / nr <= (DENSITY - 1)); + return (nr == 0 || (diff >= 0 && diff / nr <= (DENSITY - 1))); } static struct switch_hdr *switch_stack = 0; @@ -106,7 +106,8 @@ code_endswitch() C_rom_cst(sh->sh_lowerbd); C_rom_cst(sh->sh_upperbd - sh->sh_lowerbd); ce = sh->sh_entries; - for (val = sh->sh_lowerbd; val <= sh->sh_upperbd; val++) { + if (sh->sh_nrofentries) + for (val = sh->sh_lowerbd; val <= sh->sh_upperbd; val++) { ASSERT(ce); if (val == ce->ce_value) { C_rom_ilb(ce->ce_label);