mirror of
https://github.com/cc65/cc65.git
synced 2024-06-15 02:29:32 +00:00
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:
parent
8fe317e7fa
commit
18246278c5
|
@ -54,7 +54,7 @@ $(WORKDIR):
|
||||||
|
|
||||||
$(WORKDIR)/%.ref: %.c | $(WORKDIR)
|
$(WORKDIR)/%.ref: %.c | $(WORKDIR)
|
||||||
$(if $(QUIET),echo ref/$*.host)
|
$(if $(QUIET),echo ref/$*.host)
|
||||||
$(CC) $(CFLAGS) -DREFCC -o $(WORKDIR)/$*.host $< $(NULLERR)
|
$(CC) $(CFLAGS) -o $(WORKDIR)/$*.host $< $(NULLERR)
|
||||||
$(WORKDIR)$S$*.host > $@
|
$(WORKDIR)$S$*.host > $@
|
||||||
|
|
||||||
$(DIFF): ../bdiff.c | $(WORKDIR)
|
$(DIFF): ../bdiff.c | $(WORKDIR)
|
||||||
|
|
|
@ -37,20 +37,8 @@ void testlimits(int i) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void testdefault1(unsigned char i) {
|
void testdefault1(unsigned char i) {
|
||||||
/* we want a signed char */
|
|
||||||
#ifdef REFCC
|
|
||||||
|
|
||||||
signed char k;
|
signed char k;
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#ifdef UNSIGNED_CHARS
|
|
||||||
signed char k;
|
|
||||||
#else
|
|
||||||
char k;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
for(;i<254;) {
|
for(;i<254;) {
|
||||||
k = i;
|
k = i;
|
||||||
|
@ -138,20 +126,8 @@ char k;
|
||||||
}
|
}
|
||||||
|
|
||||||
void testdefault2(unsigned char i) {
|
void testdefault2(unsigned char i) {
|
||||||
/* we want a unsigned char */
|
|
||||||
#ifdef REFCC
|
|
||||||
|
|
||||||
unsigned char k;
|
unsigned char k;
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#ifdef UNSIGNED_CHARS
|
|
||||||
char k;
|
|
||||||
#else
|
|
||||||
unsigned char k;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
for(;i<254;) {
|
for(;i<254;) {
|
||||||
k = i;
|
k = i;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user