Mesa (main): aux/trace: fix bool argument

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jun 24 18:15:26 UTC 2021


Module: Mesa
Branch: main
Commit: bae4dca8e461640d8bed57dc77875afb4d5087ce
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=bae4dca8e461640d8bed57dc77875afb4d5087ce

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Tue Jun 22 16:01:49 2021 +0200

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 <jenatali at microsoft.com>
Reviewed-by: Daniel Stone <daniels at collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11424>

---

 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)



More information about the mesa-commit mailing list