From 3b69267e4476c7e46b7a06d9b15da32a40fdebd9 Mon Sep 17 00:00:00 2001 From: Mark Hansen Date: Wed, 16 Nov 2022 17:27:12 +1100 Subject: [PATCH] Construct objects inline, brace else's --- lib/common/utils.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) 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; } -- 2.50.1