summaryrefslogtreecommitdiff
path: root/orc-test
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2019-08-27 11:36:49 +1000
committerMatthew Waters <matthew@centricular.com>2019-08-27 11:36:49 +1000
commit63f6cfac0fa9dd3263540eb0d78fc6a20af9016c (patch)
tree8f4978dfdde2de070fc78bc18187847757f58147 /orc-test
parentd7e258c12f3f2d997d013b34708a2483e67b9cc3 (diff)
build: fix werror build with clang
../subprojects/orc/orc-test/orcarray.c:230:47: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value] if ((a[i] < 0.0) == (b[i] < 0.0) && abs(*(orc_uint32 *)&a[i] - *(orc_uint32 *)&b[i]) <= 2) continue; ^ ../subprojects/orc/orc-test/orcarray.c:230:47: note: remove the call to 'abs' since unsigned values cannot be negative if ((a[i] < 0.0) == (b[i] < 0.0) && abs(*(orc_uint32 *)&a[i] - *(orc_uint32 *)&b[i]) <= 2) continue; ^~~ ../subprojects/orc/orc-test/orcarray.c:247:47: error: taking the absolute value of unsigned type 'unsigned long' has no effect [-Werror,-Wabsolute-value] if ((a[i] < 0.0) == (b[i] < 0.0) && abs(*(orc_uint64 *)&a[i] - *(orc_uint64 *)&b[i]) <= 2) continue; ^ ../subprojects/orc/orc-test/orcarray.c:247:47: note: remove the call to 'abs' since unsigned values cannot be negative if ((a[i] < 0.0) == (b[i] < 0.0) && abs(*(orc_uint64 *)&a[i] - *(orc_uint64 *)&b[i]) <= 2) continue; ^~~ ../subprojects/orc/orc-test/orctest.c:525:63: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value] if ((*(float *)ptr1 < 0.0) == (*(float *)ptr2 < 0.0) && abs(*(orc_uint32 *)ptr1 - *(orc_uint32 *)ptr2) <= 2) return TRUE; ^ ../subprojects/orc/orc-test/orctest.c:525:63: note: remove the call to 'abs' since unsigned values cannot be negative if ((*(float *)ptr1 < 0.0) == (*(float *)ptr2 < 0.0) && abs(*(orc_uint32 *)ptr1 - *(orc_uint32 *)ptr2) <= 2) return TRUE; ^~~ ../subprojects/orc/orc-test/orctest.c:530:65: error: taking the absolute value of unsigned type 'unsigned long' has no effect [-Werror,-Wabsolute-value] if ((*(double *)ptr1 < 0.0) == (*(double *)ptr2 < 0.0) && abs(*(orc_uint64 *)ptr1 - *(orc_uint64 *)ptr2) <= 2) return TRUE; ^ ../subprojects/orc/orc-test/orctest.c:530:65: note: remove the call to 'abs' since unsigned values cannot be negative if ((*(double *)ptr1 < 0.0) == (*(double *)ptr2 < 0.0) && abs(*(orc_uint64 *)ptr1 - *(orc_uint64 *)ptr2) <= 2) return TRUE; ^~~
Diffstat (limited to 'orc-test')
-rw-r--r--orc-test/orcarray.c4
-rw-r--r--orc-test/orctest.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/orc-test/orcarray.c b/orc-test/orcarray.c
index b27a1f9..7cc5fc1 100644
--- a/orc-test/orcarray.c
+++ b/orc-test/orcarray.c
@@ -227,7 +227,7 @@ orc_array_compare (OrcArray *array1, OrcArray *array2, int flags)
for (i=0;i<array1->n;i++){
if (isnan(a[i]) && isnan(b[i])) continue;
if (a[i] == b[i]) continue;
- if ((a[i] < 0.0) == (b[i] < 0.0) && abs(*(orc_uint32 *)&a[i] - *(orc_uint32 *)&b[i]) <= 2) continue;
+ if ((a[i] < 0.0) == (b[i] < 0.0) && (*(orc_uint32 *)&a[i] - *(orc_uint32 *)&b[i]) <= 2) continue;
return FALSE;
}
}
@@ -244,7 +244,7 @@ orc_array_compare (OrcArray *array1, OrcArray *array2, int flags)
for (i=0;i<array1->n;i++){
if (isnan(a[i]) && isnan(b[i])) continue;
if (a[i] == b[i]) continue;
- if ((a[i] < 0.0) == (b[i] < 0.0) && abs(*(orc_uint64 *)&a[i] - *(orc_uint64 *)&b[i]) <= 2) continue;
+ if ((a[i] < 0.0) == (b[i] < 0.0) && (*(orc_uint64 *)&a[i] - *(orc_uint64 *)&b[i]) <= 2) continue;
return FALSE;
}
}
diff --git a/orc-test/orctest.c b/orc-test/orctest.c
index 6f6d6d5..4b07823 100644
--- a/orc-test/orctest.c
+++ b/orc-test/orctest.c
@@ -522,12 +522,12 @@ float_compare (OrcArray *array1, OrcArray *array2, int i, int j)
case 4:
if (isnan(*(float *)ptr1) && isnan(*(float *)ptr2)) return TRUE;
if (*(float *)ptr1 == *(float *)ptr2) return TRUE;
- if ((*(float *)ptr1 < 0.0) == (*(float *)ptr2 < 0.0) && abs(*(orc_uint32 *)ptr1 - *(orc_uint32 *)ptr2) <= 2) return TRUE;
+ if ((*(float *)ptr1 < 0.0) == (*(float *)ptr2 < 0.0) && (*(orc_uint32 *)ptr1 - *(orc_uint32 *)ptr2) <= 2) return TRUE;
return FALSE;
case 8:
if (isnan(*(double *)ptr1) && isnan(*(double *)ptr2)) return TRUE;
if (*(double *)ptr1 == *(double *)ptr2) return TRUE;
- if ((*(double *)ptr1 < 0.0) == (*(double *)ptr2 < 0.0) && abs(*(orc_uint64 *)ptr1 - *(orc_uint64 *)ptr2) <= 2) return TRUE;
+ if ((*(double *)ptr1 < 0.0) == (*(double *)ptr2 < 0.0) && (*(orc_uint64 *)ptr1 - *(orc_uint64 *)ptr2) <= 2) return TRUE;
return FALSE;
}
return FALSE;