From: Matthew Fernandez Date: Mon, 26 Dec 2022 21:09:47 +0000 (-0800) Subject: common: replace 'boxfof' with C99 initialization X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6f776f75d7a4272bc2763a4911fc5969a7fe58be;p=graphviz common: replace 'boxfof' with C99 initialization --- diff --git a/lib/common/geomprocs.h b/lib/common/geomprocs.h index df0d0869d..92d474282 100644 --- a/lib/common/geomprocs.h +++ b/lib/common/geomprocs.h @@ -52,15 +52,6 @@ GEOMPROCS_API void rect2poly(pointf *p); GEOMPROCS_API int line_intersect (pointf a, pointf b, pointf c, pointf d, pointf* p); -static inline boxf boxfof(double llx, double lly, double urx, double ury) -{ - boxf b; - - b.LL.x = llx, b.LL.y = lly; - b.UR.x = urx, b.UR.y = ury; - return b; -} - static inline point add_point(point p, point q) { point r; diff --git a/lib/common/htmltable.c b/lib/common/htmltable.c index e5d4ab242..76e975098 100644 --- a/lib/common/htmltable.c +++ b/lib/common/htmltable.c @@ -2037,7 +2037,7 @@ int make_html_label(void *obj, textlabel_t * lp) rv |= size_html_tbl(g, lbl->u.tbl, NULL, &env); wd2 = lbl->u.tbl->data.box.UR.x / 2; ht2 = lbl->u.tbl->data.box.UR.y / 2; - box = boxfof(-wd2, -ht2, wd2, ht2); + box = (boxf){{-wd2, -ht2}, {wd2, ht2}}; pos_html_tbl(lbl->u.tbl, box, BOTTOM | RIGHT | TOP | LEFT); lp->dimen.x = box.UR.x - box.LL.x; lp->dimen.y = box.UR.y - box.LL.y; @@ -2045,7 +2045,7 @@ int make_html_label(void *obj, textlabel_t * lp) rv |= size_html_txt(GD_gvc(g), lbl->u.txt, &env); wd2 = lbl->u.txt->box.UR.x / 2; ht2 = lbl->u.txt->box.UR.y / 2; - box = boxfof(-wd2, -ht2, wd2, ht2); + box = (boxf){{-wd2, -ht2}, {wd2, ht2}}; lbl->u.txt->box = box; lp->dimen.x = box.UR.x - box.LL.x; lp->dimen.y = box.UR.y - box.LL.y; diff --git a/lib/dotgen/dotsplines.c b/lib/dotgen/dotsplines.c index acd86a2ec..17f52e940 100644 --- a/lib/dotgen/dotsplines.c +++ b/lib/dotgen/dotsplines.c @@ -2122,9 +2122,9 @@ static boxf makeregularend(boxf b, int side, double y) { assert(side == BOTTOM || side == TOP); if (side == BOTTOM) { - return boxfof(b.LL.x, y, b.UR.x, b.LL.y); + return (boxf){{b.LL.x, y}, {b.UR.x, b.LL.y}}; } - return boxfof(b.LL.x, b.UR.y, b.UR.x, y); + return (boxf){{b.LL.x, b.UR.y}, {b.UR.x, y}}; } #ifndef DONT_WANT_ANY_ENDPOINT_PATH_REFINEMENT