From: Mark Hansen Date: Wed, 16 Nov 2022 06:27:12 +0000 (+1100) Subject: Construct objects inline, brace else's X-Git-Tag: 7.0.2~8^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3b69267e4476c7e46b7a06d9b15da32a40fdebd9;p=graphviz Construct objects inline, brace else's --- diff --git a/lib/common/utils.c b/lib/common/utils.c index bb6f6839b..6dedc975b 100644 --- a/lib/common/utils.c +++ b/lib/common/utils.c @@ -1510,9 +1510,7 @@ bool overlap_node(node_t *n, boxf b) { /* FIXME - need to do something better about CLOSEENOUGH */ pointf p = sub_pointf(ND_coord(n), mid_pointf(b.UR, b.LL)); - inside_t ictxt; - ictxt.s.n = n; - ictxt.s.bp = NULL; + inside_t ictxt = {.s.n = n}; return ND_shape(n)->fns->insidefn(&ictxt, p); } @@ -1522,9 +1520,7 @@ bool overlap_label(textlabel_t *lp, boxf b) pointf s; s.x = lp->dimen.x / 2.; s.y = lp->dimen.y / 2.; - boxf bb; - bb.LL = sub_pointf(lp->pos, s); - bb.UR = add_pointf(lp->pos, s); + boxf bb = {.LL = sub_pointf(lp->pos, s), .UR = add_pointf(lp->pos, s)}; return OVERLAP(b, bb); } @@ -1633,8 +1629,9 @@ void setEdgeType(graph_t *g, int defaultValue) { } else if (*s == '\0') { et = EDGETYPE_NONE; - } else + } else { et = edgeType(s, defaultValue); + } GD_flags(g) |= et; }