[Mesa-dev] [PATCH 2/3] mesa/st: Fix compiler warnings

Brian Paul brianp at vmware.com
Mon Jul 28 09:56:06 PDT 2014


On 07/25/2014 08:33 AM, Jan Vesely wrote:
> both array and index are unsigned types
>
> Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
> ---
>   src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 8 +++-----
>   1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> index 5ea1465..34780bd 100644
> --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> @@ -4321,9 +4321,8 @@ dst_register(struct st_translate *t,
>         return ureg_dst_undef();
>
>      case PROGRAM_TEMPORARY:
> -      assert(index >= 0);
> -      assert(index < (int) Elements(t->temps));
> -
> +      assert(index < Elements(t->temps));
> +
>         if (ureg_dst_is_undef(t->temps[index]))
>            t->temps[index] = ureg_DECL_local_temporary(t->ureg);
>
> @@ -4332,8 +4331,7 @@ dst_register(struct st_translate *t,
>      case PROGRAM_ARRAY:
>         array = index >> 16;
>
> -      assert(array >= 0);
> -      assert(array < (int) Elements(t->arrays));
> +      assert(array < Elements(t->arrays));
>
>         if (ureg_dst_is_undef(t->arrays[array]))
>            t->arrays[array] = ureg_DECL_array_temporary(
>

Reviewed-by: Brian Paul <brianp at vmware.com>



More information about the mesa-dev mailing list