Mesa (master): gallium/tests: Fix compiler warning about unused vars in trivial tests.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Aug 28 23:02:36 UTC 2020


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

Author: Eric Anholt <eric at anholt.net>
Date:   Tue Aug 25 11:20:46 2020 -0700

gallium/tests: Fix compiler warning about unused vars in trivial tests.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6462>

---

 src/gallium/tests/trivial/compute.c  | 4 ++--
 src/gallium/tests/trivial/quad-tex.c | 3 ++-
 src/gallium/tests/trivial/tri.c      | 2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/gallium/tests/trivial/compute.c b/src/gallium/tests/trivial/compute.c
index cfdbdf1cc8d..6f4fe36a536 100644
--- a/src/gallium/tests/trivial/compute.c
+++ b/src/gallium/tests/trivial/compute.c
@@ -71,7 +71,7 @@ struct context {
 
 static void init_ctx(struct context *ctx)
 {
-        int ret;
+        ASSERTED int ret;
 
         ret = pipe_loader_probe(&ctx->dev, 1);
         assert(ret);
@@ -153,7 +153,7 @@ static void init_prog(struct context *ctx, unsigned local_sz,
                 .req_input_mem = input_sz
         };
         char *psrc = preprocess_prog(ctx, src, defs);
-        int ret;
+        ASSERTED int ret;
 
         ret = tgsi_text_translate(psrc, prog, ARRAY_SIZE(prog));
         assert(ret);
diff --git a/src/gallium/tests/trivial/quad-tex.c b/src/gallium/tests/trivial/quad-tex.c
index a30cfb9b9f7..ba0a7ac8fb3 100644
--- a/src/gallium/tests/trivial/quad-tex.c
+++ b/src/gallium/tests/trivial/quad-tex.c
@@ -47,6 +47,7 @@
 /* constant state object helper */
 #include "cso_cache/cso_context.h"
 
+#include "util/macros.h"
 /* u_sampler_view_default_template */
 #include "util/u_sampler.h"
 /* debug_dump_surface_bmp */
@@ -89,7 +90,7 @@ struct program
 static void init_prog(struct program *p)
 {
 	struct pipe_surface surf_tmpl;
-	int ret;
+	ASSERTED int ret;
 
 	/* find a hardware device */
 	ret = pipe_loader_probe(&p->dev, 1);
diff --git a/src/gallium/tests/trivial/tri.c b/src/gallium/tests/trivial/tri.c
index 79bb5d95086..254a10ac863 100644
--- a/src/gallium/tests/trivial/tri.c
+++ b/src/gallium/tests/trivial/tri.c
@@ -84,7 +84,7 @@ struct program
 static void init_prog(struct program *p)
 {
 	struct pipe_surface surf_tmpl;
-	int ret;
+	ASSERTED int ret;
 
 	/* find a hardware device */
 	ret = pipe_loader_probe(&p->dev, 1);



More information about the mesa-commit mailing list