diff --git a/src/xrpath.c b/src/xrpath.c index 075871fcd..98a01ce3f 100644 --- a/src/xrpath.c +++ b/src/xrpath.c @@ -302,17 +302,15 @@ XrPathInterpret(XrPath *path, XrPathDirection dir, XrPathCallbacks *cb, void *cl op_buf = (dir == XrPathDirectionForward) ? op_buf->next : op_buf->prev) { int start, stop; - if (dir == XrPathDirectionForward) - { + if (dir == XrPathDirectionForward) { start = 0; stop = op_buf->num_ops; } else { start = op_buf->num_ops - 1; stop = -1; } - - for (i=start; i != stop; i += step) - { + + for (i=start; i != stop; i += step) { op = op_buf->op[i]; if (dir == XrPathDirectionReverse) { diff --git a/src/xrpen.c b/src/xrpen.c index 94b8a7413..85d700095 100644 --- a/src/xrpen.c +++ b/src/xrpen.c @@ -65,8 +65,8 @@ XrPenInit(XrPen *pen, double radius, XrGState *gstate) /* XXX: It would be nice to notice that the pen is already properly constructed. However, this test would also have to account for possible changes in the transformation matrix. - if (pen->radius == radius && pen->tolerance == tolerance) - return XrErrorSuccess; + if (pen->radius == radius && pen->tolerance == tolerance) + return XrErrorSuccess; */ XrPenDeinit(pen); } @@ -252,10 +252,10 @@ _XrPenStrokeSplineHalf(XrPen *pen, XrSpline *spline, XrPenVertexFlag dir, XrPoly int num_pts = spline->num_pts; for (i=0; i < pen->num_vertices; i++) { - if (pen->vertex[i].flag & dir) { - active = i; - break; - } + if (pen->vertex[i].flag & dir) { + active = i; + break; + } } if (dir == XrPenVertexFlagForward) { @@ -316,16 +316,16 @@ XrPenStrokeSpline(XrPen *pen, XrSpline *spline, double tolerance, XrTraps *traps err = _XrPenStrokeSplineHalf(pen, spline, XrPenVertexFlagForward, &polygon); if (err) - return err; - + return err; + err = _XrPenStrokeSplineHalf(pen, spline, XrPenVertexFlagReverse, &polygon); if (err) - return err; - - XrPolygonClose(&polygon); - XrTrapsTessellatePolygon(traps, &polygon, 1); - XrPolygonDeinit(&polygon); - - return XrErrorSuccess; + return err; + + XrPolygonClose(&polygon); + XrTrapsTessellatePolygon(traps, &polygon, 1); + XrPolygonDeinit(&polygon); + + return XrErrorSuccess; } diff --git a/src/xrstroker.c b/src/xrstroker.c index e282a3886..9a7d34b21 100644 --- a/src/xrstroker.c +++ b/src/xrstroker.c @@ -44,8 +44,7 @@ XrStrokerStartDash (XrStroker *stroker) int i = 0; offset = gstate->dash_offset; - while (offset >= gstate->dashes[i]) - { + while (offset >= gstate->dashes[i]) { offset -= gstate->dashes[i]; on = 1-on; if (++i == gstate->ndashes) @@ -61,8 +60,7 @@ XrStrokerStepDash (XrStroker *stroker, double step) { XrGState *gstate = stroker->gstate; stroker->dash_remain -= step; - if (stroker->dash_remain <= 0) - { + if (stroker->dash_remain <= 0) { stroker->dash_index++; if (stroker->dash_index == gstate->ndashes) stroker->dash_index = 0; @@ -128,13 +126,10 @@ _XrStrokerJoin(XrStroker *stroker, XrStrokeFace *in, XrStrokeFace *out) return XrErrorSuccess; } - if (clockwise) - { + if (clockwise) { inpt = &in->cw; outpt = &out->cw; - } - else - { + } else { inpt = &in->ccw; outpt = &out->ccw; } @@ -145,8 +140,7 @@ _XrStrokerJoin(XrStroker *stroker, XrStrokeFace *in, XrStrokeFace *out) case XrLineJoinMiter: { XDouble c = in->vector.x * out->vector.x + in->vector.y * out->vector.y; double ml = gstate->miter_limit; - if (2 <= ml * ml * (1 - c)) - { + if (2 <= ml * ml * (1 - c)) { XDouble x1, y1, x2, y2; XDouble mx, my; XDouble dx1, dx2, dy1, dy2; @@ -381,8 +375,7 @@ XrStrokerAddEdgeDashed (void *closure, XPointFixed *p1, XPointFixed *p2) mag = sqrt(vector.x * vector.x + vector.y * vector.y); remain = mag; fd1 = *p1; - while (remain) - { + while (remain) { tmp = stroker->dash_remain; if (tmp > remain) tmp = remain; diff --git a/xrpath.c b/xrpath.c index 075871fcd..98a01ce3f 100644 --- a/xrpath.c +++ b/xrpath.c @@ -302,17 +302,15 @@ XrPathInterpret(XrPath *path, XrPathDirection dir, XrPathCallbacks *cb, void *cl op_buf = (dir == XrPathDirectionForward) ? op_buf->next : op_buf->prev) { int start, stop; - if (dir == XrPathDirectionForward) - { + if (dir == XrPathDirectionForward) { start = 0; stop = op_buf->num_ops; } else { start = op_buf->num_ops - 1; stop = -1; } - - for (i=start; i != stop; i += step) - { + + for (i=start; i != stop; i += step) { op = op_buf->op[i]; if (dir == XrPathDirectionReverse) { diff --git a/xrpen.c b/xrpen.c index 94b8a7413..85d700095 100644 --- a/xrpen.c +++ b/xrpen.c @@ -65,8 +65,8 @@ XrPenInit(XrPen *pen, double radius, XrGState *gstate) /* XXX: It would be nice to notice that the pen is already properly constructed. However, this test would also have to account for possible changes in the transformation matrix. - if (pen->radius == radius && pen->tolerance == tolerance) - return XrErrorSuccess; + if (pen->radius == radius && pen->tolerance == tolerance) + return XrErrorSuccess; */ XrPenDeinit(pen); } @@ -252,10 +252,10 @@ _XrPenStrokeSplineHalf(XrPen *pen, XrSpline *spline, XrPenVertexFlag dir, XrPoly int num_pts = spline->num_pts; for (i=0; i < pen->num_vertices; i++) { - if (pen->vertex[i].flag & dir) { - active = i; - break; - } + if (pen->vertex[i].flag & dir) { + active = i; + break; + } } if (dir == XrPenVertexFlagForward) { @@ -316,16 +316,16 @@ XrPenStrokeSpline(XrPen *pen, XrSpline *spline, double tolerance, XrTraps *traps err = _XrPenStrokeSplineHalf(pen, spline, XrPenVertexFlagForward, &polygon); if (err) - return err; - + return err; + err = _XrPenStrokeSplineHalf(pen, spline, XrPenVertexFlagReverse, &polygon); if (err) - return err; - - XrPolygonClose(&polygon); - XrTrapsTessellatePolygon(traps, &polygon, 1); - XrPolygonDeinit(&polygon); - - return XrErrorSuccess; + return err; + + XrPolygonClose(&polygon); + XrTrapsTessellatePolygon(traps, &polygon, 1); + XrPolygonDeinit(&polygon); + + return XrErrorSuccess; } diff --git a/xrstroker.c b/xrstroker.c index e282a3886..9a7d34b21 100644 --- a/xrstroker.c +++ b/xrstroker.c @@ -44,8 +44,7 @@ XrStrokerStartDash (XrStroker *stroker) int i = 0; offset = gstate->dash_offset; - while (offset >= gstate->dashes[i]) - { + while (offset >= gstate->dashes[i]) { offset -= gstate->dashes[i]; on = 1-on; if (++i == gstate->ndashes) @@ -61,8 +60,7 @@ XrStrokerStepDash (XrStroker *stroker, double step) { XrGState *gstate = stroker->gstate; stroker->dash_remain -= step; - if (stroker->dash_remain <= 0) - { + if (stroker->dash_remain <= 0) { stroker->dash_index++; if (stroker->dash_index == gstate->ndashes) stroker->dash_index = 0; @@ -128,13 +126,10 @@ _XrStrokerJoin(XrStroker *stroker, XrStrokeFace *in, XrStrokeFace *out) return XrErrorSuccess; } - if (clockwise) - { + if (clockwise) { inpt = &in->cw; outpt = &out->cw; - } - else - { + } else { inpt = &in->ccw; outpt = &out->ccw; } @@ -145,8 +140,7 @@ _XrStrokerJoin(XrStroker *stroker, XrStrokeFace *in, XrStrokeFace *out) case XrLineJoinMiter: { XDouble c = in->vector.x * out->vector.x + in->vector.y * out->vector.y; double ml = gstate->miter_limit; - if (2 <= ml * ml * (1 - c)) - { + if (2 <= ml * ml * (1 - c)) { XDouble x1, y1, x2, y2; XDouble mx, my; XDouble dx1, dx2, dy1, dy2; @@ -381,8 +375,7 @@ XrStrokerAddEdgeDashed (void *closure, XPointFixed *p1, XPointFixed *p2) mag = sqrt(vector.x * vector.x + vector.y * vector.y); remain = mag; fd1 = *p1; - while (remain) - { + while (remain) { tmp = stroker->dash_remain; if (tmp > remain) tmp = remain;