[Piglit] [PATCH] arb_direct_state_access: Fix Clang absolute-value warning.
Laura Ekstrand
laura at jlekstrand.net
Wed Mar 4 16:13:38 PST 2015
Reviewed-by: Laura Ekstrand <laura at jlekstrand.net>
On Tue, Mar 3, 2015 at 6:07 PM, Vinson Lee <vlee at freedesktop.org> wrote:
> getcompressedtextureimage.c:121:7: warning: using floating point absolute
> value function 'fabs' when argument is of integer type [-Wabsolute-value]
> if (fabs((int)data[i] - (int)expected[i]) > tolerance) {
> ^
> getcompressedtextureimage.c:121:7: note: use function 'abs' instead
> if (fabs((int)data[i] - (int)expected[i]) > tolerance) {
> ^~~~
> abs
>
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
> ---
> tests/spec/arb_direct_state_access/getcompressedtextureimage.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git
> a/tests/spec/arb_direct_state_access/getcompressedtextureimage.c
> b/tests/spec/arb_direct_state_access/getcompressedtextureimage.c
> index 9546af5..84aa30b 100644
> --- a/tests/spec/arb_direct_state_access/getcompressedtextureimage.c
> +++ b/tests/spec/arb_direct_state_access/getcompressedtextureimage.c
> @@ -118,7 +118,7 @@ compare_layer(int layer, int num_elements, int
> tolerance,
> int i;
>
> for (i = 0; i < num_elements; ++i) {
> - if (fabs((int)data[i] - (int)expected[i]) > tolerance) {
> + if (abs((int)data[i] - (int)expected[i]) > tolerance) {
> printf("GetCompressedTextureImage() returns
> incorrect"
> " data in byte %i for layer %i\n",
> i, layer);
> --
> 2.3.1
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20150304/44bef3c2/attachment.html>
More information about the Piglit
mailing list