[Mesa-dev] [PATCH 1/3] glsl: Fix unused value warning reported by Coverity

Kristian Høgsberg krh at bitplanet.net
Mon Sep 28 16:46:13 PDT 2015


On Mon, Sep 28, 2015 at 12:59:33PM +0200, Iago Toral Quiroga wrote:
> We don't use param in this part of the code, so no point in advancing
> the pointer forward:
> 
> >>>     CID 1324983:  Code maintainability issues  (UNUSED_VALUE)
> >>>     Assigning value from "param->get_next()" to "param" here, but that stored value is overwritten before it can be used.

Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>

> ---
>  src/glsl/lower_ubo_reference.cpp | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/src/glsl/lower_ubo_reference.cpp b/src/glsl/lower_ubo_reference.cpp
> index 31885cd..4e09b08 100644
> --- a/src/glsl/lower_ubo_reference.cpp
> +++ b/src/glsl/lower_ubo_reference.cpp
> @@ -1099,13 +1099,11 @@ lower_ubo_reference_visitor::lower_ssbo_atomic_intrinsic(ir_call *ir)
>  
>     const glsl_type *type = deref->type->base_type == GLSL_TYPE_INT ?
>        glsl_type::int_type : glsl_type::uint_type;
> -   param = param->get_next();
>     sig_param = new(mem_ctx)
>           ir_variable(type, "data1", ir_var_function_in);
>     sig_params.push_tail(sig_param);
>  
>     if (param_count == 3) {
> -      param = param->get_next();
>        sig_param = new(mem_ctx)
>              ir_variable(type, "data2", ir_var_function_in);
>        sig_params.push_tail(sig_param);
> -- 
> 1.9.1
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list