]> granicus.if.org Git - graphviz/commitdiff
smyrna on_attrAddBtn_clicked: use const type to squash a -Wcast-qual warning
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 22 Jul 2022 01:45:23 +0000 (18:45 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 27 Jul 2022 14:27:01 +0000 (07:27 -0700)
Unfortunately we cannot also do the same for `attr_name` in this function
because it is passed to a Graphviz function that accepts a non-const pointer.

cmd/smyrna/gui/frmobjectui.c

index 521e8c99c453d327298fdd44b55b23154c847163..bc0da134d4da75847b9436d8d6d6ac80c472c69e 100644 (file)
@@ -514,7 +514,6 @@ _BB void on_attrAddBtn_clicked(GtkWidget * widget, gpointer user_data)
     (void)user_data;
 
     char *attr_name;
-    char *defValue;
     int objKind;
     topview *t;
     Agraph_t *g;
@@ -525,8 +524,7 @@ _BB void on_attrAddBtn_clicked(GtkWidget * widget, gpointer user_data)
     attr_name =
        (char *) gtk_entry_get_text((GtkEntry *)
                                    glade_xml_get_widget(xml, "txtAttr"));
-    defValue =
-       (char *) gtk_entry_get_text((GtkEntry *)
+    const char *defValue = gtk_entry_get_text((GtkEntry *)
                                    glade_xml_get_widget(xml,
                                                         "txtDefValue"));
     g = view->g[view->activeGraph];