forked from osmocom/wireshark
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
This commit is contained in:
parent
ee52f06db9
commit
43442af8e3
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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" };
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue