[Piglit] [PATCH] arb_direct_state_access: Fix Clang absolute-value warning.
Vinson Lee
vlee at freedesktop.org
Tue Mar 3 18:07:13 PST 2015
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
More information about the Piglit
mailing list