mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-21 13:23:02 +00:00
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 <damien.lespiau@intel.com>
This commit is contained in:
+2
-2
@@ -662,7 +662,7 @@ static void run_test(const struct test_config *tconf)
|
||||
test_combinations(tconf, connector_num);
|
||||
}
|
||||
|
||||
static int opt_handler(int opt, int opt_index)
|
||||
static int opt_handler(int opt, int opt_index, void *data)
|
||||
{
|
||||
switch (opt) {
|
||||
case 'd':
|
||||
@@ -700,7 +700,7 @@ int main(int argc, char **argv)
|
||||
int ret;
|
||||
|
||||
ret = igt_subtest_init_parse_opts(&argc, argv, "dt:", NULL, help_str,
|
||||
opt_handler);
|
||||
opt_handler, NULL);
|
||||
if (ret < 0)
|
||||
return ret == -1 ? 0 : ret;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user