Skip to content

Use fabs() for vec4 viewport calculation

Lyude Paul requested to merge lyudess/panfrost-mesa:pull/fabs-fix into master

My vim config uses llvm for code completion, and picked up this:

../../Projects/panfrost/mesa/src/gallium/drivers/panfrost/pan_context.c:1250:17: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
                abs(vp->scale[1]),
                ^
../../Projects/panfrost/mesa/src/gallium/drivers/panfrost/pan_context.c:1250:17: note: use function 'fabsf' instead
                abs(vp->scale[1]),
                ^~~
                fabsf
../../Projects/panfrost/mesa/src/gallium/drivers/panfrost/pan_context.c:1253:47: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
                /* -1.0 * vp->translate[1] */ abs(1.0 * vp->scale[1]) /* XXX */
                                              ^
../../Projects/panfrost/mesa/src/gallium/drivers/panfrost/pan_context.c:1253:47: note: use function 'fabs' instead
                /* -1.0 * vp->translate[1] */ abs(1.0 * vp->scale[1]) /* XXX */
                                              ^~~
                                              fabs

Yikes! That's sure to break something, so let's fix that.

Signed-off-by: Lyude Paul lyude@redhat.com

Edited by Lyude Paul

Merge request reports