#ifdef DEBUG
static int debugleveln(edge_t* e, int i)
{
- return (GD_showboxes(agraphof(aghead(e))) == i ||
+ return GD_showboxes(agraphof(aghead(e))) == i ||
GD_showboxes(agraphof(agtail(e))) == i ||
ED_showboxes(e) == i ||
ND_showboxes(aghead(e)) == i ||
- ND_showboxes(agtail(e)) == i);
+ ND_showboxes(agtail(e)) == i;
}
static void showPoints(pointf ps[], int pn)
for (orig = fe; ED_edge_type(orig) != NORMAL; orig = ED_to_orig(orig));
/* may be a reversed flat edge */
- if (!info->ignoreSwap && (ND_rank(tn) == ND_rank(hn)) && (ND_order(tn) > ND_order(hn))) {
+ if (!info->ignoreSwap && ND_rank(tn) == ND_rank(hn) && ND_order(tn) > ND_order(hn)) {
node_t *tmp;
tmp = hn;
hn = tn;
p.x = ND_coord(n).x - (s_in / cnt_in);
p.y = ND_coord(n).y - ND_coord(agtail(ND_in(n).list[0])).y;
m_in = atan2(p.y, p.x);
- p.x = (s_out / cnt_out) - ND_coord(n).x;
+ p.x = s_out / cnt_out - ND_coord(n).x;
p.y = ND_coord(aghead(ND_out(n).list[0])).y - ND_coord(n).y;
m_out = atan2(p.y, p.x);
- return ((m_in + m_out) / 2.0);
+ return (m_in + m_out) / 2.0;
}
void add_box(path * P, boxf b)
P->nbox = 0;
P->data = (void *) e;
endp->np = P->start.p;
- if ((et == REGULAREDGE) && (ND_node_type(n) == NORMAL) && ((side = ED_tail_port(e).side))) {
+ if (et == REGULAREDGE && ND_node_type(n) == NORMAL && (side = ED_tail_port(e).side)) {
edge_t* orig;
boxf b0, b = endp->nb;
if (side & TOP) {
ED_head_port(orig).clip = FALSE;
return;
}
- if ((et == FLATEDGE) && ((side = ED_tail_port(e).side))) {
+ if (et == FLATEDGE && (side = ED_tail_port(e).side)) {
boxf b0, b = endp->nb;
edge_t* orig;
if (side & TOP) {
P->end.constrained = FALSE;
}
endp->np = P->end.p;
- if ((et == REGULAREDGE) && (ND_node_type(n) == NORMAL) && ((side = ED_head_port(e).side))) {
+ if (et == REGULAREDGE && ND_node_type(n) == NORMAL && (side = ED_head_port(e).side)) {
edge_t* orig;
boxf b0, b = endp->nb;
if (side & TOP) {
return;
}
- if ((et == FLATEDGE) && ((side = ED_head_port(e).side))) {
+ if (et == FLATEDGE && (side = ED_head_port(e).side)) {
boxf b0, b = endp->nb;
edge_t* orig;
if (side & TOP) {
e = edges[ind];
n = agtail(e);
- stepx = (sizex / 2.) / cnt;
+ stepx = sizex / 2.0 / cnt;
stepx = MAX(stepx,2.);
np = ND_coord(n);
tp = ED_tail_port(e).p;
e = edges[ind];
n = agtail(e);
- stepx = (sizex / 2.) / cnt;
+ stepx = sizex / 2.0 / cnt;
stepx = MAX(stepx, 2.);
np = ND_coord(n);
tp = ED_tail_port(e).p;
case 51:
case 57:
case 58:
- dx = sgn*((((ND_lw(n)-(np.x-tp.x)) + (ND_rw(n)-(hp.x-np.x)))/3.));
+ dx = sgn * ((ND_lw(n) - (np.x - tp.x) + (ND_rw(n) - (hp.x - np.x))) / 3.0);
break;
case 73:
dx = sgn*(ND_lw(n)-(np.x-tp.x) + stepx);
dx = sgn*(ND_lw(n)-(np.x-tp.x));
break;
case 84:
- dx = sgn*((((ND_lw(n)-(np.x-tp.x)) + (ND_rw(n)-(hp.x-np.x)))/2.) + stepx);
- break;
+ dx = sgn *
+ ((ND_lw(n) - (np.x - tp.x) + (ND_rw(n) - (hp.x - np.x))) / 2.0 +
+ stepx);
+ break;
case 74:
case 75:
case 85:
- dx = sgn*((((ND_lw(n)-(np.x-tp.x)) + (ND_rw(n)-(hp.x-np.x)))/2.) + 2*stepx);
- break;
+ dx = sgn *
+ ((ND_lw(n) - (np.x - tp.x) + (ND_rw(n) - (hp.x - np.x))) / 2.0 +
+ 2 * stepx);
+ break;
default:
break;
}
e = edges[ind];
n = agtail(e);
- stepy = (sizey / 2.) / cnt;
+ stepy = sizey / 2.0 / cnt;
stepy = MAX(stepy, 2.);
np = ND_coord(n);
tp = ED_tail_port(e).p;
e = edges[ind];
n = agtail(e);
- stepy = (sizey / 2.) / cnt;
+ stepy = sizey / 2.0 / cnt;
stepy = MAX(stepy,2.);
np = ND_coord(n);
tp = ED_tail_port(e).p;
double label_width;
textlabel_t* l = ED_label(e);
- if (((!ED_tail_port(e).defined) && (!ED_head_port(e).defined)) ||
- (!(ED_tail_port(e).side & LEFT) &&
+ if ((!ED_tail_port(e).defined && !ED_head_port(e).defined) ||
+ (!(ED_tail_port(e).side & LEFT) &&
!(ED_head_port(e).side & LEFT) &&
- ((ED_tail_port(e).side != ED_head_port(e).side) ||
- (!(ED_tail_port(e).side & (TOP|BOTTOM)))))) {
+ (ED_tail_port(e).side != ED_head_port(e).side ||
+ !(ED_tail_port(e).side & (TOP|BOTTOM))))) {
sw = SELF_EDGE_SIZE;
if (l) {
label_width = GD_flip(agraphof(aghead(e))) ? l->dimen.y : l->dimen.x;
* and at most 1 on bottom
*/
- if (((!ED_tail_port(e).defined) && (!ED_head_port(e).defined)) ||
- (!(ED_tail_port(e).side & LEFT) &&
+ if ((!ED_tail_port(e).defined && !ED_head_port(e).defined) ||
+ (!(ED_tail_port(e).side & LEFT) &&
!(ED_head_port(e).side & LEFT) &&
- ((ED_tail_port(e).side != ED_head_port(e).side) ||
- (!(ED_tail_port(e).side & (TOP|BOTTOM)))))) {
+ (ED_tail_port(e).side != ED_head_port(e).side ||
+ !(ED_tail_port(e).side & (TOP|BOTTOM))))) {
selfRight(edges, ind, cnt, sizex, sizey, sinfo);
}
if (d >= dist) {
*pp = pf;
*pq = qf;
- mf.x = ((qf.x*dist) + (pf.x*(d-dist)))/d;
- mf.y = ((qf.y*dist) + (pf.y*(d-dist)))/d;
+ mf.x = (qf.x * dist + pf.x * (d - dist)) / d;
+ mf.y = (qf.y * dist + pf.y * (d - dist)) / d;
return mf;
}
else
if (APPROXEQPT(p, q, MILLIPOINT)) { /* degenerate spline */
spf = p;
}
- else if ((et == ET_SPLINE) || (et == ET_CURVED)) {
+ else if (et == ET_SPLINE || et == ET_CURVED) {
d.x = (q.x + p.x) / 2.;
d.y = (p.y + q.y) / 2.;
spf = dotneato_closest(ED_spl(e), d);
if (ED_edge_type(e) == IGNORED)
return 0;
/* add label here only if labelangle or labeldistance is defined; else, use external label */
- if ((!E_labelangle || (*(la = AGXGET(e,E_labelangle)) == '\0')) &&
- (!E_labeldistance || (*(ld = AGXGET(e,E_labeldistance)) == '\0'))) {
+ if ((!E_labelangle || *(la = AGXGET(e,E_labelangle)) == '\0') &&
+ (!E_labeldistance || *(ld = AGXGET(e,E_labeldistance)) == '\0')) {
return 0;
}