]> granicus.if.org Git - graphviz/commitdiff
smyrna: remove unnecessary parens
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 8 Apr 2022 02:02:33 +0000 (19:02 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 10 Apr 2022 20:48:40 +0000 (13:48 -0700)
cmd/smyrna/viewport.c

index 3726eac2effe2d67f712c6e87f25d1ead46b7283..687b49a1762ea55ce979031b045da9fef11e0c0b 100644 (file)
@@ -81,7 +81,7 @@ char *get_attribute_value(char *attr, ViewInfo * view, Agraph_t * g)
 {
     char *buf;
     buf = agget(g, attr);
-    if ((!buf) || (*buf == '\0'))
+    if (!buf || *buf == '\0')
        buf = agget(view->systemGraphs.def_attrs, attr);
     return buf;
 }
@@ -281,7 +281,7 @@ void init_viewport(ViewInfo * view)
     }
     view->systemGraphs.attrs_widgets = agread(input_file2, NULL);
     fclose (input_file2);
-    if (!(view->systemGraphs.attrs_widgets )) {
+    if (!view->systemGraphs.attrs_widgets) {
        fprintf(stderr,"could not load default attribute widgets graph file \"%s\"\n",smyrnaPath("attr_widgets.dot"));
        graphviz_exit(-1);
     }
@@ -533,7 +533,7 @@ int add_graph_to_viewport(Agraph_t * graph, char *id)
 }
 void switch_graph(int graphId)
 {
-    if ((graphId >= view->graphCount) || (graphId < 0))
+    if (graphId >= view->graphCount || graphId < 0)
        return;                 /*wrong entry */
     else
        activate(graphId);
@@ -629,7 +629,7 @@ void glexpose(void)
 
 static float interpol(float minv, float maxv, float minc, float maxc, float x)
 {
-    return ((x - minv) * (maxc - minc) / (maxv - minv) + minc);
+    return (x - minv) * (maxc - minc) / (maxv - minv) + minc;
 }
 
 void getcolorfromschema(colorschemaset * sc, float l, float maxl,