diff options
author | Michael Mann <mmann78@netscape.net> | 2016-06-05 22:24:47 -0400 |
---|---|---|
committer | Jaap Keuter <jaap.keuter@xs4all.nl> | 2016-06-06 06:03:58 +0000 |
commit | 57ef06e242dbbce390547d9711f810fc60829219 (patch) | |
tree | eaadf36f96023dd59c3fd56565bf6e14c9e57431 /ui/gtk | |
parent | 6333b98ea6f7733b150537cbba6f80f3e2d83d43 (diff) |
*_stdup_printf -> strdup for "single string only" formatting.
Done for performance improvements.
This could probably be done in checkAPIs.pl, but this was just
a quick manual check with grepping.
Change-Id: I91ff102cb528bb00fa2f65489de53890e7e46f2d
Reviewed-on: https://code.wireshark.org/review/15751
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Diffstat (limited to 'ui/gtk')
-rw-r--r-- | ui/gtk/capture_dlg.c | 6 | ||||
-rw-r--r-- | ui/gtk/filter_utils.c | 6 | ||||
-rw-r--r-- | ui/gtk/main.c | 4 | ||||
-rw-r--r-- | ui/gtk/prefs_column.c | 6 | ||||
-rw-r--r-- | ui/gtk/proto_hier_stats_dlg.c | 4 | ||||
-rw-r--r-- | ui/gtk/sctp_assoc_analyse.c | 2 | ||||
-rw-r--r-- | ui/gtk/sctp_stat_dlg.c | 2 | ||||
-rw-r--r-- | ui/gtk/stats_tree_stat.c | 4 |
8 files changed, 17 insertions, 17 deletions
diff --git a/ui/gtk/capture_dlg.c b/ui/gtk/capture_dlg.c index 92adc460a2..175e6854d7 100644 --- a/ui/gtk/capture_dlg.c +++ b/ui/gtk/capture_dlg.c @@ -1338,7 +1338,7 @@ insert_new_rows(GList *list) * used. */ if (data_link_info->description != NULL) { - str = g_strdup_printf("%s", data_link_info->description); + str = g_strdup(data_link_info->description); linkr->dlt = data_link_info->dlt; } else { str = g_strdup_printf("%s (not supported)", data_link_info->name); @@ -3369,7 +3369,7 @@ static void change_pipe_name_cb(gpointer dialog _U_, gint btn, gpointer data) g_free(device.name); g_free(device.display_name); device.name = g_strdup((gchar *)data); - device.display_name = g_strdup_printf("%s", device.name); + device.display_name = g_strdup(device.name); g_array_remove_index(global_capture_opts.all_ifaces, i); g_array_insert_val(global_capture_opts.all_ifaces, i, device); temp = g_strdup_printf("<b>%s</b>", device.display_name); @@ -3479,7 +3479,7 @@ add_pipe_cb(gpointer w _U_) pipe_name = g_strdup(g_save_file); memset(&device, 0, sizeof(device)); device.name = g_strdup(g_save_file); - device.display_name = g_strdup_printf("%s", device.name); + device.display_name = g_strdup(device.name); device.hidden = FALSE; device.selected = TRUE; device.type = IF_PIPE; diff --git a/ui/gtk/filter_utils.c b/ui/gtk/filter_utils.c index 3e270eb7b3..502a5dfc70 100644 --- a/ui/gtk/filter_utils.c +++ b/ui/gtk/filter_utils.c @@ -45,20 +45,20 @@ apply_selected_filter (guint callback_action, const char *filter) switch(type){ case ACTYPE_SELECTED: - str = g_strdup_printf("%s", filter); + str = g_strdup(filter); break; case ACTYPE_NOT_SELECTED: str = g_strdup_printf("!(%s)", filter); break; case ACTYPE_AND_SELECTED: if ((!current_filter) || (0 == strlen(current_filter))) - str = g_strdup_printf("%s", filter); + str = g_strdup(filter); else str = g_strdup_printf("(%s) && (%s)", current_filter, filter); break; case ACTYPE_OR_SELECTED: if ((!current_filter) || (0 == strlen(current_filter))) - str = g_strdup_printf("%s", filter); + str = g_strdup(filter); else str = g_strdup_printf("(%s) || (%s)", current_filter, filter); break; diff --git a/ui/gtk/main.c b/ui/gtk/main.c index 71a4d8e15d..863d16f372 100644 --- a/ui/gtk/main.c +++ b/ui/gtk/main.c @@ -543,13 +543,13 @@ get_ip_address_list_from_packet_list_row(gpointer data) /* First check selected column */ if (is_address_column (column)) { - addr_list = g_list_append (addr_list, g_strdup_printf("%s", cfile.cinfo.col_expr.col_expr_val[column])); + addr_list = g_list_append (addr_list, g_strdup(cfile.cinfo.col_expr.col_expr_val[column])); } for (col = 0; col < cfile.cinfo.num_cols; col++) { /* Then check all columns except the selected */ if ((col != column) && (is_address_column (col))) { - addr_list = g_list_append (addr_list, g_strdup_printf("%s", cfile.cinfo.col_expr.col_expr_val[col])); + addr_list = g_list_append (addr_list, g_strdup(cfile.cinfo.col_expr.col_expr_val[col])); } } diff --git a/ui/gtk/prefs_column.c b/ui/gtk/prefs_column.c index 715042a95b..8858eeeb4e 100644 --- a/ui/gtk/prefs_column.c +++ b/ui/gtk/prefs_column.c @@ -190,7 +190,7 @@ column_prefs_show(GtkWidget *prefs_window) { cfmt->custom_fields = NULL; cfmt->custom_occurrence = 0; } - fmt = g_strdup_printf("%s", col_format_desc(cfmt->fmt)); + fmt = g_strdup(col_format_desc(cfmt->fmt)); } gtk_list_store_insert_with_values(store, &iter, G_MAXINT, VISIBLE_COLUMN, cfmt->visible, @@ -561,7 +561,7 @@ column_menu_changed_cb(GtkWidget *w, gpointer data) { /* Changing from custom to non-custom */ gtk_editable_delete_text(GTK_EDITABLE(field_te), 0, -1); gtk_editable_delete_text(GTK_EDITABLE(occurrence_te), 0, -1); - fmt = g_strdup_printf("%s", col_format_desc(cur_cb_fmt)); + fmt = g_strdup(col_format_desc(cur_cb_fmt)); gtk_widget_set_sensitive(field_lb, FALSE); gtk_widget_set_sensitive(field_te, FALSE); gtk_widget_set_sensitive(occurrence_lb, FALSE); @@ -588,7 +588,7 @@ column_menu_changed_cb(GtkWidget *w, gpointer data) { } else { /* Changing from non-custom to non-custom */ - fmt = g_strdup_printf("%s", col_format_desc(cur_cb_fmt)); + fmt = g_strdup(col_format_desc(cur_cb_fmt)); } g_signal_handler_unblock(occurrence_te, column_occurrence_changed_handler_id); g_signal_handler_unblock(field_te, column_field_changed_handler_id); diff --git a/ui/gtk/proto_hier_stats_dlg.c b/ui/gtk/proto_hier_stats_dlg.c index 041e9aac25..6f271bc6f5 100644 --- a/ui/gtk/proto_hier_stats_dlg.c +++ b/ui/gtk/proto_hier_stats_dlg.c @@ -84,7 +84,7 @@ proto_hier_select_filter_cb(GtkWidget *widget _U_, gpointer callback_data _U_, g gtk_tree_model_get (model, &iter, FILTER_NAME, &filter, -1); if (filter && strlen(filter) > 0) { - str = g_strdup_printf("%s", filter); + str = g_strdup(filter); } else { simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Could not acquire information to build a filter!\nTry expanding or choosing another item."); return; @@ -92,7 +92,7 @@ proto_hier_select_filter_cb(GtkWidget *widget _U_, gpointer callback_data _U_, g while (gtk_tree_path_up(path) && gtk_tree_path_get_depth(path) > 0) { - strtmp = g_strdup_printf("%s", str); + strtmp = g_strdup(str); g_free(str); gtk_tree_model_get_iter(model, &iter, path); diff --git a/ui/gtk/sctp_assoc_analyse.c b/ui/gtk/sctp_assoc_analyse.c index 8900b34b36..23fb5159e1 100644 --- a/ui/gtk/sctp_assoc_analyse.c +++ b/ui/gtk/sctp_assoc_analyse.c @@ -548,7 +548,7 @@ sctp_set_filter(GtkButton *button _U_, struct sctp_analyse *u_data) dstlist = g_list_next(dstlist); wmem_free(NULL, addr_str); } - str = g_strdup_printf(")))"); + str = g_strdup(")))"); g_string_append(gstring, str); filter_string = g_string_free(gstring, FALSE); } diff --git a/ui/gtk/sctp_stat_dlg.c b/ui/gtk/sctp_stat_dlg.c index 59d57ae0ee..188437d6ec 100644 --- a/ui/gtk/sctp_stat_dlg.c +++ b/ui/gtk/sctp_stat_dlg.c @@ -536,7 +536,7 @@ sctp_stat_on_filter(GtkButton *button _U_, gpointer user_data _U_) wmem_free(NULL, addr_str); dstlist = g_list_next(dstlist); } - str = g_strdup_printf(")))"); + str = g_strdup(")))"); g_string_append(gstring, str); filter_string = g_string_free(gstring,FALSE); } diff --git a/ui/gtk/stats_tree_stat.c b/ui/gtk/stats_tree_stat.c index 1562c13e44..f421e1b693 100644 --- a/ui/gtk/stats_tree_stat.c +++ b/ui/gtk/stats_tree_stat.c @@ -456,7 +456,7 @@ init_gtk_tree(const char* opt_arg, void *userdata _U_) title=g_strdup_printf("%s with filter: %s",st->display_name,st->filter); } else { st->filter=NULL; - title=g_strdup_printf("%s", st->display_name); + title=g_strdup(st->display_name); } gtk_window_set_title(GTK_WINDOW(st->pr->win), title); @@ -585,7 +585,7 @@ void gtk_stats_tree_cb(GtkAction *action, gpointer user_data _U_) if(abbr){ abbr = abbr+1; }else{ - abbr = g_strdup_printf("%s",action_name); + abbr = g_strdup(action_name); } cfg = stats_tree_get_cfg_by_abbr(abbr); if(cfg){ |