diff options
Diffstat (limited to 'src/Type1/curves.c')
-rw-r--r-- | src/Type1/curves.c | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/src/Type1/curves.c b/src/Type1/curves.c index d1033fe..206958a 100644 --- a/src/Type1/curves.c +++ b/src/Type1/curves.c @@ -29,6 +29,8 @@ /* CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT */ /* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS */ /* SOFTWARE. */ +/* $XFree86: xc/lib/font/Type1/curves.c,v 1.8 2002/02/18 20:51:57 herrb Exp $ */ + /* :h1.CURVES Module - Stepping Beziers @@ -42,6 +44,7 @@ through. Include files needed: */ +#include "os.h" #include "objects.h" #include "spaces.h" #include "paths.h" @@ -88,8 +91,11 @@ struct bezierinfo { to subdivide. */ -static int BezierTerminationTest(xa,ya,xb,yb,xc,yc,xd,yd) -fractpel xa,ya,xb,yb,xc,yc,xd,yd; +static int +BezierTerminationTest(fractpel xa, fractpel ya, + fractpel xb, fractpel yb, + fractpel xc, fractpel yc, + fractpel xd, fractpel yd) { fractpel dmax; dmax = ABS(xa - xb); @@ -112,13 +118,12 @@ Bezier to define his curves as he did. If the input region 'R' is NULL, the result is a path that is the 'flattened' curve; otherwise StepBezier returns nothing special. */ -static struct segment *StepBezierRecurse(I,xA,yA,xB,yB,xC,yC,xD,yD) - struct bezierinfo *I; /* Region under construction or NULL */ - fractpel xA,yA; /* A control point */ - fractpel xB,yB; /* B control point */ - fractpel xC,yC; /* C control point */ - fractpel xD,yD; /* D control point */ - +static struct segment * +StepBezierRecurse(struct bezierinfo *I, /* Region under construction or NULL */ + fractpel xA, fractpel yA, /* A control point */ + fractpel xB, fractpel yB, /* B control point */ + fractpel xC, fractpel yC, /* C control point */ + fractpel xD, fractpel yD) /* D control point */ { if (BezierTerminationTest(xA,yA,xB,yB,xC,yC,xD,yD)) { @@ -167,6 +172,7 @@ static struct segment *StepBezierRecurse(I,xA,yA,xB,yB,xC,yC,xD,yD) StepBezierRecurse(I, xABCD, yABCD, xBCD, yBCD, xCD, yCD, xD, yD); } } + return NULL; /*NOTREACHED*/ } @@ -177,6 +183,7 @@ Intermediate values in the Bezier subdivision are 8 times bigger than the starting values. If this overflows, a 'long', we are in trouble: */ +#undef BITS #define BITS (sizeof(long)*8) #define HIGHTEST(p) (((p)>>(BITS-4)) != 0) /* includes sign bit */ #define TOOBIG(xy) ((xy < 0) ? HIGHTEST(-xy) : HIGHTEST(xy)) @@ -187,12 +194,12 @@ the starting values. If this overflows, a 'long', we are in trouble: This is the entry point called from outside the module. */ -struct segment *StepBezier(R, xA, yA, xB, yB, xC, yC, xD, yD) - struct region *R; /* Region under construction or NULL */ - fractpel xA,yA; /* A control point */ - fractpel xB,yB; /* B control point */ - fractpel xC,yC; /* C control point */ - fractpel xD,yD; /* D control point */ +struct segment * +StepBezier(struct region *R, /* Region under construction or NULL */ + fractpel xA, fractpel yA, /* A control point */ + fractpel xB, fractpel yB, /* B control point */ + fractpel xC, fractpel yC, /* C control point */ + fractpel xD, fractpel yD) /* D control point */ { struct bezierinfo Info; @@ -209,7 +216,7 @@ struct segment *StepBezier(R, xA, yA, xB, yB, xC, yC, xD, yD) if ( TOOBIG(xB) || TOOBIG(yB) || TOOBIG(xC) || TOOBIG(yC) || TOOBIG(xD) || TOOBIG(yD) ) - abort("Beziers this big not yet supported"); + Abort("Beziers this big not yet supported"); return(StepBezierRecurse(&Info, (fractpel) 0, (fractpel) 0, xB, yB, xC, yC, xD, yD)); |