]> granicus.if.org Git - postgis/commitdiff
Removed variable-sized array and fixed comments as for ISO C90 requirements.
authorSandro Santilli <strk@keybit.net>
Mon, 9 Jan 2006 15:11:54 +0000 (15:11 +0000)
committerSandro Santilli <strk@keybit.net>
Mon, 9 Jan 2006 15:11:54 +0000 (15:11 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@2271 b70326c6-7e19-0410-871a-916f4a2858ee

lwgeom/lwgeom_functions_analytic.c

index 3c8d2cdf6e172dc17bbae4395937ec154fd77b79..16898d57b8bd2aa0ddde1faf110b47d93af91f2c 100644 (file)
@@ -107,13 +107,16 @@ elog(NOTICE, "DP_findsplit: segment too short, no split/no dist");
 POINTARRAY *
 DP_simplify2d(POINTARRAY *inpts, double epsilon)
 {
-       int stack[inpts->npoints];      /* recursion stack */
+       int *stack;                     /* recursion stack */
        int sp=-1;                      /* recursion stack pointer */
        int p1, split; 
        double dist;
        POINTARRAY *outpts;
        int ptsize = pointArray_ptsize(inpts);
 
+       /* Allocate recursion stack */
+       stack = lwalloc(sizeof(int)*inpts->npoints);
+
        p1 = 0;
        stack[++sp] = inpts->npoints-1;
 
@@ -175,6 +178,7 @@ DP_simplify2d(POINTARRAY *inpts, double epsilon)
                }
        }
 
+       lwfree(stack);
        return outpts;
 }