generate CSA for empty case statement, replaced an #ifdef that was on the wrong spot

This commit is contained in:
ceriel 1987-11-13 16:21:33 +00:00
parent 808e5d8c7d
commit 7bbfcac62b
2 changed files with 6 additions and 3 deletions

View file

@ -112,6 +112,7 @@ deleted, is now a debug-flag
} }
#ifdef ___XXX___ #ifdef ___XXX___
deleted, is now a debug-flag
case 'E' : /* run preprocessor only, with #<int> */ case 'E' : /* run preprocessor only, with #<int> */
#ifndef NOPP #ifndef NOPP
options['E'] = 1; options['E'] = 1;
@ -161,6 +162,7 @@ deleted, is now a debug-flag
break; break;
#ifdef ___XXX___ #ifdef ___XXX___
deleted, is now a debug-flag
case 'P' : /* run preprocessor stand-alone, without #'s */ case 'P' : /* run preprocessor stand-alone, without #'s */
#ifndef NOPP #ifndef NOPP
options['E'] = 1; options['E'] = 1;
@ -171,8 +173,8 @@ deleted, is now a debug-flag
break; break;
#endif ___XXX___ #endif ___XXX___
#ifdef USE_TMP
case 'T' : { case 'T' : {
#ifdef USE_TMP
extern char *C_tmpdir; extern char *C_tmpdir;
if (*text) if (*text)
C_tmpdir = text; C_tmpdir = text;

View file

@ -33,7 +33,7 @@ compact(nr, low, up)
*/ */
arith diff = up - low; 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; static struct switch_hdr *switch_stack = 0;
@ -106,7 +106,8 @@ code_endswitch()
C_rom_cst(sh->sh_lowerbd); C_rom_cst(sh->sh_lowerbd);
C_rom_cst(sh->sh_upperbd - sh->sh_lowerbd); C_rom_cst(sh->sh_upperbd - sh->sh_lowerbd);
ce = sh->sh_entries; 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); ASSERT(ce);
if (val == ce->ce_value) { if (val == ce->ce_value) {
C_rom_ilb(ce->ce_label); C_rom_ilb(ce->ce_label);