bulk changes, forgot what ;-)
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user