diff options
author | Bill Meier <wmeier@newsguy.com> | 2013-07-01 14:32:08 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2013-07-01 14:32:08 +0000 |
commit | 43442af8e3d31ed5561e0d1120f6350bc6261c51 (patch) | |
tree | c9d2eb023accf7f26a46ed931124e2a1d21ae804 /ui/gtk | |
parent | ee52f06db9de9cc4533ca279caa2eb1f67fff93e (diff) | |
download | wireshark-43442af8e3d31ed5561e0d1120f6350bc6261c51.tar.gz |
Define certain 'const char *...' arrays as static.
(That is: Don't create the array on the stack each time
the function is called).
Reduces code memory usage and execution time.
(See SVN #50271)
svn path=/trunk/; revision=50295
Diffstat (limited to 'ui/gtk')
-rw-r--r-- | ui/gtk/about_dlg.c | 2 | ||||
-rw-r--r-- | ui/gtk/capture_if_details_dlg_win32.c | 4 | ||||
-rw-r--r-- | ui/gtk/color_dlg.c | 2 | ||||
-rw-r--r-- | ui/gtk/flow_graph.c | 2 | ||||
-rw-r--r-- | ui/gtk/plugins_dlg.c | 2 | ||||
-rw-r--r-- | ui/gtk/prefs_column.c | 32 | ||||
-rw-r--r-- | ui/gtk/prefs_filter_expressions.c | 22 | ||||
-rw-r--r-- | ui/gtk/prefs_font_color.c | 24 | ||||
-rw-r--r-- | ui/gtk/proto_dlg.c | 4 | ||||
-rw-r--r-- | ui/gtk/service_response_time_table.c | 2 |
10 files changed, 48 insertions, 48 deletions
diff --git a/ui/gtk/about_dlg.c b/ui/gtk/about_dlg.c index 3a0dbdfdc3..d22837946d 100644 --- a/ui/gtk/about_dlg.c +++ b/ui/gtk/about_dlg.c @@ -386,7 +386,7 @@ about_folders_page_new(void) GtkWidget *table; const char *constpath; char *path; - const gchar *titles[] = { "Name", "Folder", "Typical Files"}; + static const gchar *titles[] = { "Name", "Folder", "Typical Files"}; GtkWidget *scrolledwindow; #if defined (HAVE_LIBSMI) || defined (HAVE_GEOIP) gint i; diff --git a/ui/gtk/capture_if_details_dlg_win32.c b/ui/gtk/capture_if_details_dlg_win32.c index 50c1ce2b71..d36d36e621 100644 --- a/ui/gtk/capture_if_details_dlg_win32.c +++ b/ui/gtk/capture_if_details_dlg_win32.c @@ -1014,8 +1014,8 @@ capture_if_details_802_11_bssid_list(GtkWidget *main_vb, struct ndis_bssid_list if (bssid_list->num_items != 0) { - char *titles[] = { "SSID", "MAC", "Vendor", "Privacy", "RSSI" , "Network Type" , - "Infra. Mode" , "Ch." , "Rates", "Country" }; + static const char *titles[] = { "SSID", "MAC", "Vendor", "Privacy", "RSSI" , "Network Type" , + "Infra. Mode" , "Ch." , "Rates", "Country" }; GtkWidget *list; gboolean privacy_required; gboolean privacy_wpa; diff --git a/ui/gtk/color_dlg.c b/ui/gtk/color_dlg.c index b0920a1c7d..b222870cee 100644 --- a/ui/gtk/color_dlg.c +++ b/ui/gtk/color_dlg.c @@ -203,7 +203,7 @@ colorize_dialog_new (char *filter) GtkCellRenderer *renderer; GtkTreeViewColumn *column; GtkTreeSelection *selection; - const gchar *titles[] = { "Name", "String" }; + static const gchar *titles[] = { "Name", "String" }; diff --git a/ui/gtk/flow_graph.c b/ui/gtk/flow_graph.c index c5d33bc0ae..0c0337444f 100644 --- a/ui/gtk/flow_graph.c +++ b/ui/gtk/flow_graph.c @@ -313,7 +313,7 @@ flow_graph_tcp_add_to_graph(packet_info *pinfo, const struct tcpheader *tcph) { graph_analysis_item_t *gai; /* copied from packet-tcp */ - const gchar *fstr[] = {"FIN", "SYN", "RST", "PSH", "ACK", "URG", "ECN", "CWR" }; + static const gchar *fstr[] = {"FIN", "SYN", "RST", "PSH", "ACK", "URG", "ECN", "CWR" }; guint i, bpos; gboolean flags_found = FALSE; gchar flags[64]; diff --git a/ui/gtk/plugins_dlg.c b/ui/gtk/plugins_dlg.c index 19793a6f49..6051c0d275 100644 --- a/ui/gtk/plugins_dlg.c +++ b/ui/gtk/plugins_dlg.c @@ -102,7 +102,7 @@ about_plugins_page_new(void) { GtkWidget *scrolledwindow; GtkWidget *plugins_list; - const gchar *titles[] = {"Name", "Version", "Type", "Path"}; + static const gchar *titles[] = {"Name", "Version", "Type", "Path"}; scrolledwindow = scrolled_window_new(NULL, NULL); diff --git a/ui/gtk/prefs_column.c b/ui/gtk/prefs_column.c index 1f84167243..eb634ed781 100644 --- a/ui/gtk/prefs_column.c +++ b/ui/gtk/prefs_column.c @@ -101,22 +101,22 @@ visible_toggled(GtkCellRendererToggle *cell _U_, gchar *path_str, gpointer data) */ GtkWidget * column_prefs_show(GtkWidget *prefs_window) { - GtkWidget *main_vb, *bottom_hb, *column_l, *add_bt, *grid, *lb; - GtkWidget *list_vb, *list_lb, *list_sc; - GtkWidget *add_remove_vb; - GtkWidget *props_fr, *props_hb; - GList *clp; - fmt_data *cfmt; - gint i; - gchar *fmt; - const gchar *column_titles[] = {"Displayed", "Title", "Field type"}; - GtkListStore *store; - GtkCellRenderer *renderer; - GtkTreeViewColumn *column; - GtkTreeSelection *sel; - GtkTreeIter iter; - GtkTreeIter first_iter; - gint first_row = TRUE; + GtkWidget *main_vb, *bottom_hb, *column_l, *add_bt, *grid, *lb; + GtkWidget *list_vb, *list_lb, *list_sc; + GtkWidget *add_remove_vb; + GtkWidget *props_fr, *props_hb; + GList *clp; + fmt_data *cfmt; + gint i; + gchar *fmt; + static const gchar *column_titles[] = {"Displayed", "Title", "Field type"}; + GtkListStore *store; + GtkCellRenderer *renderer; + GtkTreeViewColumn *column; + GtkTreeSelection *sel; + GtkTreeIter iter; + GtkTreeIter first_iter; + gint first_row = TRUE; /* Container for each row of widgets */ main_vb = ws_gtk_box_new(GTK_ORIENTATION_VERTICAL, 5, FALSE); diff --git a/ui/gtk/prefs_filter_expressions.c b/ui/gtk/prefs_filter_expressions.c index cada917017..b0264de9fd 100644 --- a/ui/gtk/prefs_filter_expressions.c +++ b/ui/gtk/prefs_filter_expressions.c @@ -87,18 +87,18 @@ enable_toggled(GtkCellRendererToggle *cell _U_, gchar *path_str, gpointer data) */ GtkWidget * filter_expressions_prefs_show(void) { - GtkWidget *main_vb, *bottom_hb, *column_l, *add_bt, *remove_bt; - GtkWidget *list_vb, *list_lb, *list_sc; - GtkWidget *add_remove_hb; - GtkListStore *store; - GtkCellRenderer *renderer; - GtkTreeViewColumn *column; - GtkTreeSelection *sel; - GtkTreeIter iter; - GtkTreeIter first_iter; - gint first_row = TRUE; + GtkWidget *main_vb, *bottom_hb, *column_l, *add_bt, *remove_bt; + GtkWidget *list_vb, *list_lb, *list_sc; + GtkWidget *add_remove_hb; + GtkListStore *store; + GtkCellRenderer *renderer; + GtkTreeViewColumn *column; + GtkTreeSelection *sel; + GtkTreeIter iter; + GtkTreeIter first_iter; + gint first_row = TRUE; struct filter_expression *fe; - const gchar *column_titles[] = {"Enabled", "Label", "Filter Expression"}; + static const gchar *column_titles[] = {"Enabled", "Label", "Filter Expression"}; /* Container for each row of widgets */ main_vb = ws_gtk_box_new(GTK_ORIENTATION_VERTICAL, 5, FALSE); diff --git a/ui/gtk/prefs_font_color.c b/ui/gtk/prefs_font_color.c index ade3806aba..9cfbc80a62 100644 --- a/ui/gtk/prefs_font_color.c +++ b/ui/gtk/prefs_font_color.c @@ -132,18 +132,18 @@ font_color_prefs_show(void) { GtkWidget *main_vb, *main_grid, *label, *combo_box; GtkWidget *font_sample, *color_sample, *colorsel; - const gchar *mt[] = { - "Marked packet foreground", /* MFG_IDX 0*/ - "Marked packet background", /* MBG_IDX 1*/ - "Ignored packet foreground", /* IFG_IDX 2*/ - "Ignored packet background", /* IBG_IDX 3*/ - "'Follow Stream' client foreground", /* CFG_IDX 4*/ - "'Follow Stream' client background", /* CBG_IDX 5*/ - "'Follow Stream' server foreground", /* SFG_IDX 6*/ - "'Follow Stream' server background", /* SBG_IDX 7*/ - "Valid filter text entry", /* FTV_IDX 8*/ - "Invalid filter text entry", /* FTI_IDX 9*/ - "Deprecated filter text entry" /* FTD_IDX 10*/ + static const gchar *mt[] = { + "Marked packet foreground", /* MFG_IDX 0*/ + "Marked packet background", /* MBG_IDX 1*/ + "Ignored packet foreground", /* IFG_IDX 2*/ + "Ignored packet background", /* IBG_IDX 3*/ + "'Follow Stream' client foreground", /* CFG_IDX 4*/ + "'Follow Stream' client background", /* CBG_IDX 5*/ + "'Follow Stream' server foreground", /* SFG_IDX 6*/ + "'Follow Stream' server background", /* SBG_IDX 7*/ + "Valid filter text entry", /* FTV_IDX 8*/ + "Invalid filter text entry", /* FTI_IDX 9*/ + "Deprecated filter text entry" /* FTD_IDX 10*/ }; int mcount = sizeof(mt) / sizeof (gchar *); GtkTextBuffer *buf; diff --git a/ui/gtk/proto_dlg.c b/ui/gtk/proto_dlg.c index 8ff94896c0..f8db18a62f 100644 --- a/ui/gtk/proto_dlg.c +++ b/ui/gtk/proto_dlg.c @@ -100,7 +100,7 @@ build_heur_dissectors_treeview(void) GtkWidget *bbox, *proto_list, *label, *proto_sw, *proto_vb, *button, *ok_bt, *save_bt, *cancel_bt; - const gchar *titles[] = { "Status", "Heuristic Protocol", "Description" }; + static const gchar *titles[] = { "Status", "Heuristic Protocol", "Description" }; GtkListStore *proto_store; GtkCellRenderer *proto_rend; GtkTreeViewColumn *proto_col; @@ -232,7 +232,7 @@ build_protocols_treeview(void) GtkWidget *bbox, *proto_list, *label, *proto_sw, *proto_vb, *button, *ok_bt, *apply_bt, *save_bt, *cancel_bt, *help_bt; - const gchar *titles[] = { "Status", "Protocol", "Description" }; + static const gchar *titles[] = { "Status", "Protocol", "Description" }; GtkListStore *proto_store; GtkCellRenderer *proto_rend; GtkTreeViewColumn *proto_col; diff --git a/ui/gtk/service_response_time_table.c b/ui/gtk/service_response_time_table.c index fb91afdc10..570028f758 100644 --- a/ui/gtk/service_response_time_table.c +++ b/ui/gtk/service_response_time_table.c @@ -405,7 +405,7 @@ init_srt_table(srt_stat_table *rst, int num_procs, GtkWidget *vbox, const char * GtkTreeSortable *sortable; GtkTreeSelection *sel; - const char *default_titles[] = { "Index", "Procedure", "Calls", "Min SRT", "Max SRT", "Avg SRT" }; + static const char *default_titles[] = { "Index", "Procedure", "Calls", "Min SRT", "Max SRT", "Avg SRT" }; /* Create the store */ store = gtk_list_store_new (N_COLUMNS, /* Total number of columns */ |