aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2005-06-24 01:32:42 +0000
committerGuy Harris <guy@alum.mit.edu>2005-06-24 01:32:42 +0000
commit76258fe8e3484911401b2c70b48516b0eabfbbe0 (patch)
tree20224aded670da90d23f114f2289164b2314c07e
parent6f9d56ddd097bbae7fea6c1e242992aef88ab58b (diff)
Constify a bunch of structure members and function arguments, to squelch
compiler warnings. Clean up indentation. svn path=/trunk/; revision=14739
-rw-r--r--epan/prefs.c4
-rw-r--r--epan/prefs.h4
-rw-r--r--gtk/dfilter_expr_dlg.c4
-rw-r--r--gtk/http_stat.c2
-rw-r--r--gtk/service_response_time_table.c2
-rw-r--r--gtk/service_response_time_table.h3
-rw-r--r--gtk/sip_stat.c14
-rw-r--r--gtk/wsp_stat.c8
-rw-r--r--tap-httpstat.c2
-rw-r--r--tap-protohierstat.c2
-rw-r--r--tap-sipstat.c2
-rw-r--r--tap-wspstat.c2
12 files changed, 25 insertions, 24 deletions
diff --git a/epan/prefs.c b/epan/prefs.c
index 73465b8118..058a947178 100644
--- a/epan/prefs.c
+++ b/epan/prefs.c
@@ -487,7 +487,7 @@ find_preference(module_t *module, const char *name)
* Returns TRUE if the given protocol has registered preferences
*/
gboolean
-prefs_is_registered_protocol(char *name)
+prefs_is_registered_protocol(const char *name)
{
module_t *m = find_module(name);
@@ -498,7 +498,7 @@ prefs_is_registered_protocol(char *name)
* Returns the module title of a registered protocol
*/
const char *
-prefs_get_title_by_name(char *name)
+prefs_get_title_by_name(const char *name)
{
module_t *m = find_module(name);
diff --git a/epan/prefs.h b/epan/prefs.h
index 2145a8de9e..d66ec6c12a 100644
--- a/epan/prefs.h
+++ b/epan/prefs.h
@@ -239,12 +239,12 @@ typedef struct preference pref_t;
/*
* Returns TRUE if the given protocol has registered preferences.
*/
-extern gboolean prefs_is_registered_protocol(char *name);
+extern gboolean prefs_is_registered_protocol(const char *name);
/*
* Returns the module title of a registered protocol (or NULL if unknown).
*/
-extern const char *prefs_get_title_by_name(char *name);
+extern const char *prefs_get_title_by_name(const char *name);
/*
* Register a preference with an unsigned integral value.
diff --git a/gtk/dfilter_expr_dlg.c b/gtk/dfilter_expr_dlg.c
index 154bd8fe97..5cee70387b 100644
--- a/gtk/dfilter_expr_dlg.c
+++ b/gtk/dfilter_expr_dlg.c
@@ -84,7 +84,7 @@ static void build_boolean_values(GtkWidget *value_list_scrolled_win,
static void build_enum_values(GtkWidget *value_list_scrolled_win,
GtkWidget *value_list,
const value_string *values);
-static void add_value_list_item(GtkWidget *value_list, gchar *string,
+static void add_value_list_item(GtkWidget *value_list, const gchar *string,
gpointer data);
static void display_value_fields(header_field_info *hfinfo,
gboolean is_comparison, GtkWidget *value_label,
@@ -503,7 +503,7 @@ build_enum_values(GtkWidget *value_list_scrolled_win _U_, GtkWidget *value_list,
}
static void
-add_value_list_item(GtkWidget *value_list, gchar *string, gpointer data)
+add_value_list_item(GtkWidget *value_list, const gchar *string, gpointer data)
{
#if GTK_MAJOR_VERSION < 2
GtkWidget *label, *item;
diff --git a/gtk/http_stat.c b/gtk/http_stat.c
index 0defcfebe6..e7d7546c7d 100644
--- a/gtk/http_stat.c
+++ b/gtk/http_stat.c
@@ -70,7 +70,7 @@ typedef struct _http_stats_t {
typedef struct _http_response_code_t {
guint32 packets; /* 3 */
guint response_code; /* 404 */
- gchar *name; /* Not Found */
+ const gchar *name; /* Not Found */
GtkWidget *widget; /* Label where we display it */
GtkWidget *table; /* Table in which we put it, e.g. client_error_box */
httpstat_t *sp;
diff --git a/gtk/service_response_time_table.c b/gtk/service_response_time_table.c
index ec66036c25..862e258db7 100644
--- a/gtk/service_response_time_table.c
+++ b/gtk/service_response_time_table.c
@@ -328,7 +328,7 @@ srt_create_popup_menu(srt_stat_table *rst)
void
-init_srt_table(srt_stat_table *rst, int num_procs, GtkWidget *vbox, char *filter_string)
+init_srt_table(srt_stat_table *rst, int num_procs, GtkWidget *vbox, const char *filter_string)
{
int i, j;
column_arrows *col_arrows;
diff --git a/gtk/service_response_time_table.h b/gtk/service_response_time_table.h
index 108cd91a00..d2ac4c6426 100644
--- a/gtk/service_response_time_table.h
+++ b/gtk/service_response_time_table.h
@@ -58,7 +58,8 @@ typedef struct _srt_stat_table {
* @param vbox the corresponding GtkVBox to fill in
* @param filter_string filter string or NULL
*/
-void init_srt_table(srt_stat_table *rst, int num_procs, GtkWidget *vbox, char *filter_string);
+void init_srt_table(srt_stat_table *rst, int num_procs, GtkWidget *vbox,
+ const char *filter_string);
/** Init an srt table row data structure.
*
diff --git a/gtk/sip_stat.c b/gtk/sip_stat.c
index 1e1edffb6c..3f5dbc77d6 100644
--- a/gtk/sip_stat.c
+++ b/gtk/sip_stat.c
@@ -73,13 +73,13 @@ typedef struct _sip_stats_t {
* for example it can be { 3, 404, "Not Found" ,...}
* which means we captured 3 reply sip/1.1 404 Not Found */
typedef struct _sip_response_code_t {
- guint32 packets; /* 3 */
- guint response_code; /* 404 */
- gchar *name; /* "Not Found" */
- GtkWidget *widget; /* Label where we display it */
- GtkWidget *table; /* Table in which we put it,
- e.g. client_error_table */
- sipstat_t *sp; /* Pointer back to main struct */
+ guint32 packets; /* 3 */
+ guint response_code; /* 404 */
+ const gchar *name; /* "Not Found" */
+ GtkWidget *widget; /* Label where we display it */
+ GtkWidget *table; /* Table in which we put it,
+ e.g. client_error_table */
+ sipstat_t *sp; /* Pointer back to main struct */
} sip_response_code_t;
/* Used to keep track of the stats for a specific request string */
diff --git a/gtk/wsp_stat.c b/gtk/wsp_stat.c
index 755a17ec8c..e96056e5c1 100644
--- a/gtk/wsp_stat.c
+++ b/gtk/wsp_stat.c
@@ -65,7 +65,7 @@ typedef struct _wsp_stats_t {
} wspstat_t;
/* used to keep track of a single type of status code */
typedef struct _wsp_status_code_t {
- gchar *name;
+ const gchar *name;
guint32 packets;
GtkWidget *widget;/* label in which we print the number of packets */
wspstat_t *sp; /* entire program interface */
@@ -311,8 +311,8 @@ gtk_wspstat_init(char *optarg)
char *title=NULL;
GString *error_string;
GtkWidget *main_vb, *pdutypes_fr, *statuscode_fr ;
- GtkWidget *bt_close;
- GtkWidget *bbox;
+ GtkWidget *bt_close;
+ GtkWidget *bbox;
guint32 i;
wsp_status_code_t *sc;
@@ -355,7 +355,7 @@ gtk_wspstat_init(char *optarg)
sp->pdu_stats[i].packets=0;
}
- gtk_window_set_title(GTK_WINDOW(sp->win), title);
+ gtk_window_set_title(GTK_WINDOW(sp->win), title);
g_free(title);
/* container for the two frames */
diff --git a/tap-httpstat.c b/tap-httpstat.c
index a61ad8646a..df36c6930b 100644
--- a/tap-httpstat.c
+++ b/tap-httpstat.c
@@ -49,7 +49,7 @@ typedef struct _http_stats_t {
typedef struct _http_response_code_t {
guint32 packets; /* 3 */
guint response_code; /* 404 */
- gchar *name; /* Not Found */
+ const gchar *name; /* Not Found */
httpstat_t *sp;
} http_response_code_t;
diff --git a/tap-protohierstat.c b/tap-protohierstat.c
index 8a26136d1c..f52dfca00e 100644
--- a/tap-protohierstat.c
+++ b/tap-protohierstat.c
@@ -47,7 +47,7 @@ typedef struct _phs_t {
struct _phs_t *parent;
char *filter;
int protocol;
- char *proto_name;
+ const char *proto_name;
guint32 frames;
guint32 bytes;
} phs_t;
diff --git a/tap-sipstat.c b/tap-sipstat.c
index 423df3ef59..2aa6bdf8ae 100644
--- a/tap-sipstat.c
+++ b/tap-sipstat.c
@@ -55,7 +55,7 @@ typedef struct _sip_stats_t {
typedef struct _sip_response_code_t {
guint32 packets; /* 3 */
guint response_code; /* 404 */
- gchar *name; /* Not Found */
+ const gchar *name; /* Not Found */
sipstat_t *sp;
} sip_response_code_t;
diff --git a/tap-wspstat.c b/tap-wspstat.c
index 3582179f89..67805f62fb 100644
--- a/tap-wspstat.c
+++ b/tap-wspstat.c
@@ -51,7 +51,7 @@ typedef struct _wsp_pdu_t {
} wsp_pdu_t;
/* used to keep track of RTT statistics */
typedef struct _wsp_status_code_t {
- gchar *name;
+ const gchar *name;
guint32 packets;
} wsp_status_code_t;
/* used to keep track of the statictics for an entire program interface */