]> granicus.if.org Git - graphviz/commitdiff
smyrna on_attrSearchBtn_clicked: use const types for attribute and regex
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 25 Sep 2022 18:12:48 +0000 (11:12 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 26 Sep 2022 15:05:40 +0000 (08:05 -0700)
This avoids some casting and squashes two -Wcast-qual warnings.

cmd/smyrna/gui/frmobjectui.c

index 7326034abde5f6b83657f558fc2a2fdc5414e4da..53b9f476c038b1ad1c028cb5c0146eb8362268af 100644 (file)
@@ -703,7 +703,8 @@ void showAttrsWidget(topview * t)
     filter_attributes("", view->Topview);
 }
 
-static void gvpr_select(char *attrname, char *regex_str, int objType) {
+static void gvpr_select(const char *attrname, const char *regex_str,
+                        int objType) {
 
     char *bf2;
     int i, argc;
@@ -738,11 +739,9 @@ _BB void on_attrSearchBtn_clicked(GtkWidget * widget, gpointer user_data)
     (void)widget;
     (void)user_data;
 
-    char *attrname =
-       (char *) gtk_entry_get_text((GtkEntry *)
+    const char *attrname = gtk_entry_get_text((GtkEntry *)
                                    glade_xml_get_widget(xml, "txtAttr"));
-    char *regex_str =
-       (char *) gtk_entry_get_text((GtkEntry *)
+    const char *regex_str = gtk_entry_get_text((GtkEntry *)
                                    glade_xml_get_widget(xml, "txtValue"));
     gvpr_select(attrname, regex_str, get_object_type());