From fd6846c99f00e265f558cf0106c833b96caf977f Mon Sep 17 00:00:00 2001 From: Damien Lespiau Date: Thu, 14 May 2015 14:19:01 +0100 Subject: lib: Add a user data pointer to the argument parsing functions It can be useful to have one of those to carry state between the handler parsing the options and the rest of the test. Right now the only thing we can do is to use global variables for that. Signed-off-by: Damien Lespiau --- tests/gem_ctx_basic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/gem_ctx_basic.c') diff --git a/tests/gem_ctx_basic.c b/tests/gem_ctx_basic.c index 9e9d925d..9aad7f84 100644 --- a/tests/gem_ctx_basic.c +++ b/tests/gem_ctx_basic.c @@ -120,7 +120,7 @@ static void *work(void *arg) pthread_exit(NULL); } -static int opt_handler(int opt, int opt_index) +static int opt_handler(int opt, int opt_index, void *data) { switch (opt) { case 'i': @@ -145,7 +145,7 @@ int main(int argc, char *argv[]) int i; igt_simple_init_parse_opts(&argc, argv, "i:c:n:mu", NULL, NULL, - opt_handler); + opt_handler, NULL); fd = drm_open_any_render(); devid = intel_get_drm_devid(fd); -- cgit v1.2.3