[virglrenderer-devel] [PATCH 10/16] gallium/aux/tgsi/tgsi_ureg.*: Fix warnings
Gert Wollny
gert.wollny at collabora.com
Thu May 31 09:15:42 UTC 2018
tgsi_ureg.c: In function 'ureg_DECL_sampler':
tgsi_ureg.c:601:34: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
if (ureg->sampler[i].Index == nr)
^~
tgsi_ureg.c: In function 'validate':
tgsi/tgsi_ureg.c:908:32: warning: unused parameter 'opcode' [-Wunused-
parameter]
static void validate( unsigned opcode,
^~~~~~
tgsi_ureg.c:909:32: warning: unused parameter 'nr_dst' [-Wunused-
parameter]
unsigned nr_dst,
^~~~~~
tgsi_ureg.c:910:32: warning: unused parameter 'nr_src' [-Wunused-
parameter]
unsigned nr_src )
^~~~~~
tgsi_ureg.c: In function 'emit_decls':
tgsi_ureg.c:1335:31: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
if (ureg->properties[i] != ~0)
^~
tgsi_ureg.c: In function 'ureg_create':
tgsi_ureg.c:1594:18: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
for (i = 0; i < ARRAY_SIZE(ureg->properties); i++)
^
CC tgsi/tgsi_util.lo
tgsi_util.c: In function 'tgsi_util_get_full_src_register_sign_mode':
tgsi_util.c:109:13: warning: unused parameter 'component' [-Wunused-
parameter]
unsigned component )
^~~~~~~~~
Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
---
src/gallium/auxiliary/tgsi/tgsi_ureg.c | 10 +++++++---
src/gallium/auxiliary/tgsi/tgsi_ureg.h | 4 ++--
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.c b/src/gallium/auxiliary/tgsi/tgsi_ureg.c
index b4423d4..de32d6e 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_ureg.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.c
@@ -593,7 +593,7 @@ ureg_DECL_predicate(struct ureg_program *ureg)
/* Allocate a new sampler.
*/
struct ureg_src ureg_DECL_sampler( struct ureg_program *ureg,
- unsigned nr )
+ int nr )
{
unsigned i;
@@ -916,6 +916,10 @@ static void validate( unsigned opcode,
assert(nr_dst == info->num_dst);
assert(nr_src == info->num_src);
}
+#else
+ VREND_UNUSED(opcode);
+ VREND_UNUSED(nr_dst);
+ VREND_UNUSED(nr_src);
#endif
}
@@ -1332,7 +1336,7 @@ static void emit_decls( struct ureg_program *ureg )
unsigned i;
for (i = 0; i < ARRAY_SIZE(ureg->properties); i++)
- if (ureg->properties[i] != ~0)
+ if (ureg->properties[i] != ~0u)
emit_property(ureg, i, ureg->properties[i]);
if (ureg->processor == TGSI_PROCESSOR_VERTEX) {
@@ -1584,7 +1588,7 @@ void ureg_free_tokens( const struct tgsi_token *tokens )
struct ureg_program *ureg_create( unsigned processor )
{
- int i;
+ unsigned i;
struct ureg_program *ureg = CALLOC_STRUCT( ureg_program );
if (ureg == NULL)
goto no_ureg;
diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.h b/src/gallium/auxiliary/tgsi/tgsi_ureg.h
index 441a770..1bfefd0 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_ureg.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.h
@@ -288,8 +288,8 @@ ureg_DECL_predicate(struct ureg_program *);
* up state for in the context.
*/
struct ureg_src
-ureg_DECL_sampler( struct ureg_program *,
- unsigned index );
+ureg_DECL_sampler(struct ureg_program *,
+ int index );
struct ureg_src
ureg_DECL_sampler_view(struct ureg_program *,
--
2.16.1
More information about the virglrenderer-devel
mailing list