From: Rob Clark Date: Fri, 24 Jul 2020 21:12:04 +0000 (-0700) Subject: freedreno/rnn: warnings cleanup X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cbbaafdf72c723e42e957a78909f66ad62d37f90;p=mesa.git freedreno/rnn: warnings cleanup Signed-off-by: Rob Clark Part-of: --- diff --git a/src/freedreno/rnn/headergen2.c b/src/freedreno/rnn/headergen2.c index 34a49a01ba3..ee065b76a7c 100644 --- a/src/freedreno/rnn/headergen2.c +++ b/src/freedreno/rnn/headergen2.c @@ -28,7 +28,6 @@ /* modified version of headergen which uses enums and inline fxns for * type safety.. based on original headergen */ -#define _GNU_SOURCE #include "rnn.h" #include "util.h" @@ -159,6 +158,8 @@ static void printtypeinfo (struct rnntypeinfo *ti, struct rnnbitfield *bf, case RNN_TTYPE_ENUM: asprintf(&typename, "enum %s", ti->name); break; + default: + break; } } diff --git a/src/freedreno/rnn/rnn.c b/src/freedreno/rnn/rnn.c index 3027288b74e..411611104ab 100644 --- a/src/freedreno/rnn/rnn.c +++ b/src/freedreno/rnn/rnn.c @@ -26,6 +26,9 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +/* workaround libxml2 silliness: */ +#pragma GCC diagnostic ignored "-Wpointer-sign" + #include #include #include diff --git a/src/freedreno/rnn/rnndec.c b/src/freedreno/rnn/rnndec.c index db449a2d284..fdc2c3024bd 100644 --- a/src/freedreno/rnn/rnndec.c +++ b/src/freedreno/rnn/rnndec.c @@ -23,7 +23,6 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -#define _GNU_SOURCE // for asprintf #include "rnndec.h" #include #include @@ -39,7 +38,7 @@ struct rnndeccontext *rnndec_newcontext(struct rnndb *db) { return res; } -int rnndec_varadd(struct rnndeccontext *ctx, char *varset, char *variant) { +int rnndec_varadd(struct rnndeccontext *ctx, char *varset, const char *variant) { struct rnnenum *en = rnn_findenum(ctx->db, varset); if (!en) { fprintf (stderr, "Enum %s doesn't exist in database!\n", varset); @@ -168,6 +167,7 @@ char *rnndec_decodeval(struct rnndeccontext *ctx, struct rnntypeinfo *ti, uint64 struct rnnbitfield **bitfields; int bitfieldsnum; char *tmp; + const char *ctmp; uint64_t mask, value_orig; if (!ti) goto failhex; @@ -185,11 +185,11 @@ char *rnndec_decodeval(struct rnndeccontext *ctx, struct rnntypeinfo *ti, uint64 valsnum = ti->valsnum; goto doenum; doenum: - tmp = rnndec_decode_enum_val(ctx, vals, valsnum, value); - if (tmp) { - asprintf (&res, "%s%s%s", ctx->colors->eval, tmp, ctx->colors->reset); + ctmp = rnndec_decode_enum_val(ctx, vals, valsnum, value); + if (ctmp) { + asprintf (&res, "%s%s%s", ctx->colors->eval, ctmp, ctx->colors->reset); if (ti->addvariant) { - rnndec_varadd(ctx, ti->eenum->name, tmp); + rnndec_varadd(ctx, ti->eenum->name, ctmp); } break; } @@ -325,7 +325,8 @@ char *rnndec_decodeval(struct rnndeccontext *ctx, struct rnntypeinfo *ti, uint64 } static char *appendidx (struct rnndeccontext *ctx, char *name, uint64_t idx, struct rnnenum *index) { - char *res, *index_name = NULL; + char *res; + const char *index_name = NULL; if (index) index_name = rnndec_decode_enum_val(ctx, index->vals, index->valsnum, idx); diff --git a/src/freedreno/rnn/rnndec.h b/src/freedreno/rnn/rnndec.h index c782d2158f6..1e21d02ba7f 100644 --- a/src/freedreno/rnn/rnndec.h +++ b/src/freedreno/rnn/rnndec.h @@ -48,7 +48,7 @@ struct rnndecaddrinfo { }; struct rnndeccontext *rnndec_newcontext(struct rnndb *db); -int rnndec_varadd(struct rnndeccontext *ctx, char *varset, char *variant); +int rnndec_varadd(struct rnndeccontext *ctx, char *varset, const char *variant); int rnndec_varmatch(struct rnndeccontext *ctx, struct rnnvarinfo *vi); char *rnndec_decode_enum(struct rnndeccontext *ctx, const char *enumname, uint64_t enumval); char *rnndec_decodeval(struct rnndeccontext *ctx, struct rnntypeinfo *ti, uint64_t value);