[Mesa-dev] [PATCH 01/10] util: fix new gcc6 warnings

Ian Romanick idr at freedesktop.org
Thu Feb 18 18:19:26 UTC 2016


This patch is

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

On 02/17/2016 09:34 AM, Rob Clark wrote:
> src/util/hash_table.h:111:23: warning: ‘_mesa_fnv32_1a_offset_bias’ defined but not used [-Wunused-const-variable]
>  static const uint32_t _mesa_fnv32_1a_offset_bias = 2166136261u;
>                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> I went w/ enum, rather than #define, mostly because a lowercase #define
> is funny looking, and changing the case would have been more churn.
> 
> Signed-off-by: Rob Clark <robdclark at gmail.com>
> ---
>  src/util/hash_table.h | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/util/hash_table.h b/src/util/hash_table.h
> index 85b013c..c69abfa 100644
> --- a/src/util/hash_table.h
> +++ b/src/util/hash_table.h
> @@ -108,7 +108,9 @@ static inline uint32_t _mesa_hash_pointer(const void *pointer)
>     return _mesa_hash_data(&pointer, sizeof(pointer));
>  }
>  
> -static const uint32_t _mesa_fnv32_1a_offset_bias = 2166136261u;
> +enum {
> +   _mesa_fnv32_1a_offset_bias = 2166136261u,
> +};
>  
>  static inline uint32_t
>  _mesa_fnv32_1a_accumulate_block(uint32_t hash, const void *data, size_t size)
> 



More information about the mesa-dev mailing list