Fix the option for testing radix sort

Add a check to make sure I don't make the same mistake again
This commit is contained in:
Eric Fischer 2016-04-14 10:06:01 -07:00
parent 222735004d
commit 732a51d684
2 changed files with 23 additions and 1 deletions

View File

@ -2483,6 +2483,28 @@ int main(int argc, char **argv) {
additional[i] = 0;
}
{
char dup[256];
memset(dup, 0, sizeof(dup));
for (i = 0; i < sizeof(additional_options) / sizeof(additional_options[0]); i++) {
if (dup[additional_options[i]]) {
fprintf(stderr, "Internal error: reused -a%c\n", additional_options[i]);
exit(EXIT_FAILURE);
}
dup[additional_options[i]] = 1;
}
memset(dup, 0, sizeof(dup));
for (i = 0; i < sizeof(prevent_options) / sizeof(prevent_options[0]); i++) {
if (dup[prevent_options[i]]) {
fprintf(stderr, "Internal error: reused -p%c\n", prevent_options[i]);
exit(EXIT_FAILURE);
}
dup[prevent_options[i]] = 1;
}
}
static struct option long_options[] = {
{"name", required_argument, 0, 'n'},
{"layer", required_argument, 0, 'l'},

2
tile.h
View File

@ -52,7 +52,7 @@ static int additional_options[] = {
A_LINE_DROP,
#define A_POLYGON_DROP ((int) 'p')
A_POLYGON_DROP,
#define A_PREFER_RADIX_SORT ((int) 'r')
#define A_PREFER_RADIX_SORT ((int) 'R')
A_PREFER_RADIX_SORT,
};