[postgis-tickets] r16370 - Quiet compiler warnings regarding abs/fabs
Paul Ramsey
pramsey at cleverelephant.ca
Fri Feb 2 01:42:12 PST 2018
Author: pramsey
Date: 2018-02-02 13:42:12 -0800 (Fri, 02 Feb 2018)
New Revision: 16370
Modified:
trunk/liblwgeom/cunit/cu_algorithm.c
Log:
Quiet compiler warnings regarding abs/fabs
Modified: trunk/liblwgeom/cunit/cu_algorithm.c
===================================================================
--- trunk/liblwgeom/cunit/cu_algorithm.c 2018-02-02 17:10:42 UTC (rev 16369)
+++ trunk/liblwgeom/cunit/cu_algorithm.c 2018-02-02 21:42:12 UTC (rev 16370)
@@ -1144,10 +1144,10 @@
passed = passed && (lwgeom_has_z((LWGEOM*) expected_result) == lwgeom_has_z((LWGEOM*) result));
if (!lwgeom_is_empty((LWGEOM*) result))
{
- passed = passed && abs(actual_pt.x - expected_pt.x) < tolerance;
- passed = passed && abs(actual_pt.y - expected_pt.y) < tolerance;
- passed = passed && (!lwgeom_has_z((LWGEOM*) expected_result) || abs(actual_pt.z - expected_pt.z) < tolerance);
- passed = passed && (!lwgeom_has_m((LWGEOM*) expected_result) || abs(actual_pt.m - expected_pt.m) < tolerance);
+ passed = passed && fabs(actual_pt.x - expected_pt.x) < tolerance;
+ passed = passed && fabs(actual_pt.y - expected_pt.y) < tolerance;
+ passed = passed && (!lwgeom_has_z((LWGEOM*) expected_result) || fabs(actual_pt.z - expected_pt.z) < tolerance);
+ passed = passed && (!lwgeom_has_m((LWGEOM*) expected_result) || fabs(actual_pt.m - expected_pt.m) < tolerance);
}
if (!passed)
printf("median_test input %s (parsed %s) expected %s got %s\n", input, lwgeom_to_ewkt(g), lwgeom_to_ewkt((LWGEOM*) expected_result), lwgeom_to_ewkt((LWGEOM*) result));
More information about the postgis-tickets
mailing list