From 18246278c5fd65e0daab65de229ea3a3baf71104 Mon Sep 17 00:00:00 2001 From: Jesse Rosenstock Date: Thu, 25 Jun 2020 08:54:58 +0200 Subject: [PATCH] switch2.c: Remove use of REFCC and UNSIGNED_CHARS Explicitly use `signed char` or `unsigned char`, rather than ``` signed char k; char k; signed char k; char k; ``` This should have resulted in the same thing; however, note that `REFCC` was never defined, and `common.h` was not included, so the old code in fact tested `char` then `unsigned char`, which are the same. The only difference is that a switch using plain `char` is not tested, but since this is the same as either `signed char` or `unsigned char`, the lack of test coverage seems relatively safe. --- test/ref/Makefile | 2 +- test/ref/switch2.c | 28 ++-------------------------- 2 files changed, 3 insertions(+), 27 deletions(-) diff --git a/test/ref/Makefile b/test/ref/Makefile index be9fbed59..5f0b86164 100644 --- a/test/ref/Makefile +++ b/test/ref/Makefile @@ -54,7 +54,7 @@ $(WORKDIR): $(WORKDIR)/%.ref: %.c | $(WORKDIR) $(if $(QUIET),echo ref/$*.host) - $(CC) $(CFLAGS) -DREFCC -o $(WORKDIR)/$*.host $< $(NULLERR) + $(CC) $(CFLAGS) -o $(WORKDIR)/$*.host $< $(NULLERR) $(WORKDIR)$S$*.host > $@ $(DIFF): ../bdiff.c | $(WORKDIR) diff --git a/test/ref/switch2.c b/test/ref/switch2.c index 3b2ab23e6..78d383b52 100644 --- a/test/ref/switch2.c +++ b/test/ref/switch2.c @@ -37,20 +37,8 @@ void testlimits(int i) { } void testdefault1(unsigned char i) { -/* we want a signed char */ -#ifdef REFCC -signed char k; - -#else - -#ifdef UNSIGNED_CHARS -signed char k; -#else -char k; -#endif - -#endif + signed char k; for(;i<254;) { k = i; @@ -138,20 +126,8 @@ char k; } void testdefault2(unsigned char i) { -/* we want a unsigned char */ -#ifdef REFCC -unsigned char k; - -#else - -#ifdef UNSIGNED_CHARS -char k; -#else -unsigned char k; -#endif - -#endif + unsigned char k; for(;i<254;) { k = i;