From bae4dca8e461640d8bed57dc77875afb4d5087ce Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Tue, 22 Jun 2021 16:01:49 +0200 Subject: [PATCH] aux/trace: fix bool argument The second argument to debug_get_bool_option is a boolean, not a pointer. Passing a NULL-pointer there triggers a warning, which we treat as an error on MSVC: ---8<--- ../src/gallium/auxiliary/driver_trace/tr_screen.c(1071): error C2220: the following warning is treated as an error ../src/gallium/auxiliary/driver_trace/tr_screen.c(1071): warning C4047: 'function': 'bool' differs in levels of indirection from 'void *' ../src/gallium/auxiliary/driver_trace/tr_screen.c(1071): error C4024: 'debug_get_bool_option': different types for formal and actual parameter 2 ---8<--- Fixes: c1270d4845d ("aux/trace: add screen deduplication for zink+lavapipe tracing") Reviewed-by: Jesse Natalie Reviewed-by: Daniel Stone Acked-by: Mike Blumenkrantz Part-of: --- src/gallium/auxiliary/driver_trace/tr_screen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/driver_trace/tr_screen.c b/src/gallium/auxiliary/driver_trace/tr_screen.c index eb2618bfcf9..ae5a2afab18 100644 --- a/src/gallium/auxiliary/driver_trace/tr_screen.c +++ b/src/gallium/auxiliary/driver_trace/tr_screen.c @@ -1067,7 +1067,7 @@ trace_screen_create(struct pipe_screen *screen) const char *driver = debug_get_option("MESA_LOADER_DRIVER_OVERRIDE", NULL); if (driver && !strcmp(driver, "zink")) { /* the user wants zink: check whether they want to trace zink or lavapipe */ - bool trace_lavapipe = debug_get_bool_option("ZINK_TRACE_LAVAPIPE", NULL); + bool trace_lavapipe = debug_get_bool_option("ZINK_TRACE_LAVAPIPE", false); if (!strncmp(screen->get_name(screen), "zink", 4)) { /* this is the zink screen: only trace if lavapipe tracing is disabled */ if (trace_lavapipe)