]> granicus.if.org Git - graphviz/commitdiff
Give better names for setEdgeType arguments
authorMark Hansen <markhansen@google.com>
Mon, 14 Nov 2022 10:49:06 +0000 (21:49 +1100)
committerMark Hansen <markhansen@google.com>
Mon, 14 Nov 2022 10:52:49 +0000 (21:52 +1100)
lib/common/utils.c
lib/common/utils.h

index 678533df7f24833a252ae0297c5e9837a4082204..ac6b6becd8ce345dd257f9a1bec6c584098667f7 100644 (file)
@@ -1634,7 +1634,7 @@ static int edgeType(const char *s, int dflt)
 
 /* setEdgeType:
  * Sets graph's edge type based on the "splines" attribute.
- * If the attribute is not defined, use default.
+ * If the attribute is not defined, use defaultValue.
  * If the attribute is "", use NONE.
  * If attribute value matches (case indepedent), use match.
  *   ortho => EDGETYPE_ORTHO
@@ -1642,25 +1642,23 @@ static int edgeType(const char *s, int dflt)
  *   line => EDGETYPE_LINE
  *   polyline => EDGETYPE_PLINE
  *   spline => EDGETYPE_SPLINE
- * If attribute is boolean, true means EDGETYPE_SPLINE, false means EDGETYPE_LINE.
- * Else warn and use default.
+ * If attribute is boolean, true means EDGETYPE_SPLINE, false means
+ * EDGETYPE_LINE. Else warn and use default.
  */
-void setEdgeType (graph_t* g, int dflt)
-{
+void setEdgeType(graph_t *g, int defaultValue) {
     char* s = agget(g, "splines");
     int et;
 
     if (!s) {
-       et = dflt;
+        et = defaultValue;
     }
     else if (*s == '\0') {
        et = EDGETYPE_NONE;
-    }
-    else et = edgeType (s, dflt);
+    } else
+        et = edgeType(s, defaultValue);
     GD_flags(g) |= et;
 }
 
-
 /* get_gradient_points
  * Evaluates the extreme points of an ellipse or polygon
  * Determines the point at the center of the extreme points
index 19a442291370427ab9996efaf8a17641b85c931d..76c77bfcd5c9f9f490b7158b619c0c09f9af1852 100644 (file)
@@ -122,7 +122,7 @@ UTILS_API pointf spline_at_y(splines *spl, double y);
 
 UTILS_API Agsym_t *setAttr(graph_t *, void *, char *name, char *value,
                            Agsym_t *);
-UTILS_API void setEdgeType(graph_t *g, int dflt);
+UTILS_API void setEdgeType(graph_t *g, int defaultValue);
 UTILS_API bool is_a_cluster(Agraph_t *g);
 
 /* from postproc.c */