From 732a51d68485080c9d0139e15f95a406e7e1d755 Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Thu, 14 Apr 2016 10:06:01 -0700 Subject: [PATCH] Fix the option for testing radix sort Add a check to make sure I don't make the same mistake again --- geojson.c | 22 ++++++++++++++++++++++ tile.h | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/geojson.c b/geojson.c index 7b427d48..801c5a22 100644 --- a/geojson.c +++ b/geojson.c @@ -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'}, diff --git a/tile.h b/tile.h index 904fef80..bbcb35fb 100644 --- a/tile.h +++ b/tile.h @@ -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, };