Standardized bracing-style and indentation

This commit is contained in:
Carl Worth 2002-10-01 04:37:42 +00:00
parent cf44ac0f7a
commit fe0606c763
6 changed files with 48 additions and 66 deletions

View file

@ -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) {

View file

@ -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;
}

View file

@ -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;

View file

@ -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) {

30
xrpen.c
View file

@ -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;
}

View file

@ -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;