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.
This commit is contained in:
Jesse Rosenstock 2020-06-25 08:54:58 +02:00 committed by Oliver Schmidt
parent 8fe317e7fa
commit 18246278c5
2 changed files with 3 additions and 27 deletions

View File

@ -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)

View File

@ -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;