bulk changes, forgot what ;-)

This commit is contained in:
2021-09-08 16:51:29 +02:00
parent 10f4f8572d
commit 9a3d216a65
6 changed files with 8 additions and 10 deletions

View File

@@ -4,10 +4,9 @@
#include <stdlib.h>
#endif
resistor_band_t color_code(resistor_band_t *colors)
resistor_band_t color_code(resistor_band_t colors[static 2])
{
resistor_band_t c1=*colors, c2=*(colors+1);
return c1>=BLACK && c1<=WHITE && c2>=BLACK && c2<=WHITE? c1*10+c2: ERROR;
}
@@ -19,7 +18,7 @@ int main(int ac, char **av)
for (; arg<ac-1; ++arg, ++arg) {
*i=atoi(av[arg]);
*(i+1)=atoi(av[arg+1]);
//*(i+1)=atoi(av[arg+1]);
printf("color(%d, %d)=%d\n", i[0], i[1], color_code(i));
}
}

View File

@@ -15,7 +15,7 @@ typedef enum {
ERROR=-1,
} resistor_band_t;
extern resistor_band_t color_code(resistor_band_t *);
extern resistor_band_t color_code(resistor_band_t [static 2]);
#ifdef TESTALL
#undef TEST_IGNORE