Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/GStreamer/orc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2019-08-27 04:36:49 +0300
committerMatthew Waters <matthew@centricular.com>2019-08-27 04:36:49 +0300
commit63f6cfac0fa9dd3263540eb0d78fc6a20af9016c (patch)
tree8f4978dfdde2de070fc78bc18187847757f58147 /orc-test/orctest.c
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/orctest.c')
-rw-r--r--orc-test/orctest.c4
1 files changed, 2 insertions, 2 deletions
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;