[Mesa-dev] [PATCH] mesa/st: use labs instead of abs for long args Signed-off-by: Francesco Ansanelli <francians at gmail.com>
Marek Olšák
maraeo at gmail.com
Tue Aug 16 09:58:43 UTC 2016
This is not portable, because long has 32 bits on Windows.
Alternative solutions:
- llabs
- MAX2(a, -a)
Marek
On Tue, Aug 16, 2016 at 10:15 AM, Francesco Ansanelli
<francians at gmail.com> wrote:
> ---
> src/mesa/state_tracker/st_atom_array.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/mesa/state_tracker/st_atom_array.c b/src/mesa/state_tracker/st_atom_array.c
> index dcead27..70247b9 100644
> --- a/src/mesa/state_tracker/st_atom_array.c
> +++ b/src/mesa/state_tracker/st_atom_array.c
> @@ -363,7 +363,7 @@ is_interleaved_arrays(const struct st_vertex_program *vp,
> if (bufObj != firstBufObj)
> return GL_FALSE; /* arrays in different VBOs */
>
> - if (abs(array->Ptr - firstPtr) > firstStride)
> + if (labs(array->Ptr - firstPtr) > firstStride)
> return GL_FALSE; /* arrays start too far apart */
>
> if ((!_mesa_is_bufferobj(bufObj)) != userSpaceBuffer)
> --
> 1.7.9.5
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list