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

tgsi_parse.c: In function 'tgsi_parse_free':
tgsi_parse.c:54:31: warning: unused parameter 'ctx' [-Wunused-parameter]
    struct tgsi_parse_context *ctx )
                               ^~~
tgsi_parse.c: In function 'tgsi_parse_end_of_tokens':
tgsi_parse.c:62:25: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
    return ctx->Position >=

v2: Replace VREND_UNUSED by UNUSED (Erik)

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 d0d787c951
commit d30031ae87
  1. 8
      src/gallium/auxiliary/tgsi/tgsi_parse.c

@ -51,7 +51,7 @@ tgsi_parse_init(
void void
tgsi_parse_free( tgsi_parse_free(
struct tgsi_parse_context *ctx ) UNUSED struct tgsi_parse_context *ctx )
{ {
} }
@ -59,7 +59,11 @@ boolean
tgsi_parse_end_of_tokens( tgsi_parse_end_of_tokens(
struct tgsi_parse_context *ctx ) struct tgsi_parse_context *ctx )
{ {
return ctx->Position >= /* All values involved are unsigned, but the sum will be promoted to
* a signed value (at least on 64 bit). To capture a possible overflow
* make it a signed comparison.
*/
return (int)ctx->Position >=
ctx->FullHeader.Header.HeaderSize + ctx->FullHeader.Header.BodySize; ctx->FullHeader.Header.HeaderSize + ctx->FullHeader.Header.BodySize;
} }

Loading…
Cancel
Save