diff --git a/src/util/format/u_format.h b/src/util/format/u_format.h index 4030c0efb76..cdd91241564 100644 --- a/src/util/format/u_format.h +++ b/src/util/format/u_format.h @@ -382,6 +382,9 @@ struct util_format_unpack_description { typedef void (*util_format_fetch_rgba_func_ptr)(void *dst, const uint8_t *src, unsigned i, unsigned j); +/* Silence warnings triggered by sharing function/struct names */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" const struct util_format_description * util_format_description(enum pipe_format format) ATTRIBUTE_CONST; @@ -390,6 +393,7 @@ util_format_pack_description(enum pipe_format format) ATTRIBUTE_CONST; const struct util_format_unpack_description * util_format_unpack_description(enum pipe_format format) ATTRIBUTE_CONST; +#pragma GCC diagnostic pop /** * Returns a function to fetch a single pixel (i, j) from a block. diff --git a/src/util/half_float.h b/src/util/half_float.h index c52bccf8d1e..4e15b2bdb0b 100644 --- a/src/util/half_float.h +++ b/src/util/half_float.h @@ -123,7 +123,7 @@ struct float16_t { uint16_t bits; float16_t(float f) : bits(_mesa_float_to_half(f)) {} float16_t(double d) : bits(_mesa_float_to_half(d)) {} - float16_t(uint16_t bits) : bits(bits) {} + float16_t(uint16_t raw_bits) : bits(raw_bits) {} static float16_t one() { return float16_t(FP16_ONE); } static float16_t zero() { return float16_t(FP16_ZERO); } };