head 1.2; access; symbols pkgsrc-2014Q2:1.1.0.14 pkgsrc-2014Q2-base:1.1 pkgsrc-2014Q1:1.1.0.12 pkgsrc-2014Q1-base:1.1 pkgsrc-2013Q4:1.1.0.10 pkgsrc-2013Q4-base:1.1 pkgsrc-2013Q3:1.1.0.8 pkgsrc-2013Q3-base:1.1 pkgsrc-2013Q2:1.1.0.6 pkgsrc-2013Q2-base:1.1 pkgsrc-2013Q1:1.1.0.4 pkgsrc-2013Q1-base:1.1 pkgsrc-2012Q4:1.1.0.2 pkgsrc-2012Q4-base:1.1; locks; strict; comment @// @; 1.2 date 2014.07.29.07.03.27; author adam; state dead; branches; next 1.1; commitid AhB1pIUYhFmK2fKx; 1.1 date 2012.11.16.00.54.04; author joerg; state Exp; branches; next ; desc @@ 1.2 log @Changes 0.48.5: Adobe Illustrator SVG files containing entities can be loaded again Support for Poppler 0.26 Support for Boehm-GC 7.4.0 and later Several crash bugs were fixed 64-bit compilation is now possible on Windows @ text @$NetBSD: patch-src_2geom_solve-bezier-parametric.cpp,v 1.1 2012/11/16 00:54:04 joerg Exp $ --- src/2geom/solve-bezier-parametric.cpp.orig 2012-11-15 17:42:23.000000000 +0000 +++ src/2geom/solve-bezier-parametric.cpp @@@@ -191,24 +191,27 @@@@ Bezier(Geom::Point const *V, /* Control Geom::Point *Left, /* RETURN left half ctl pts */ Geom::Point *Right) /* RETURN right half ctl pts */ { - Geom::Point Vtemp[degree+1][degree+1]; + const unsigned sz = degree + 1; + Geom::Point *Vtemp = new Geom::Point[sz * sz]; /* Copy control points */ - std::copy(V, V+degree+1, Vtemp[0]); + for (unsigned i = 0; i < sz; ++i) + Vtemp[0 * sz + i] = V[i]; /* Triangle computation */ for (unsigned i = 1; i <= degree; i++) { for (unsigned j = 0; j <= degree - i; j++) { - Vtemp[i][j] = lerp(t, Vtemp[i-1][j], Vtemp[i-1][j+1]); + Vtemp[i * sz + j] = lerp(t, Vtemp[(i-1) * sz + j], Vtemp[(i-1) * sz + j+1]); } } for (unsigned j = 0; j <= degree; j++) - Left[j] = Vtemp[j][0]; + Left[j] = Vtemp[j * sz + 0]; for (unsigned j = 0; j <= degree; j++) - Right[j] = Vtemp[degree-j][j]; - - return (Vtemp[degree][0]); + Right[j] = Vtemp[(degree-j) * sz + j]; + Geom::Point rv(Vtemp[degree * sz + 0]); + delete[] Vtemp; + return rv; } }; @ 1.1 log @Fix template look up. Don't use variable length arrays of non-POD types. Don't pass non-POD types to variadic functions. @ text @d1 1 a1 1 $NetBSD$ @