util: Fix/silence variable shadowing warnings

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7552>
This commit is contained in:
Tony Wasserka 2020-11-11 17:18:21 +01:00 committed by Marge Bot
parent 4e87e7863f
commit 2ec290cd92
2 changed files with 5 additions and 1 deletions

View file

@ -382,6 +382,9 @@ struct util_format_unpack_description {
typedef void (*util_format_fetch_rgba_func_ptr)(void *dst, const uint8_t *src, typedef void (*util_format_fetch_rgba_func_ptr)(void *dst, const uint8_t *src,
unsigned i, unsigned j); 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 * const struct util_format_description *
util_format_description(enum pipe_format format) ATTRIBUTE_CONST; 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 * const struct util_format_unpack_description *
util_format_unpack_description(enum pipe_format format) ATTRIBUTE_CONST; 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. * Returns a function to fetch a single pixel (i, j) from a block.

View file

@ -123,7 +123,7 @@ struct float16_t {
uint16_t bits; uint16_t bits;
float16_t(float f) : bits(_mesa_float_to_half(f)) {} float16_t(float f) : bits(_mesa_float_to_half(f)) {}
float16_t(double d) : bits(_mesa_float_to_half(d)) {} 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 one() { return float16_t(FP16_ONE); }
static float16_t zero() { return float16_t(FP16_ZERO); } static float16_t zero() { return float16_t(FP16_ZERO); }
}; };