fprintf(stderr, "newpath\n");
for (i = 0; i < sz; i++)
fprintf(stderr, "%f %f %s\n", p[i].x, p[i].y,
- (i == 0 ? "moveto" : "lineto"));
+ i == 0 ? "moveto" : "lineto");
fprintf(stderr, "closepath stroke\n");
}
static void psprintpoint(point p)
Show_boxes[li++] = strdup ("gsave 1 0 0 setrgbcolor newpath");
for (i = 0; i < spl.pn; i++) {
snprintf(buf, sizeof(buf), "%f %f %s", spl.ps[i].x, spl.ps[i].y,
- (i == 0) ? "moveto" : ((i % 3 == 0) ? "curveto" : ""));
+ i == 0 ? "moveto" : (i % 3 == 0 ? "curveto" : ""));
Show_boxes[li++] = strdup (buf);
}
Show_boxes[li++] = strdup ("stroke grestore");
Show_boxes[li++] = strdup ("gsave 0 0 1 setrgbcolor newpath");
for (i = 0; i < pl.pn; i++) {
snprintf(buf, sizeof(buf), "%f %f %s", pl.ps[i].x, pl.ps[i].y,
- (i == 0 ? "moveto" : "lineto"));
+ i == 0 ? "moveto" : "lineto");
Show_boxes[li++] = strdup (buf);
}
Show_boxes[li++] = strdup ("stroke grestore");
tl.y = (int)p.ps[bi].y;
hd.x = (int)p.ps[(bi+1) % p.pn].x;
hd.y = (int)p.ps[(bi+1) % p.pn].y;
- if ((tl.x == hd.x) && (tl.y == hd.y)) pfx = "%%";
+ if (tl.x == hd.x && tl.y == hd.y) pfx = "%%";
else pfx ="";
snprintf(buf, sizeof(buf), "%s%d %d %d %d makevec", pfx, tl.x, tl.y, hd.x,
hd.y);
static int debugleveln(edge_t* realedge, int i)
{
- return (GD_showboxes(agraphof(aghead(realedge))) == i ||
+ return GD_showboxes(agraphof(aghead(realedge))) == i ||
GD_showboxes(agraphof(agtail(realedge))) == i ||
ED_showboxes(realedge) == i ||
ND_showboxes(aghead(realedge)) == i ||
- ND_showboxes(agtail(realedge)) == i);
+ ND_showboxes(agtail(realedge)) == i;
}
#endif /* DEBUG */
polypointn = boxn * 8;
}
- if ((boxn > 1) && (boxes[0].LL.y > boxes[1].LL.y)) {
+ if (boxn > 1 && boxes[0].LL.y > boxes[1].LL.y) {
flip = 1;
for (bi = 0; bi < boxn; bi++) {
double v = boxes[bi].UR.y;
for (bi = 0, pi = 0; bi < boxn; bi++) {
next = prev = 0;
if (bi > 0)
- prev = (boxes[bi].LL.y > boxes[bi - 1].LL.y) ? -1 : 1;
+ prev = boxes[bi].LL.y > boxes[bi - 1].LL.y ? -1 : 1;
if (bi < boxn - 1)
- next = (boxes[bi + 1].LL.y > boxes[bi].LL.y) ? 1 : -1;
+ next = boxes[bi + 1].LL.y > boxes[bi].LL.y ? 1 : -1;
if (prev != next) {
if (next == -1 || prev == 1) {
polypoints[pi].x = boxes[bi].LL.x;
for (bi = boxn - 1; bi >= 0; bi--) {
next = prev = 0;
if (bi < boxn - 1)
- prev = (boxes[bi].LL.y > boxes[bi + 1].LL.y) ? -1 : 1;
+ prev = boxes[bi].LL.y > boxes[bi + 1].LL.y ? -1 : 1;
if (bi > 0)
- next = (boxes[bi - 1].LL.y > boxes[bi].LL.y) ? 1 : -1;
+ next = boxes[bi - 1].LL.y > boxes[bi].LL.y ? 1 : -1;
if (prev != next) {
if (next == -1 || prev == 1 ) {
polypoints[pi].x = boxes[bi].LL.x;
ps[splinepi] = spl.ps[splinepi];
}
- for (loopcnt = 0; unbounded && (loopcnt < LOOP_TRIES); loopcnt++) {
+ for (loopcnt = 0; unbounded && loopcnt < LOOP_TRIES; loopcnt++) {
limitBoxes (boxes, boxn, ps, spl.pn, delta);
/* The following check is necessary because if a box is not very
for (bi = 0; bi < boxn; bi++) {
/* these fp equality tests are used only to detect if the
* values have been changed since initialization - ok */
- if ((boxes[bi].LL.x == INT_MAX) || (boxes[bi].UR.x == INT_MIN)) {
+ if (boxes[bi].LL.x == INT_MAX || boxes[bi].UR.x == INT_MIN) {
delta *= 2; /* try again with a finer interval */
if (delta > INT_MAX/boxn) /* in limitBoxes, boxn*delta must fit in an int, so give up */
loopcnt = LOOP_TRIES;
return 0;
if (i0 >= j1)
return 0;
- if ((j0 <= i0) && (i0 <= j1))
- return (j1 - i0);
- if ((j0 <= i1) && (i1 <= j1))
- return (i1 - j0);
+ if (j0 <= i0 && i0 <= j1)
+ return j1 - i0;
+ if (j0 <= i1 && i1 <= j1)
+ return i1 - j0;
return MIN(i1 - i0, j1 - j0);
}
printpath(thepath);
return 1;
}
- l = (ba->UR.x < bb->LL.x) ? 1 : 0;
- r = (ba->LL.x > bb->UR.x) ? 1 : 0;
- d = (ba->UR.y < bb->LL.y) ? 1 : 0;
- u = (ba->LL.y > bb->UR.y) ? 1 : 0;
+ l = ba->UR.x < bb->LL.x ? 1 : 0;
+ r = ba->LL.x > bb->UR.x ? 1 : 0;
+ d = ba->UR.y < bb->LL.y ? 1 : 0;
+ u = ba->LL.y > bb->UR.y ? 1 : 0;
errs = l + r + d + u;
if (errs > 0 && Verbose) {
fprintf(stderr, "in checkpath, boxes %d and %d don't touch\n",
e_cnt = 1;
e0 = e;
- while ((e0 != ED_to_virt(e0)) && (e0 = ED_to_virt(e0))) e_cnt++;
+ while (e0 != ED_to_virt(e0) && (e0 = ED_to_virt(e0))) e_cnt++;
if (e_cnt <= MAX_EDGE)
edges = elist;
pointf dumb[4];
node_t *n;
node_t *head;
- int curved = (et == ET_CURVED);
+ int curved = et == ET_CURVED;
pointf perp;
pointf del;
edge_t *e0;
head = aghead(e);
p = dumb[1] = dumb[0] = add_pointf(ND_coord(n), ED_tail_port(e).p);
q = dumb[2] = dumb[3] = add_pointf(ND_coord(head), ED_head_port(e).p);
- if ((e_cnt == 1) || Concentrate) {
+ if (e_cnt == 1 || Concentrate) {
if (curved) bend(dumb,get_cycle_centroid(g, edges[0]));
clip_and_install(e, aghead(e), dumb, 4, sinfo);
addEdgeLabels(g, e, p, q);
l_perp = LEN(perp.x, perp.y);
xstep = GD_nodesep(g->root);
dx = xstep * (e_cnt - 1) / 2;
- dumb[1].x = dumb[0].x + (dx * perp.x) / l_perp;
- dumb[1].y = dumb[0].y + (dx * perp.y) / l_perp;
- dumb[2].x = dumb[3].x + (dx * perp.x) / l_perp;
- dumb[2].y = dumb[3].y + (dx * perp.y) / l_perp;
+ dumb[1].x = dumb[0].x + dx * perp.x / l_perp;
+ dumb[1].y = dumb[0].y + dx * perp.y / l_perp;
+ dumb[2].x = dumb[3].x + dx * perp.x / l_perp;
+ dumb[2].y = dumb[3].y + dx * perp.y / l_perp;
del.x = -xstep * perp.x / l_perp;
del.y = -xstep * perp.y / l_perp;
}