gallium/aux/tgsi/tgsi_text.c: Fix warnings

In function 'parse_identifier':
tgsi_text.c:190:16: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
          if (i == len - 1)
                ^~
tgsi_text.c: In function 'parse_optional_swizzle':
tgsi_text.c:816:21: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
       for (i = 0; i < components; i++) {
                     ^
tgsi_text.c: In function 'parse_instruction':
tgsi_text.c:1025:18: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
    for (i = 0; i < info->num_dst + info->num_src + info->is_tex; i++) {
                  ^
tgsi_text.c:1040:18: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
       else if (i < info->num_dst + info->num_src) {
                  ^
tgsi_text.c: In function 'parse_immediate':
tgsi/tgsi_text.c:1525:24: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
    for (type = 0; type < Elements(tgsi_immediate_type_names); ++type) {

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
macos/master
Gert Wollny 7 years ago committed by Jakob Bornecrantz
parent dfe2535349
commit ad731eebd4
  1. 8
      src/gallium/auxiliary/tgsi/tgsi_text.c

@ -219,7 +219,7 @@ static boolean parse_int( const char **pcur, int *val )
static boolean parse_identifier( const char **pcur, char *ret, size_t len ) static boolean parse_identifier( const char **pcur, char *ret, size_t len )
{ {
const char *cur = *pcur; const char *cur = *pcur;
int i = 0; size_t i = 0;
if (is_alpha_underscore( cur )) { if (is_alpha_underscore( cur )) {
ret[i++] = *cur++; ret[i++] = *cur++;
while (is_alpha_underscore( cur ) || is_digit( cur )) { while (is_alpha_underscore( cur ) || is_digit( cur )) {
@ -853,7 +853,7 @@ parse_optional_swizzle(
eat_opt_white( &cur ); eat_opt_white( &cur );
if (*cur == '.') { if (*cur == '.') {
uint i; int i;
cur++; cur++;
eat_opt_white( &cur ); eat_opt_white( &cur );
@ -1023,7 +1023,7 @@ parse_instruction(
struct translate_ctx *ctx, struct translate_ctx *ctx,
boolean has_label ) boolean has_label )
{ {
uint i; int i;
uint saturate = 0; uint saturate = 0;
uint precise = 0; uint precise = 0;
const struct tgsi_opcode_info *info; const struct tgsi_opcode_info *info;
@ -1611,7 +1611,7 @@ static boolean parse_immediate( struct translate_ctx *ctx )
{ {
struct tgsi_full_immediate imm; struct tgsi_full_immediate imm;
uint advance; uint advance;
int type; uint type;
if (*ctx->cur == '[') { if (*ctx->cur == '[') {
uint uindex; uint uindex;

Loading…
Cancel
Save