diff options
author | Pekka Paalanen <pekka.paalanen@collabora.co.uk> | 2015-06-10 11:14:38 +0300 |
---|---|---|
committer | Pekka Paalanen <pekka.paalanen@collabora.co.uk> | 2015-07-06 12:03:28 +0300 |
commit | bddff993ed734f4b9030c1960bcb3ebe1caca807 (patch) | |
tree | 2a893678a6ede3b667d90b0a4450d692f7bd963a | |
parent | 2be523b20402b7c9f548ac33b8c0f0ed00156c64 (diff) |
lowlevel-blt-bench: move usage to a function
Move printing of usage into a new function and use argv[0] as the
program name. This will help printing usage from multiple places.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Ben Avison <bavison@riscosopen.org>
-rw-r--r-- | test/lowlevel-blt-bench.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/test/lowlevel-blt-bench.c b/test/lowlevel-blt-bench.c index aff4608..69202ee 100644 --- a/test/lowlevel-blt-bench.c +++ b/test/lowlevel-blt-bench.c @@ -976,6 +976,14 @@ run_default_tests (double bandwidth_) run_one_test (tests_tbl[i].testname, bandwidth_); } +static void +usage (const char *progname) +{ + printf ("Usage: %s [-b] [-n] pattern\n", progname); + printf (" -n : benchmark nearest scaling\n"); + printf (" -b : benchmark bilinear scaling\n"); +} + int main (int argc, char *argv[]) { @@ -1005,9 +1013,7 @@ main (int argc, char *argv[]) if (!pattern) { - printf ("Usage: lowlevel-blt-bench [-b] [-n] pattern\n"); - printf (" -n : benchmark nearest scaling\n"); - printf (" -b : benchmark bilinear scaling\n"); + usage (argv[0]); return 1; } |