Commit 2b881929 authored by Paul Ramsey's avatar Paul Ramsey

Inconsistent results from qsort callback (references #4093)


git-svn-id: http://svn.osgeo.org/postgis/trunk@16583 b70326c6-7e19-0410-871a-916f4a2858ee
parent 70778e89
Pipeline #22463524 failed with stage
in 6 minutes and 16 seconds
......@@ -112,7 +112,7 @@ static int cmpfunc (const void * a, const void * b)
if (v1==v2)
return (*(areanode**)a)-(*(areanode**)b);
else
return (v1>v2 ) ? 1 : -1;
return (v1 > v2) ? 1 : ((v1 < v2) ? -1 : 0);
}
......
......@@ -2061,7 +2061,8 @@ struct_cmp_by_measure(const void *a, const void *b)
{
LISTSTRUCT *ia = (LISTSTRUCT*)a;
LISTSTRUCT *ib = (LISTSTRUCT*)b;
return ( ia->themeasure>ib->themeasure ) ? 1 : -1;
return
(ia->themeasure > ib->themeasure) ? 1 : ((ia->themeasure < ib->themeasure) ? -1 : 0);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment