]> granicus.if.org Git - graphviz/commitdiff
common: replace 'boxfof' with C99 initialization
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 26 Dec 2022 21:09:47 +0000 (13:09 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 31 Dec 2022 23:34:34 +0000 (15:34 -0800)
lib/common/geomprocs.h
lib/common/htmltable.c
lib/dotgen/dotsplines.c

index df0d0869da836c149bcd35e9b67f227027ddf551..92d474282dad52cf56005a8f006faa1e9d3b367d 100644 (file)
@@ -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;
index e5d4ab2424d331d7e20d4199de6385a72f4f7dff..76e975098ff5eb2817971bb940b0141b4ce788c1 100644 (file)
@@ -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;
index acd86a2eccb3c661d67bc5a76b5257b941540aa1..17f52e940b29c8a3accfc9972fcc3233a5f02311 100644 (file)
@@ -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