From 45b8874ddcbf79dde50b770e5ad3d6a504f66abf 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: (cherry picked from commit bae4dca8e461640d8bed57dc77875afb4d5087ce) --- .pick_status.json | 2 +- src/gallium/auxiliary/driver_trace/tr_screen.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index d396cec37db..e6ebeffff2c 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -490,7 +490,7 @@ "description": "aux/trace: fix bool argument", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "c1270d4845d39939d6a7d3b1b81e0d2f9e33133d" }, diff --git a/src/gallium/auxiliary/driver_trace/tr_screen.c b/src/gallium/auxiliary/driver_trace/tr_screen.c index 2adda8be291..95ce875bcd5 100644 --- a/src/gallium/auxiliary/driver_trace/tr_screen.c +++ b/src/gallium/auxiliary/driver_trace/tr_screen.c @@ -836,7 +836,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)