diff options
author | Andrea Canciani <ranma42@gmail.com> | 2011-10-02 16:15:59 -0700 |
---|---|---|
committer | Andrea Canciani <ranma42@gmail.com> | 2011-11-12 20:49:08 +0100 |
commit | 6a0ba303035997fcd5f28bcd32297f9bc21bd45a (patch) | |
tree | ad6dfc64e0bf363d3201c286554d983b1cad342d | |
parent | 0e18cc6d27e59e42c6632b21c5502174c8a9eb08 (diff) |
Sort option flags
Keep the option flags in alphabetical order. This makes it easier to
check for collisions or missing handlers.
Avoids an internal error when passing flags -c, -r or -v to
cairo-analyse-trace.
-rw-r--r-- | perf/cairo-analyse-trace.c | 2 | ||||
-rw-r--r-- | perf/cairo-perf-micro.c | 12 | ||||
-rw-r--r-- | perf/cairo-perf-trace.c | 24 | ||||
-rw-r--r-- | test/cairo-test-runner.c | 16 | ||||
-rw-r--r-- | test/cairo-test-trace.c | 2 |
5 files changed, 28 insertions, 28 deletions
diff --git a/perf/cairo-analyse-trace.c b/perf/cairo-analyse-trace.c index ac2a4e7a..6cd77f67 100644 --- a/perf/cairo-analyse-trace.c +++ b/perf/cairo-analyse-trace.c @@ -330,7 +330,7 @@ parse_options (cairo_perf_t *perf, perf->num_exclude_names = 0; while (1) { - c = _cairo_getopt (argc, argv, "i:x:lrvc"); + c = _cairo_getopt (argc, argv, "i:lx:"); if (c == -1) break; diff --git a/perf/cairo-perf-micro.c b/perf/cairo-perf-micro.c index 61ed55fc..63aad712 100644 --- a/perf/cairo-perf-micro.c +++ b/perf/cairo-perf-micro.c @@ -361,11 +361,16 @@ parse_options (cairo_perf_t *perf, perf->summary = stdout; while (1) { - c = _cairo_getopt (argc, argv, "i:lrvf"); + c = _cairo_getopt (argc, argv, "fi:lrv"); if (c == -1) break; switch (c) { + case 'f': + perf->fast_and_sloppy = TRUE; + if (ms == NULL) + perf->ms_per_iteration = CAIRO_PERF_ITERATION_MS_FAST; + break; case 'i': perf->exact_iterations = TRUE; perf->iterations = strtoul (optarg, &end, 10); @@ -382,11 +387,6 @@ parse_options (cairo_perf_t *perf, perf->raw = TRUE; perf->summary = NULL; break; - case 'f': - perf->fast_and_sloppy = TRUE; - if (ms == NULL) - perf->ms_per_iteration = CAIRO_PERF_ITERATION_MS_FAST; - break; case 'v': verbose = 1; break; diff --git a/perf/cairo-perf-trace.c b/perf/cairo-perf-trace.c index 8e637a7d..3e5ba95a 100644 --- a/perf/cairo-perf-trace.c +++ b/perf/cairo-perf-trace.c @@ -445,11 +445,14 @@ parse_options (cairo_perf_t *perf, perf->num_exclude_names = 0; while (1) { - c = _cairo_getopt (argc, argv, "t:i:x:lsrvc"); + c = _cairo_getopt (argc, argv, "ci:lrst:vx:"); if (c == -1) break; switch (c) { + case 'c': + use_surface_cache = 1; + break; case 'i': perf->exact_iterations = TRUE; perf->iterations = strtoul (optarg, &end, 10); @@ -459,14 +462,6 @@ parse_options (cairo_perf_t *perf, exit (1); } break; - case 't': - perf->tile_size = strtoul (optarg, &end, 10); - if (*end != '\0') { - fprintf (stderr, "Invalid argument for -t (not an integer): %s\n", - optarg); - exit (1); - } - break; case 'l': perf->list_only = TRUE; break; @@ -477,12 +472,17 @@ parse_options (cairo_perf_t *perf, case 's': perf->observe = TRUE; break; + case 't': + perf->tile_size = strtoul (optarg, &end, 10); + if (*end != '\0') { + fprintf (stderr, "Invalid argument for -t (not an integer): %s\n", + optarg); + exit (1); + } + break; case 'v': verbose = 1; break; - case 'c': - use_surface_cache = 1; - break; case 'x': if (! read_excludes (perf, optarg)) { fprintf (stderr, "Invalid argument for -x (not readable file): %s\n", diff --git a/test/cairo-test-runner.c b/test/cairo-test-runner.c index 28e4b5dc..c0a7e953 100644 --- a/test/cairo-test-runner.c +++ b/test/cairo-test-runner.c @@ -367,7 +367,7 @@ _parse_cmdline (cairo_test_runner_t *runner, int *argc, char **argv[]) int c; while (1) { - c = _cairo_getopt (*argc, *argv, ":afkxsl"); + c = _cairo_getopt (*argc, *argv, ":afklsx"); if (c == -1) break; @@ -375,21 +375,21 @@ _parse_cmdline (cairo_test_runner_t *runner, int *argc, char **argv[]) case 'a': runner->full_test = TRUE; break; - case 's': - runner->slow = TRUE; + case 'f': + runner->foreground = TRUE; + break; + case 'k': + runner->keyword_match = TRUE; break; case 'l': runner->list_only = TRUE; break; - case 'f': - runner->foreground = TRUE; + case 's': + runner->slow = TRUE; break; case 'x': runner->exit_on_failure = TRUE; break; - case 'k': - runner->keyword_match = TRUE; - break; default: fprintf (stderr, "Internal error: unhandled option: %c\n", c); /* fall-through */ diff --git a/test/cairo-test-trace.c b/test/cairo-test-trace.c index fb1bd422..89ef6516 100644 --- a/test/cairo-test-trace.c +++ b/test/cairo-test-trace.c @@ -1554,7 +1554,7 @@ parse_options (test_trace_t *test, int argc, char *argv[]) test->num_exclude_names = 0; while (1) { - c = _cairo_getopt (argc, argv, "x:l"); + c = _cairo_getopt (argc, argv, "lx:"); if (c == -1) break; |