PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ cmpfunc()

static int cmpfunc ( const void *  a,
const void *  b 
)
static

We create the minheap by ordering the minheap array by the areas in the areanode structs that the minheap keys refere to.

Definition at line 105 of file effectivearea.c.

Referenced by tune_areas().

106 {
107  double v1 = (*(areanode**)a)->area;
108  double v2 = (*(areanode**)b)->area;
109  /*qsort gives unpredictable results when comaping identical values.
110  If two values is the same we force returning the last point in hte point array.
111  That way we get the same ordering on diffreent machines and pllatforms*/
112  if (v1==v2)
113  return (*(areanode**)a)-(*(areanode**)b);
114  else
115  return (v1 > v2) ? 1 : ((v1 < v2) ? -1 : 0);
116 }
This structure is placed in an array with one member per point.
Definition: effectivearea.h:38
Here is the caller graph for this function: