From 5fb6e97fb43b2b7929a7bb20b1d408b798d95551 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sat, 6 Aug 2005 03:44:55 +0000 Subject: [PATCH] Squelch more const warnings (and fix some memory leaks that found). _U_-ify some unused arguments, rather than assigning them to themselves. Un-constify one variable that gets assigned a mallocated pointer. Clean up indentation. svn path=/trunk/; revision=15236 --- epan/tap.c | 4 ++-- epan/tap.h | 3 ++- gtk/ansi_a_stat.c | 4 +--- gtk/ansi_map_stat.c | 4 +--- gtk/bootp_stat.c | 32 ++++++++++++++++---------------- gtk/dcerpc_stat.c | 14 +++++++------- gtk/fc_stat.c | 18 +++++++++--------- gtk/gsm_a_stat.c | 4 +--- gtk/gsm_map_stat.c | 4 +--- gtk/h225_counter.c | 24 ++++++++++++------------ gtk/h225_ras_srt.c | 26 +++++++++++++------------- gtk/hostlist_eth.c | 2 +- gtk/hostlist_fc.c | 4 ++-- gtk/hostlist_fddi.c | 4 ++-- gtk/hostlist_ip.c | 4 ++-- gtk/hostlist_ipx.c | 4 ++-- gtk/hostlist_jxta.c | 4 ++-- gtk/hostlist_table.h | 2 +- gtk/hostlist_tcpip.c | 4 ++-- gtk/hostlist_tr.c | 6 +++--- gtk/hostlist_udpip.c | 4 ++-- gtk/hostlist_wlan.c | 4 ++-- gtk/io_stat.c | 4 ++-- gtk/ldap_stat.c | 18 +++++++++--------- gtk/menu.c | 2 +- gtk/mgcp_stat.c | 30 +++++++++++++++--------------- gtk/mtp3_stat.c | 4 +--- gtk/rpc_progs.c | 2 +- gtk/rpc_stat.c | 4 ++-- gtk/rtp_analysis.c | 2 +- gtk/rtp_stream.c | 2 +- gtk/sctp_chunk_stat.c | 14 +++++++------- gtk/sctp_stat.c | 2 +- gtk/sip_stat.c | 4 ++-- gtk/smb_stat.c | 18 +++++++++--------- gtk/stats_tree_stat.c | 2 +- gtk/summary_dlg.c | 2 +- gtk/toolbar.c | 2 +- gtk/voip_calls_dlg.c | 2 +- gtk/wsp_stat.c | 4 ++-- tap-ansi_astat.c | 5 +---- tap-bootpstat.c | 4 ++-- tap-dcerpcstat.c | 4 ++-- tap-gsm_astat.c | 5 +---- tap-h225counter.c | 7 +++---- tap-h225rassrt.c | 7 +++---- tap-httpstat.c | 4 ++-- tap-iostat.c | 7 ++++--- tap-iousers.c | 4 ++-- tap-mgcpstat.c | 7 +++---- tap-protocolinfo.c | 6 +++--- tap-protohierstat.c | 4 ++-- tap-rpcprogs.c | 2 +- tap-rpcstat.c | 4 ++-- tap-sctpchunkstat.c | 9 ++++----- tap-sipstat.c | 4 ++-- tap-smbsids.c | 2 +- tap-smbstat.c | 4 ++-- tap-stats_tree.c | 2 +- tap-wspstat.c | 4 ++-- tap_dfilter_dlg.h | 2 +- 61 files changed, 188 insertions(+), 206 deletions(-) diff --git a/epan/tap.c b/epan/tap.c index 9f559f6040..14f100c195 100644 --- a/epan/tap.c +++ b/epan/tap.c @@ -85,7 +85,7 @@ static volatile tap_listener_t *tap_listener_queue=NULL; typedef struct _tap_cmd_arg { struct _tap_cmd_arg *next; const char *cmd; - void (*func)(char *arg); + void (*func)(const char *arg); } tap_cmd_arg; static tap_cmd_arg *tap_cmd_arg_list=NULL; @@ -117,7 +117,7 @@ tap_init(void) * and initialization routine * ********************************************************************** */ void -register_tap_listener_cmd_arg(const char *cmd, void (*func)(char *arg)) +register_tap_listener_cmd_arg(const char *cmd, void (*func)(const char *arg)) { tap_cmd_arg *newtca; diff --git a/epan/tap.h b/epan/tap.h index 5d5d922cf7..c37dd450db 100644 --- a/epan/tap.h +++ b/epan/tap.h @@ -38,7 +38,8 @@ typedef void (*tap_draw_cb)(void *tapdata); extern void tap_init(void); -extern void register_tap_listener_cmd_arg(const char *cmd, void (*func)(char *arg)); +extern void register_tap_listener_cmd_arg(const char *cmd, + void (*func)(const char *arg)); extern gboolean process_tap_cmd_arg(char *optarg); extern void list_tap_cmd_args(void); extern void start_requested_taps(void); diff --git a/gtk/ansi_a_stat.c b/gtk/ansi_a_stat.c index e1165c0206..df57744b46 100644 --- a/gtk/ansi_a_stat.c +++ b/gtk/ansi_a_stat.c @@ -366,11 +366,9 @@ ansi_a_stat_gtk_win_create( */ static void ansi_a_stat_gtk_init( - char *optarg) + const char *optarg _U_) { /* does not appear to be called */ - - optarg = optarg; } diff --git a/gtk/ansi_map_stat.c b/gtk/ansi_map_stat.c index 5a71cb6cef..03270be211 100644 --- a/gtk/ansi_map_stat.c +++ b/gtk/ansi_map_stat.c @@ -366,11 +366,9 @@ ansi_map_stat_gtk_win_create( */ static void ansi_map_stat_gtk_init( - char *optarg) + const char *optarg _U_) { /* does not appear to be called */ - - optarg = optarg; } diff --git a/gtk/bootp_stat.c b/gtk/bootp_stat.c index 261cd851cc..54df43e2cb 100644 --- a/gtk/bootp_stat.c +++ b/gtk/bootp_stat.c @@ -191,16 +191,16 @@ win_destroy_cb(GtkWindow *win _U_, gpointer data) /* When called, this function will create a new instance of gtk2-dhcpstat. */ static void -dhcpstat_init(char *optarg) +dhcpstat_init(const char *optarg) { dhcpstat_t *sp; - char *filter=NULL; + const char *filter=NULL; char *title=NULL; GString *error_string; GtkWidget *message_type_fr; - GtkWidget *vbox; - GtkWidget *bt_close; - GtkWidget *bbox; + GtkWidget *vbox; + GtkWidget *bt_close; + GtkWidget *bbox; if (strncmp (optarg, "bootp,stat,", 11) == 0){ filter=optarg+11; @@ -222,9 +222,9 @@ dhcpstat_init(char *optarg) sp->win = window_new(GTK_WINDOW_TOPLEVEL, title); g_free(title); - vbox = gtk_vbox_new(FALSE, 3); + vbox = gtk_vbox_new(FALSE, 3); gtk_container_add(GTK_CONTAINER(sp->win), vbox); - gtk_container_set_border_width(GTK_CONTAINER(vbox), 12); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 12); /* Status Codes frame */ message_type_fr = gtk_frame_new("DHCP Message Type"); @@ -255,20 +255,20 @@ dhcpstat_init(char *optarg) } /* Button row. */ - bbox = dlg_button_row_new(GTK_STOCK_CLOSE, NULL); - gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0); + bbox = dlg_button_row_new(GTK_STOCK_CLOSE, NULL); + gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0); - bt_close = OBJECT_GET_DATA(bbox, GTK_STOCK_CLOSE); - window_set_cancel_button(sp->win, bt_close, window_cancel_button_cb); + bt_close = OBJECT_GET_DATA(bbox, GTK_STOCK_CLOSE); + window_set_cancel_button(sp->win, bt_close, window_cancel_button_cb); - SIGNAL_CONNECT(sp->win, "delete_event", window_delete_event_cb, NULL); - SIGNAL_CONNECT(sp->win, "destroy", win_destroy_cb, sp); + SIGNAL_CONNECT(sp->win, "delete_event", window_delete_event_cb, NULL); + SIGNAL_CONNECT(sp->win, "destroy", win_destroy_cb, sp); - gtk_widget_show_all(sp->win); + gtk_widget_show_all(sp->win); - window_present(sp->win); + window_present(sp->win); - cf_retap_packets(&cfile); + cf_retap_packets(&cfile); } static tap_dfilter_dlg dhcp_stat_dlg = { diff --git a/gtk/dcerpc_stat.c b/gtk/dcerpc_stat.c index fa04c4a8ba..9892f090e9 100644 --- a/gtk/dcerpc_stat.c +++ b/gtk/dcerpc_stat.c @@ -184,7 +184,7 @@ win_destroy_cb(GtkWindow *win _U_, gpointer data) /* When called, this function will create a new instance of gtk-dcerpcstat. */ static void -gtk_dcerpcstat_init(char *optarg) +gtk_dcerpcstat_init(const char *optarg) { rpcstat_t *rs; guint32 i, max_procs; @@ -201,7 +201,7 @@ gtk_dcerpcstat_init(char *optarg) int major, minor; guint16 ver; int pos=0; - char *filter=NULL; + const char *filter=NULL; GString *error_string; int hf_opnum; @@ -323,15 +323,15 @@ gtk_dcerpcstat_init(char *optarg) gtk_box_pack_end(GTK_BOX(vbox), bbox, FALSE, FALSE, 0); close_bt = OBJECT_GET_DATA(bbox, GTK_STOCK_CLOSE); - window_set_cancel_button(rs->win, close_bt, window_cancel_button_cb); + window_set_cancel_button(rs->win, close_bt, window_cancel_button_cb); - SIGNAL_CONNECT(rs->win, "delete_event", window_delete_event_cb, NULL); + SIGNAL_CONNECT(rs->win, "delete_event", window_delete_event_cb, NULL); SIGNAL_CONNECT(rs->win, "destroy", win_destroy_cb, rs); - gtk_widget_show_all(rs->win); - window_present(rs->win); + gtk_widget_show_all(rs->win); + window_present(rs->win); - cf_retap_packets(&cfile); + cf_retap_packets(&cfile); } diff --git a/gtk/fc_stat.c b/gtk/fc_stat.c index 99378e72bd..04650a960e 100644 --- a/gtk/fc_stat.c +++ b/gtk/fc_stat.c @@ -128,17 +128,17 @@ win_destroy_cb(GtkWindow *win _U_, gpointer data) static void -gtk_fcstat_init(char *optarg) +gtk_fcstat_init(const char *optarg) { fcstat_t *fc; - char *filter=NULL; + const char *filter=NULL; GtkWidget *label; char filter_string[256]; GString *error_string; int i; GtkWidget *vbox; - GtkWidget *bbox; - GtkWidget *close_bt; + GtkWidget *bbox; + GtkWidget *close_bt; if(!strncmp(optarg,"fc,srt,",7)){ filter=optarg+7; @@ -188,15 +188,15 @@ gtk_fcstat_init(char *optarg) gtk_box_pack_end(GTK_BOX(vbox), bbox, FALSE, FALSE, 0); close_bt = OBJECT_GET_DATA(bbox, GTK_STOCK_CLOSE); - window_set_cancel_button(fc->win, close_bt, window_cancel_button_cb); + window_set_cancel_button(fc->win, close_bt, window_cancel_button_cb); - SIGNAL_CONNECT(fc->win, "delete_event", window_delete_event_cb, NULL); - SIGNAL_CONNECT(fc->win, "destroy", win_destroy_cb, fc); + SIGNAL_CONNECT(fc->win, "delete_event", window_delete_event_cb, NULL); + SIGNAL_CONNECT(fc->win, "destroy", win_destroy_cb, fc); gtk_widget_show_all(fc->win); - window_present(fc->win); + window_present(fc->win); - cf_retap_packets(&cfile); + cf_retap_packets(&cfile); } diff --git a/gtk/gsm_a_stat.c b/gtk/gsm_a_stat.c index e34b4347a2..9a13081092 100644 --- a/gtk/gsm_a_stat.c +++ b/gtk/gsm_a_stat.c @@ -453,11 +453,9 @@ gsm_a_stat_gtk_win_create( */ static void gsm_a_stat_gtk_init( - char *optarg) + const char *optarg _U_) { /* does not appear to be called */ - - optarg = optarg; } diff --git a/gtk/gsm_map_stat.c b/gtk/gsm_map_stat.c index 2f8221126e..b7ef591b3d 100644 --- a/gtk/gsm_map_stat.c +++ b/gtk/gsm_map_stat.c @@ -396,11 +396,9 @@ gsm_map_stat_gtk_win_create( */ static void gsm_map_stat_gtk_init( - char *optarg) + const char *optarg _U_) { /* does not appear to be called */ - - optarg = optarg; } diff --git a/gtk/h225_counter.c b/gtk/h225_counter.c index e6d1c6095d..c7cb4858f5 100644 --- a/gtk/h225_counter.c +++ b/gtk/h225_counter.c @@ -54,7 +54,7 @@ #include "ui_util.h" -static void gtk_h225counter_init(char *optarg); +static void gtk_h225counter_init(const char *optarg); static tap_dfilter_dlg h225_counter_dlg = { "H.225 Messages and Message Reasons", @@ -497,23 +497,23 @@ win_destroy_cb(GtkWindow *win _U_, gpointer data) } -static const gchar *titles[]={"Message Type or Reason", +static const gchar *titles[]={ + "Message Type or Reason", "Count" }; static void -gtk_h225counter_init(char *optarg) +gtk_h225counter_init(const char *optarg) { h225counter_t *hs; - char *filter=NULL; + const char *filter=NULL; GString *error_string; - GtkWidget *bbox; - GtkWidget *close_bt; + GtkWidget *bbox; + GtkWidget *close_bt; if(strncmp(optarg,"h225,counter,",13) == 0){ filter=optarg+13; } else { - filter=g_malloc(1); - *filter='\0'; + filter=""; } hs=g_malloc(sizeof(h225counter_t)); @@ -548,13 +548,13 @@ gtk_h225counter_init(char *optarg) gtk_box_pack_end(GTK_BOX(hs->vbox), bbox, FALSE, FALSE, 0); close_bt = OBJECT_GET_DATA(bbox, GTK_STOCK_CLOSE); - window_set_cancel_button(hs->win, close_bt, window_cancel_button_cb); + window_set_cancel_button(hs->win, close_bt, window_cancel_button_cb); - SIGNAL_CONNECT(hs->win, "delete_event", window_delete_event_cb, NULL); - SIGNAL_CONNECT(hs->win, "destroy", win_destroy_cb, hs); + SIGNAL_CONNECT(hs->win, "delete_event", window_delete_event_cb, NULL); + SIGNAL_CONNECT(hs->win, "destroy", win_destroy_cb, hs); gtk_widget_show_all(hs->win); - window_present(hs->win); + window_present(hs->win); cf_retap_packets(&cfile); } diff --git a/gtk/h225_ras_srt.c b/gtk/h225_ras_srt.c index 57b9399352..92a6da1c3e 100644 --- a/gtk/h225_ras_srt.c +++ b/gtk/h225_ras_srt.c @@ -55,7 +55,7 @@ #include "ui_util.h" -static void gtk_h225rassrt_init(char *optarg); +static void gtk_h225rassrt_init(const char *optarg); static tap_dfilter_dlg h225_rassrt_dlg = { "H.225 RAS Service Response Time", @@ -268,7 +268,8 @@ win_destroy_cb(GtkWindow *win _U_, gpointer data) } -static const gchar *titles[]={"RAS-Type", +static const gchar *titles[]={ + "RAS-Type", "Measurements", "Min RTT", "Max RTT", @@ -281,19 +282,18 @@ static const gchar *titles[]={"RAS-Type", "Repeated Responses" }; static void -gtk_h225rassrt_init(char *optarg) +gtk_h225rassrt_init(const char *optarg) { h225rassrt_t *hs; - char *filter=NULL; + const char *filter=NULL; GString *error_string; - GtkWidget *bbox; - GtkWidget *close_bt; + GtkWidget *bbox; + GtkWidget *close_bt; if(strncmp(optarg,"h225,srt,",9) == 0){ filter=optarg+9; } else { - filter=g_malloc(1); - *filter='\0'; + filter=""; } hs=g_malloc(sizeof(h225rassrt_t)); @@ -328,15 +328,15 @@ gtk_h225rassrt_init(char *optarg) gtk_box_pack_end(GTK_BOX(hs->vbox), bbox, FALSE, FALSE, 0); close_bt = OBJECT_GET_DATA(bbox, GTK_STOCK_CLOSE); - window_set_cancel_button(hs->win, close_bt, window_cancel_button_cb); + window_set_cancel_button(hs->win, close_bt, window_cancel_button_cb); - SIGNAL_CONNECT(hs->win, "delete_event", window_delete_event_cb, NULL); - SIGNAL_CONNECT(hs->win, "destroy", win_destroy_cb, hs); + SIGNAL_CONNECT(hs->win, "delete_event", window_delete_event_cb, NULL); + SIGNAL_CONNECT(hs->win, "destroy", win_destroy_cb, hs); gtk_widget_show_all(hs->win); - window_present(hs->win); + window_present(hs->win); - cf_retap_packets(&cfile); + cf_retap_packets(&cfile); } void diff --git a/gtk/hostlist_eth.c b/gtk/hostlist_eth.c index 8a97687401..7e61370a42 100644 --- a/gtk/hostlist_eth.c +++ b/gtk/hostlist_eth.c @@ -60,7 +60,7 @@ eth_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, cons static void gtk_eth_hostlist_init(const char *optarg) { - char *filter=NULL; + const char *filter=NULL; if(!strncmp(optarg,"hosts,eth,",10)){ filter=optarg+10; diff --git a/gtk/hostlist_fc.c b/gtk/hostlist_fc.c index 886e58a7b3..8aab16a808 100644 --- a/gtk/hostlist_fc.c +++ b/gtk/hostlist_fc.c @@ -58,9 +58,9 @@ fc_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const static void -gtk_fc_hostlist_init(char *optarg) +gtk_fc_hostlist_init(const char *optarg) { - char *filter=NULL; + const char *filter=NULL; if(!strncmp(optarg,"hosts,fc,",9)){ filter=optarg+9; diff --git a/gtk/hostlist_fddi.c b/gtk/hostlist_fddi.c index 81198fde01..6df39c6048 100644 --- a/gtk/hostlist_fddi.c +++ b/gtk/hostlist_fddi.c @@ -58,9 +58,9 @@ fddi_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, con static void -gtk_fddi_hostlist_init(char *optarg) +gtk_fddi_hostlist_init(const char *optarg) { - char *filter=NULL; + const char *filter=NULL; if(!strncmp(optarg,"hosts,fddi,",11)){ filter=optarg+11; diff --git a/gtk/hostlist_ip.c b/gtk/hostlist_ip.c index 57f456cd6c..9ed2cf7190 100644 --- a/gtk/hostlist_ip.c +++ b/gtk/hostlist_ip.c @@ -57,9 +57,9 @@ ip_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const } static void -gtk_ip_hostlist_init(char *optarg) +gtk_ip_hostlist_init(const char *optarg) { - char *filter=NULL; + const char *filter=NULL; if(!strncmp(optarg,"hosts,ip,",9)){ filter=optarg+9; diff --git a/gtk/hostlist_ipx.c b/gtk/hostlist_ipx.c index b48930af21..04a54f1cfc 100644 --- a/gtk/hostlist_ipx.c +++ b/gtk/hostlist_ipx.c @@ -58,9 +58,9 @@ ipx_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, cons static void -gtk_ipx_hostlist_init(char *optarg) +gtk_ipx_hostlist_init(const char *optarg) { - char *filter=NULL; + const char *filter=NULL; if(!strncmp(optarg,"hosts,ipx,",10)){ filter=optarg+10; diff --git a/gtk/hostlist_jxta.c b/gtk/hostlist_jxta.c index 10017a36a4..a31699cc29 100644 --- a/gtk/hostlist_jxta.c +++ b/gtk/hostlist_jxta.c @@ -55,9 +55,9 @@ jxta_hostlist_packet(void *pit, packet_info *pinfo _U_, epan_dissect_t *edt _U_, } static void -gtk_jxta_hostlist_init(char *optarg) +gtk_jxta_hostlist_init(const char *optarg) { - char *filter=NULL; + const char *filter=NULL; if(!strncmp(optarg,"hosts,jxta,",11)){ filter=optarg+11; diff --git a/gtk/hostlist_table.h b/gtk/hostlist_table.h index 17f78e7285..99577ef080 100644 --- a/gtk/hostlist_table.h +++ b/gtk/hostlist_table.h @@ -44,7 +44,7 @@ typedef struct _hostlist_talker_t { /** Hostlist widget */ typedef struct _hostlist_table { - char *name; /**< the name of the table */ + const char *name; /**< the name of the table */ GtkWidget *win; /**< GTK window */ GtkWidget *page_lb; /**< label */ GtkWidget *scrolled_window; /**< the scrolled window */ diff --git a/gtk/hostlist_tcpip.c b/gtk/hostlist_tcpip.c index 72f28fc9ca..f84958db3f 100644 --- a/gtk/hostlist_tcpip.c +++ b/gtk/hostlist_tcpip.c @@ -58,9 +58,9 @@ tcpip_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, co static void -gtk_tcpip_hostlist_init(char *optarg) +gtk_tcpip_hostlist_init(const char *optarg) { - char *filter=NULL; + const char *filter=NULL; if(!strncmp(optarg,"endpoints,tcp,",14)){ filter=optarg+14; diff --git a/gtk/hostlist_tr.c b/gtk/hostlist_tr.c index af21ca6ca3..cb2021ef9d 100644 --- a/gtk/hostlist_tr.c +++ b/gtk/hostlist_tr.c @@ -58,9 +58,9 @@ tr_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const static void -gtk_tr_hostlist_init(char *optarg) +gtk_tr_hostlist_init(const char *optarg) { - char *filter=NULL; + const char *filter=NULL; if(!strncmp(optarg,"hosts,tr,",9)){ filter=optarg+9; @@ -88,5 +88,5 @@ register_tap_listener_tr_hostlist(void) register_tap_menu_item("Token Ring", REGISTER_TAP_GROUP_ENDPOINT_LIST, gtk_tr_hostlist_cb, NULL, NULL, NULL); - register_hostlist_table(TRUE, "Token Ring", "tr", NULL /*filter*/, tr_hostlist_packet); + register_hostlist_table(TRUE, "Token Ring", "tr", NULL /*filter*/, tr_hostlist_packet); } diff --git a/gtk/hostlist_udpip.c b/gtk/hostlist_udpip.c index 6d86a16ba7..7565cf0cbc 100644 --- a/gtk/hostlist_udpip.c +++ b/gtk/hostlist_udpip.c @@ -58,9 +58,9 @@ udpip_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, co static void -gtk_udpip_hostlist_init(char *optarg) +gtk_udpip_hostlist_init(const char *optarg) { - char *filter=NULL; + const char *filter=NULL; if(!strncmp(optarg,"endpoints,udp,",14)){ filter=optarg+14; diff --git a/gtk/hostlist_wlan.c b/gtk/hostlist_wlan.c index 07de604544..65e0fe338b 100644 --- a/gtk/hostlist_wlan.c +++ b/gtk/hostlist_wlan.c @@ -56,9 +56,9 @@ wlan_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, con } static void -gtk_wlan_hostlist_init(char *optarg) +gtk_wlan_hostlist_init(const char *optarg) { - char *filter=NULL; + const char *filter=NULL; if(!strncmp(optarg,"hosts,wlan,",11)){ filter=optarg+11; diff --git a/gtk/io_stat.c b/gtk/io_stat.c index 1f24be9512..d1f5d6fc0d 100644 --- a/gtk/io_stat.c +++ b/gtk/io_stat.c @@ -1048,7 +1048,7 @@ disable_graph(io_stat_graph_t *gio) } static void -gtk_iostat_init(char *optarg _U_) +gtk_iostat_init(const char *optarg _U_) { io_stat_t *io; int i=0; @@ -1071,7 +1071,7 @@ gtk_iostat_init(char *optarg _U_) io->scrollbar_adjustment=NULL; io->pixmap_width=500; io->pixmap_height=200; - io->pixels_per_tick=pixels_per_tick[DEFAULT_PIXELS_PER_TICK]; + io->pixels_per_tick=pixels_per_tick[DEFAULT_PIXELS_PER_TICK]; io->max_y_units=AUTO_MAX_YSCALE; io->count_type=0; io->last_interval=0xffffffff; diff --git a/gtk/ldap_stat.c b/gtk/ldap_stat.c index da6149ef4b..6f49002d1f 100644 --- a/gtk/ldap_stat.c +++ b/gtk/ldap_stat.c @@ -143,16 +143,16 @@ win_destroy_cb(GtkWindow *win _U_, gpointer data) static void -gtk_ldapstat_init(char *optarg) +gtk_ldapstat_init(const char *optarg) { ldapstat_t *ldap; - char *filter=NULL; + const char *filter=NULL; GtkWidget *label; char filter_string[256]; GString *error_string; GtkWidget *vbox; - GtkWidget *bbox; - GtkWidget *close_bt; + GtkWidget *bbox; + GtkWidget *close_bt; if(!strncmp(optarg,"ldap,srt,",9)){ filter=optarg+9; @@ -223,15 +223,15 @@ gtk_ldapstat_init(char *optarg) gtk_box_pack_end(GTK_BOX(vbox), bbox, FALSE, FALSE, 0); close_bt = OBJECT_GET_DATA(bbox, GTK_STOCK_CLOSE); - window_set_cancel_button(ldap->win, close_bt, window_cancel_button_cb); + window_set_cancel_button(ldap->win, close_bt, window_cancel_button_cb); - SIGNAL_CONNECT(ldap->win, "delete_event", window_delete_event_cb, NULL); + SIGNAL_CONNECT(ldap->win, "delete_event", window_delete_event_cb, NULL); SIGNAL_CONNECT(ldap->win, "destroy", win_destroy_cb, ldap); - gtk_widget_show_all(ldap->win); - window_present(ldap->win); + gtk_widget_show_all(ldap->win); + window_present(ldap->win); - cf_retap_packets(&cfile); + cf_retap_packets(&cfile); } diff --git a/gtk/menu.c b/gtk/menu.c index d722b28a31..8920d0c3f5 100644 --- a/gtk/menu.c +++ b/gtk/menu.c @@ -658,7 +658,7 @@ register_tap_menu_item( { /*static const char toolspath[] = "/Statistics/";*/ const char *toolspath; - char *p; + const char *p; char *menupath; size_t menupathlen; menu_item_t *child; diff --git a/gtk/mgcp_stat.c b/gtk/mgcp_stat.c index 9775071601..6ce3a3cbcd 100644 --- a/gtk/mgcp_stat.c +++ b/gtk/mgcp_stat.c @@ -247,7 +247,8 @@ win_destroy_cb(GtkWindow *win _U_, gpointer data) g_free(ms); } -static gchar *titles[]={"Type", +static const gchar *titles[]={ + "Type", "Messages", "Min SRT", "Max SRT", @@ -256,19 +257,18 @@ static gchar *titles[]={"Type", "Max in Frame" }; void -gtk_mgcpstat_init(char *optarg) +gtk_mgcpstat_init(const char *optarg) { mgcpstat_t *ms; - char *filter=NULL; + const char *filter=NULL; GString *error_string; - GtkWidget *bt_close; - GtkWidget *bbox; + GtkWidget *bt_close; + GtkWidget *bbox; if(strncmp(optarg,"mgcp,srt,",9) == 0){ filter=optarg+9; } else { - filter=g_malloc(1); - *filter='\0'; + filter=""; } ms=g_malloc(sizeof(mgcpstat_t)); @@ -299,19 +299,19 @@ gtk_mgcpstat_init(char *optarg) } /* Button row. */ - bbox = dlg_button_row_new(GTK_STOCK_CLOSE, NULL); - gtk_box_pack_start(GTK_BOX(ms->vbox), bbox, FALSE, FALSE, 0); + bbox = dlg_button_row_new(GTK_STOCK_CLOSE, NULL); + gtk_box_pack_start(GTK_BOX(ms->vbox), bbox, FALSE, FALSE, 0); - bt_close = OBJECT_GET_DATA(bbox, GTK_STOCK_CLOSE); - window_set_cancel_button(ms->win, bt_close, window_cancel_button_cb); + bt_close = OBJECT_GET_DATA(bbox, GTK_STOCK_CLOSE); + window_set_cancel_button(ms->win, bt_close, window_cancel_button_cb); - SIGNAL_CONNECT(ms->win, "delete_event", window_delete_event_cb, NULL); + SIGNAL_CONNECT(ms->win, "delete_event", window_delete_event_cb, NULL); SIGNAL_CONNECT(ms->win, "destroy", win_destroy_cb, ms); - gtk_widget_show_all(ms->win); - window_present(ms->win); + gtk_widget_show_all(ms->win); + window_present(ms->win); - cf_retap_packets(&cfile); + cf_retap_packets(&cfile); } static tap_dfilter_dlg mgcp_srt_dlg = { diff --git a/gtk/mtp3_stat.c b/gtk/mtp3_stat.c index ce6e96b1b4..68c768ba65 100644 --- a/gtk/mtp3_stat.c +++ b/gtk/mtp3_stat.c @@ -412,11 +412,9 @@ mtp3_stat_gtk_win_create( */ static void mtp3_stat_gtk_init( - char *optarg) + const char *optarg _U_) { /* does not appear to be called */ - - optarg = optarg; } diff --git a/gtk/rpc_progs.c b/gtk/rpc_progs.c index 9d674deb18..d335496b7c 100644 --- a/gtk/rpc_progs.c +++ b/gtk/rpc_progs.c @@ -331,7 +331,7 @@ win_destroy_cb(void *dummy _U_, gpointer data _U_) /* When called, this function will start rpcprogs */ void -gtk_rpcprogs_init(char *optarg _U_) +gtk_rpcprogs_init(const char *optarg _U_) { char *title_string; GtkWidget *vbox; diff --git a/gtk/rpc_stat.c b/gtk/rpc_stat.c index 28ecd7ab0a..88d26caac1 100644 --- a/gtk/rpc_stat.c +++ b/gtk/rpc_stat.c @@ -215,7 +215,7 @@ win_destroy_cb(GtkWindow *win _U_, gpointer data) /* When called, this function will create a new instance of gtk2-rpcstat. */ static void -gtk_rpcstat_init(char *optarg) +gtk_rpcstat_init(const char *optarg) { rpcstat_t *rs; guint32 i; @@ -227,7 +227,7 @@ gtk_rpcstat_init(char *optarg) GtkWidget *bbox; GtkWidget *close_bt; int program, version, pos; - char *filter=NULL; + const char *filter=NULL; GString *error_string; int hf_index; header_field_info *hfi; diff --git a/gtk/rtp_analysis.c b/gtk/rtp_analysis.c index 97a7a3f589..17712eb061 100644 --- a/gtk/rtp_analysis.c +++ b/gtk/rtp_analysis.c @@ -3641,7 +3641,7 @@ void rtp_analysis_cb(GtkWidget *w _U_, gpointer data _U_) /****************************************************************************/ static void -rtp_analysis_init(char *dummy _U_) +rtp_analysis_init(const char *dummy _U_) { rtp_analysis_cb(NULL, NULL); } diff --git a/gtk/rtp_stream.c b/gtk/rtp_stream.c index 4ddb0b9c70..ea9cf6e164 100644 --- a/gtk/rtp_stream.c +++ b/gtk/rtp_stream.c @@ -407,7 +407,7 @@ const rtpstream_tapinfo_t* rtpstream_get_info(void) /****************************************************************************/ static void -rtpstream_init_tap(char *dummy _U_) +rtpstream_init_tap(const char *dummy _U_) { /* XXX: never called? */ } diff --git a/gtk/sctp_chunk_stat.c b/gtk/sctp_chunk_stat.c index 68bd56d172..0f7e4268bb 100644 --- a/gtk/sctp_chunk_stat.c +++ b/gtk/sctp_chunk_stat.c @@ -2,7 +2,7 @@ * SCTP chunk counter for ethereal * Copyright 2005 Oleg Terletsky oleg.terletsky@comverse.com * - * $Id:$ + * $Id$ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -55,7 +55,7 @@ #include "ui_util.h" -static void sctpstat_init(char *optarg); +static void sctpstat_init(const char *optarg); static tap_dfilter_dlg sctp_stat_dlg = { "SCTP Statistics", @@ -263,7 +263,8 @@ win_destroy_cb(GtkWindow *win _U_, gpointer data) } -static gchar *titles[]={"Source IP", +static const gchar *titles[]={ + "Source IP", "Source Port", "Dest IP", "Dest Port", @@ -279,10 +280,10 @@ static gchar *titles[]={"Source IP", "ERROR" }; static void -sctpstat_init(char *optarg) +sctpstat_init(const char *optarg) { sctpstat_t *hs; - char *filter=NULL; + const char *filter=NULL; GString *error_string; GtkWidget *bbox; GtkWidget *close_bt; @@ -290,8 +291,7 @@ sctpstat_init(char *optarg) if(strncmp(optarg,"sctp,stat,",11) == 0){ filter=optarg+11; } else { - filter=g_malloc(1); - *filter='\0'; + filter=""; } hs=g_malloc(sizeof(sctpstat_t)); diff --git a/gtk/sctp_stat.c b/gtk/sctp_stat.c index 2b2dc3b54d..3dbc2c89f2 100644 --- a/gtk/sctp_stat.c +++ b/gtk/sctp_stat.c @@ -1445,7 +1445,7 @@ const sctp_allassocs_info_t* sctp_stat_get_info(void) static void -gtk_sctpstat_init(char *dummy _U_) +gtk_sctpstat_init(const char *dummy _U_) { } diff --git a/gtk/sip_stat.c b/gtk/sip_stat.c index 3f5dbc77d6..cff8020079 100644 --- a/gtk/sip_stat.c +++ b/gtk/sip_stat.c @@ -498,10 +498,10 @@ win_destroy_cb(GtkWindow *win _U_, gpointer data) /* Create a new instance of gtk_sipstat. */ static void -gtk_sipstat_init(char *optarg) +gtk_sipstat_init(const char *optarg) { sipstat_t *sp; - char *filter = NULL; + const char *filter = NULL; GString *error_string; char *title = NULL; GtkWidget *main_vb, *separator, diff --git a/gtk/smb_stat.c b/gtk/smb_stat.c index 308a965146..46fa1d7967 100644 --- a/gtk/smb_stat.c +++ b/gtk/smb_stat.c @@ -150,17 +150,17 @@ win_destroy_cb(GtkWindow *win _U_, gpointer data) static void -gtk_smbstat_init(char *optarg) +gtk_smbstat_init(const char *optarg) { smbstat_t *ss; - char *filter=NULL; + const char *filter=NULL; GtkWidget *label; char filter_string[256]; GString *error_string; int i; GtkWidget *vbox; - GtkWidget *bbox; - GtkWidget *close_bt; + GtkWidget *bbox; + GtkWidget *close_bt; if(!strncmp(optarg,"smb,srt,",8)){ filter=optarg+8; @@ -226,15 +226,15 @@ gtk_smbstat_init(char *optarg) gtk_box_pack_end(GTK_BOX(vbox), bbox, FALSE, FALSE, 0); close_bt = OBJECT_GET_DATA(bbox, GTK_STOCK_CLOSE); - window_set_cancel_button(ss->win, close_bt, window_cancel_button_cb); + window_set_cancel_button(ss->win, close_bt, window_cancel_button_cb); - SIGNAL_CONNECT(ss->win, "delete_event", window_delete_event_cb, NULL); + SIGNAL_CONNECT(ss->win, "delete_event", window_delete_event_cb, NULL); SIGNAL_CONNECT(ss->win, "destroy", win_destroy_cb, ss); - gtk_widget_show_all(ss->win); - window_present(ss->win); + gtk_widget_show_all(ss->win); + window_present(ss->win); - cf_retap_packets(&cfile); + cf_retap_packets(&cfile); } diff --git a/gtk/stats_tree_stat.c b/gtk/stats_tree_stat.c index 07394ebe54..ebde04b424 100644 --- a/gtk/stats_tree_stat.c +++ b/gtk/stats_tree_stat.c @@ -196,7 +196,7 @@ static void free_gtk_tree(GtkWindow *win _U_, stats_tree *st) /* initializes the stats_tree window */ -static void init_gtk_tree(char* optarg) { +static void init_gtk_tree(const char* optarg) { guint8* abbr = stats_tree_get_abbr(optarg); stats_tree* st = NULL; stats_tree_cfg* cfg = NULL; diff --git a/gtk/summary_dlg.c b/gtk/summary_dlg.c index bb38426407..079862ed9d 100644 --- a/gtk/summary_dlg.c +++ b/gtk/summary_dlg.c @@ -97,7 +97,7 @@ summary_open_cb(GtkWidget *w _U_, gpointer d _U_) *main_vb, *bbox, *close_bt, *help_bt; GtkWidget *table; GtkWidget *list; - char *titles[] = { "Traffic", "Captured", "Displayed" }; + static const char *titles[] = { "Traffic", "Captured", "Displayed" }; gchar string_buff[SUM_STR_MAX]; gchar string_buff2[SUM_STR_MAX]; diff --git a/gtk/toolbar.c b/gtk/toolbar.c index 06abbd3d5c..77a8139c67 100644 --- a/gtk/toolbar.c +++ b/gtk/toolbar.c @@ -160,7 +160,7 @@ static GtkWidget *color_display_button, *prefs_button, *help_button; #if GTK_MAJOR_VERSION >= 2 typedef struct stock_pixmap_tag{ const char * name; - char ** xpm_data; + const char ** xpm_data; } stock_pixmap_t; /* generate application specific stock items */ diff --git a/gtk/voip_calls_dlg.c b/gtk/voip_calls_dlg.c index 51c3c1fdb5..a24adef296 100644 --- a/gtk/voip_calls_dlg.c +++ b/gtk/voip_calls_dlg.c @@ -741,7 +741,7 @@ void voip_calls_dlg_reset(void *ptr _U_) /* init function for tap */ static void -voip_calls_init_tap(char *dummy _U_) +voip_calls_init_tap(const char *dummy _U_) { gint c; gchar *data[NUM_COLS]; diff --git a/gtk/wsp_stat.c b/gtk/wsp_stat.c index 06810d7e47..d3e713c032 100644 --- a/gtk/wsp_stat.c +++ b/gtk/wsp_stat.c @@ -304,10 +304,10 @@ wsp_init_table(wspstat_t *sp) /* When called, this function will create a new instance of gtk2-wspstat. */ static void -gtk_wspstat_init(char *optarg) +gtk_wspstat_init(const char *optarg) { wspstat_t *sp; - char *filter=NULL; + const char *filter=NULL; char *title=NULL; GString *error_string; GtkWidget *main_vb, *pdutypes_fr, *statuscode_fr ; diff --git a/tap-ansi_astat.c b/tap-ansi_astat.c index 376345ce93..34f6684091 100644 --- a/tap-ansi_astat.c +++ b/tap-ansi_astat.c @@ -134,14 +134,11 @@ ansi_a_stat_draw( static void -ansi_a_stat_init(char *optarg) +ansi_a_stat_init(const char *optarg _U_) { ansi_a_stat_t *stat_p; GString *err_p; - - optarg = optarg; - stat_p = g_malloc(sizeof(ansi_a_stat_t)); memset(stat_p, 0, sizeof(ansi_a_stat_t)); diff --git a/tap-bootpstat.c b/tap-bootpstat.c index 8063aa39f1..a7b08ec0c2 100644 --- a/tap-bootpstat.c +++ b/tap-bootpstat.c @@ -136,10 +136,10 @@ dhcpstat_draw(void *psp) /* When called, this function will create a new instance of tap-boopstat. */ static void -dhcpstat_init(char *optarg) +dhcpstat_init(const char *optarg) { dhcpstat_t *sp; - char *filter=NULL; + const char *filter=NULL; GString *error_string; if (!strncmp (optarg, "bootp,stat,", 11)){ diff --git a/tap-dcerpcstat.c b/tap-dcerpcstat.c index 3a7a9bcf57..a3dce1e4da 100644 --- a/tap-dcerpcstat.c +++ b/tap-dcerpcstat.c @@ -186,7 +186,7 @@ dcerpcstat_draw(void *prs) static void -dcerpcstat_init(char *optarg) +dcerpcstat_init(const char *optarg) { rpcstat_t *rs; guint32 i, max_procs; @@ -196,7 +196,7 @@ dcerpcstat_init(char *optarg) int major, minor; guint16 ver; int pos=0; - char *filter=NULL; + const char *filter=NULL; GString *error_string; /* diff --git a/tap-gsm_astat.c b/tap-gsm_astat.c index dd940f7d6e..0390e4e53d 100644 --- a/tap-gsm_astat.c +++ b/tap-gsm_astat.c @@ -269,14 +269,11 @@ gsm_a_stat_draw( static void -gsm_a_stat_init(char *optarg) +gsm_a_stat_init(const char *optarg _U_) { gsm_a_stat_t *stat_p; GString *err_p; - - optarg = optarg; - stat_p = g_malloc(sizeof(gsm_a_stat_t)); memset(stat_p, 0, sizeof(gsm_a_stat_t)); diff --git a/tap-h225counter.c b/tap-h225counter.c index b48dee6c35..90950ab509 100644 --- a/tap-h225counter.c +++ b/tap-h225counter.c @@ -387,17 +387,16 @@ h225counter_draw(void *phs) static void -h225counter_init(char *optarg) +h225counter_init(const char *optarg) { h225counter_t *hs; - char *filter=NULL; + const char *filter=NULL; GString *error_string; if(!strncmp(optarg,"h225,counter,",13)){ filter=optarg+13; } else { - filter=g_malloc(1); - *filter='\0'; + filter=""; } hs = g_malloc(sizeof(h225counter_t)); diff --git a/tap-h225rassrt.c b/tap-h225rassrt.c index 55abf24b80..c4fc55c9fc 100644 --- a/tap-h225rassrt.c +++ b/tap-h225rassrt.c @@ -211,17 +211,16 @@ h225rassrt_draw(void *phs) static void -h225rassrt_init(char *optarg) +h225rassrt_init(const char *optarg) { h225rassrt_t *hs; - char *filter=NULL; + const char *filter=NULL; GString *error_string; if(!strncmp(optarg,"h225,srt,",9)){ filter=optarg+9; } else { - filter=g_malloc(1); - *filter='\0'; + filter=""; } hs = g_malloc(sizeof(h225rassrt_t)); diff --git a/tap-httpstat.c b/tap-httpstat.c index df36c6930b..6d4db13063 100644 --- a/tap-httpstat.c +++ b/tap-httpstat.c @@ -280,10 +280,10 @@ httpstat_draw(void *psp ) /* When called, this function will create a new instance of gtk_httpstat. */ static void -gtk_httpstat_init(char *optarg) +gtk_httpstat_init(const char *optarg) { httpstat_t *sp; - char *filter=NULL; + const char *filter=NULL; GString *error_string; if (!strncmp (optarg, "http,stat,", 10)){ diff --git a/tap-iostat.c b/tap-iostat.c index b0c0659bd2..4a261f90ad 100644 --- a/tap-iostat.c +++ b/tap-iostat.c @@ -575,13 +575,13 @@ CALC_TYPE_AVG 5 } void -iostat_init(char *optarg) +iostat_init(const char *optarg) { float interval_float; gint32 interval; int pos=0; io_stat_t *io; - char *filter=NULL; + const char *filter=NULL; if(sscanf(optarg,"io,stat,%f,%n",&interval_float,&pos)==1){ if(pos){ @@ -611,7 +611,8 @@ iostat_init(char *optarg) register_io_tap(io, 0, NULL); } else { - char *str,*pos,*tmp; + const char *str,*pos; + char *tmp; int i; /* find how many ',' separated filters we have */ str=filter; diff --git a/tap-iousers.c b/tap-iousers.c index 1b1499ae12..693dbe36f7 100644 --- a/tap-iousers.c +++ b/tap-iousers.c @@ -579,9 +579,9 @@ iousers_draw(void *arg) } void -iousers_init(char *optarg) +iousers_init(const char *optarg) { - char *filter=NULL; + const char *filter=NULL; const char *tap_type, *tap_type_name; tap_packet_cb packet_func; io_users_t *iu=NULL; diff --git a/tap-mgcpstat.c b/tap-mgcpstat.c index bd96b07468..bb38620bb1 100644 --- a/tap-mgcpstat.c +++ b/tap-mgcpstat.c @@ -181,18 +181,17 @@ mgcpstat_draw(void *pms) static void -mgcpstat_init(char *optarg) +mgcpstat_init(const char *optarg) { mgcpstat_t *ms; int i; - char *filter=NULL; + const char *filter=NULL; GString *error_string; if(!strncmp(optarg,"mgcp,rtd,",9)){ filter=optarg+9; } else { - filter=g_malloc(1); - *filter='\0'; + filter=""; } ms=g_malloc(sizeof(mgcpstat_t)); diff --git a/tap-protocolinfo.c b/tap-protocolinfo.c index 562bfc23f2..8c66866b52 100644 --- a/tap-protocolinfo.c +++ b/tap-protocolinfo.c @@ -87,11 +87,11 @@ protocolinfo_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt, const vo static void -protocolinfo_init(char *optarg) +protocolinfo_init(const char *optarg) { pci_t *rs; - char *field=NULL; - char *filter=NULL; + const char *field=NULL; + const char *filter=NULL; header_field_info *hfi; GString *error_string; diff --git a/tap-protohierstat.c b/tap-protohierstat.c index f52dfca00e..ac3721a66d 100644 --- a/tap-protohierstat.c +++ b/tap-protohierstat.c @@ -166,11 +166,11 @@ protohierstat_draw(void *prs) static void -protohierstat_init(char *optarg) +protohierstat_init(const char *optarg) { phs_t *rs; int pos=0; - char *filter=NULL; + const char *filter=NULL; GString *error_string; if(!strcmp("io,phs",optarg)){ diff --git a/tap-rpcprogs.c b/tap-rpcprogs.c index be08010ca3..03ccd7ac3a 100644 --- a/tap-rpcprogs.c +++ b/tap-rpcprogs.c @@ -220,7 +220,7 @@ rpcprogs_draw(void *dummy _U_) static void -rpcprogs_init(char *optarg _U_) +rpcprogs_init(const char *optarg _U_) { GString *error_string; diff --git a/tap-rpcstat.c b/tap-rpcstat.c index ec178440dc..cfd4cc3827 100644 --- a/tap-rpcstat.c +++ b/tap-rpcstat.c @@ -277,13 +277,13 @@ rpcstat_find_procs(gpointer *key, gpointer *value _U_, gpointer *user_data _U_) * new instance for the rpc tap. */ static void -rpcstat_init(char *optarg) +rpcstat_init(const char *optarg) { rpcstat_t *rs; guint32 i; int program, version; int pos=0; - char *filter=NULL; + const char *filter=NULL; GString *error_string; if(sscanf(optarg,"rpc,rtt,%d,%d,%n",&program,&version,&pos)==2){ diff --git a/tap-sctpchunkstat.c b/tap-sctpchunkstat.c index 83b8985a14..5d60ccbab9 100644 --- a/tap-sctpchunkstat.c +++ b/tap-sctpchunkstat.c @@ -2,7 +2,7 @@ * SCTP chunk counter for ethereal * Copyright 2005 Oleg Terletsky * - * $Id:$ + * $Id$ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -219,17 +219,16 @@ sctpstat_draw(void *phs) static void -sctpstat_init(char *optarg) +sctpstat_init(const char *optarg) { sctpstat_t *hs; - char *filter=NULL; + const char *filter=NULL; GString *error_string; if(!strncmp(optarg,"sctp,stat,",11)){ filter=optarg+11; } else { - filter=g_malloc(1); - *filter='\0'; + filter=""; } hs = g_malloc(sizeof(sctpstat_t)); diff --git a/tap-sipstat.c b/tap-sipstat.c index 2aa6bdf8ae..190506a099 100644 --- a/tap-sipstat.c +++ b/tap-sipstat.c @@ -344,10 +344,10 @@ sipstat_draw(void *psp ) } static void -sipstat_init(char *optarg) +sipstat_init(const char *optarg) { sipstat_t *sp; - char *filter=NULL; + const char *filter=NULL; GString *error_string; if (strncmp (optarg, "sip,stat,", 9) == 0){ diff --git a/tap-smbsids.c b/tap-smbsids.c index 7aa7aec364..641140bffe 100644 --- a/tap-smbsids.c +++ b/tap-smbsids.c @@ -68,7 +68,7 @@ smbsids_draw(void *pss _U_) static void -smbsids_init(char *optarg _U_) +smbsids_init(const char *optarg _U_) { GString *error_string; diff --git a/tap-smbstat.c b/tap-smbstat.c index 6fa63e01d3..2c5aae3ddb 100644 --- a/tap-smbstat.c +++ b/tap-smbstat.c @@ -209,11 +209,11 @@ smbstat_draw(void *pss) static void -smbstat_init(char *optarg) +smbstat_init(const char *optarg) { smbstat_t *ss; guint32 i; - char *filter=NULL; + const char *filter=NULL; GString *error_string; if(!strncmp(optarg,"smb,rtt,",8)){ diff --git a/tap-stats_tree.c b/tap-stats_tree.c index 732154ff67..9533ac533a 100644 --- a/tap-stats_tree.c +++ b/tap-stats_tree.c @@ -67,7 +67,7 @@ static void draw_stats_tree(void *psp) { } -static void init_stats_tree(char *optarg) { +static void init_stats_tree(const char *optarg) { guint8* abbr = stats_tree_get_abbr(optarg); GString *error_string; stats_tree_cfg *cfg = NULL; diff --git a/tap-wspstat.c b/tap-wspstat.c index 8f76139a87..d22610b35b 100644 --- a/tap-wspstat.c +++ b/tap-wspstat.c @@ -213,10 +213,10 @@ wspstat_draw(void *psp) * new instance for the wsp tap. */ static void -wspstat_init(char *optarg) +wspstat_init(const char *optarg) { wspstat_t *sp; - char *filter=NULL; + const char *filter=NULL; guint32 i; GString *error_string; wsp_status_code_t *sc; diff --git a/tap_dfilter_dlg.h b/tap_dfilter_dlg.h index 35331b9b98..afd7e47c03 100644 --- a/tap_dfilter_dlg.h +++ b/tap_dfilter_dlg.h @@ -54,7 +54,7 @@ typedef struct _tap_dfilter_dlg { const char *win_title; /* title */ const char *init_string; /* the string to call the tap without a filter via "-z" option */ - void (* tap_init_cb)(char *); /* callback to init function of the tap */ + void (* tap_init_cb)(const char *); /* callback to init function of the tap */ gint index; /* initiate this value always with "-1" */ } tap_dfilter_dlg;