Squelch more const warnings (and fix some memory leaks that found).
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 6 Aug 2005 03:44:55 +0000 (03:44 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 6 Aug 2005 03:44:55 +0000 (03:44 +0000)
_U_-ify some unused arguments, rather than assigning them to themselves.

Un-constify one variable that gets assigned a mallocated pointer.

Clean up indentation.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15236 f5534014-38df-0310-8fa8-9805f1628bb7

61 files changed:
epan/tap.c
epan/tap.h
gtk/ansi_a_stat.c
gtk/ansi_map_stat.c
gtk/bootp_stat.c
gtk/dcerpc_stat.c
gtk/fc_stat.c
gtk/gsm_a_stat.c
gtk/gsm_map_stat.c
gtk/h225_counter.c
gtk/h225_ras_srt.c
gtk/hostlist_eth.c
gtk/hostlist_fc.c
gtk/hostlist_fddi.c
gtk/hostlist_ip.c
gtk/hostlist_ipx.c
gtk/hostlist_jxta.c
gtk/hostlist_table.h
gtk/hostlist_tcpip.c
gtk/hostlist_tr.c
gtk/hostlist_udpip.c
gtk/hostlist_wlan.c
gtk/io_stat.c
gtk/ldap_stat.c
gtk/menu.c
gtk/mgcp_stat.c
gtk/mtp3_stat.c
gtk/rpc_progs.c
gtk/rpc_stat.c
gtk/rtp_analysis.c
gtk/rtp_stream.c
gtk/sctp_chunk_stat.c
gtk/sctp_stat.c
gtk/sip_stat.c
gtk/smb_stat.c
gtk/stats_tree_stat.c
gtk/summary_dlg.c
gtk/toolbar.c
gtk/voip_calls_dlg.c
gtk/wsp_stat.c
tap-ansi_astat.c
tap-bootpstat.c
tap-dcerpcstat.c
tap-gsm_astat.c
tap-h225counter.c
tap-h225rassrt.c
tap-httpstat.c
tap-iostat.c
tap-iousers.c
tap-mgcpstat.c
tap-protocolinfo.c
tap-protohierstat.c
tap-rpcprogs.c
tap-rpcstat.c
tap-sctpchunkstat.c
tap-sipstat.c
tap-smbsids.c
tap-smbstat.c
tap-stats_tree.c
tap-wspstat.c
tap_dfilter_dlg.h

index 9f559f60401735a834c0d18f6e0db48d4fff21f9..14f100c195f413e3251b9136b63e1b6fe977f9aa 100644 (file)
@@ -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;
 
index 5d5d922cf7955eedad7e9a4970cd7e4352caf50e..c37dd450dbf27241a6c6e5391f60924f9dbb8368 100644 (file)
@@ -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);
index e1165c020664f220aeaed07bf560020f5355646c..df57744b469c2647abb5a46ea7bf26b049b25793 100644 (file)
@@ -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;
 }
 
 
index 5a71cb6cef2c4a7e3f1c6ebaf6cc30936e20dafd..03270be211db9d5d470c4906ecb2ceccf624f77d 100644 (file)
@@ -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;
 }
 
 
index 261cd851ccbeb9f83f4c330f96bb8fae65bd462a..54df43e2cb64faecfada754547753e16e47f874e 100644 (file)
@@ -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 = {
index fa04c4a8bae9e805f5586adbe39b513516e0b415..9892f090e963de108a49a7d32adccfea286e380b 100644 (file)
@@ -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);
 }
 
 
index 99378e72bdc4901afa41b5a9dd6575528bee8f0f..04650a960ee5be70319da8a216e08d83bd596f61 100644 (file)
@@ -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);
 }
 
 
index e34b4347a26fe34ac6e5d77bf155a4caaa80b83f..9a130810923deea9fa8c354dc8587d07cabec547 100644 (file)
@@ -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;
 }
 
 
index 2f8221126e26d26dd0c075d59c4e0b9b21085139..b7ef591b3dbb9a1ecba1c7e9f9f0678b0aa7a615 100644 (file)
@@ -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;
 }
 
 
index e6d1c6095d7c12571e36b03b1b13ebd953365bab..c7cb4858f58b0784d8653f2123b8bf2c93bcfcca 100644 (file)
@@ -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);
 }
index 57b9399352d009219af2cace065f2d56e8502197..92a6da1c3e51404b4e8cedad363ed55b8c3a1d84 100644 (file)
@@ -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
index 8a97687401d9a51747d41bca1f5ca76ab9c3bd33..7e61370a42c26c35c7a1b83c02a5485b96228a4e 100644 (file)
@@ -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;
index 886e58a7b3dddf8b728b60579af6da7f3328fa08..8aab16a80835bec092beda16d98cd3244e4151fd 100644 (file)
@@ -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;
index 81198fde018c6fdfc75846b8cd3a4f49b7996586..6df39c6048fa246c586a4424cbc46add3f04ebd1 100644 (file)
@@ -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;
index 57f456cd6ca1cc97c6d4ac814a28c84b55a64da4..9ed2cf71909692748200c09953bbf89469920b69 100644 (file)
@@ -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;
index b48930af21546ff27aa690408acdb9df08163a18..04a54f1cfc10b2c272217dc818bc2fb100241fc0 100644 (file)
@@ -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;
index 10017a36a4efcd0da789571ed6f4bf5a91aebf05..a31699cc29e24c849433dbe6f348fd77441f1f5a 100644 (file)
@@ -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;
index 17f78e72853fb3e6834446b7f4e7755a604bb73d..99577ef080a95be80378a56809777372ebbabb7f 100644 (file)
@@ -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 */
index 72f28fc9ca265ecfc0a63d3b557253c90b97b70c..f84958db3ffc706f3357045528b7f74a344229d0 100644 (file)
@@ -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;
index af21ca6ca34af05b0215be62049f0043374936cb..cb2021ef9d86851a0802f4f521c0a969b56a8408 100644 (file)
@@ -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);
 }
index 6d86a16ba77f4bcd57247d347fcbe54ebc6d10d2..7565cf0cbc1673ca4b8a9ff7e343f111c8c4abe0 100644 (file)
@@ -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;
index 07de604544c9f458eb2d1628517d9d98717548b5..65e0fe338bcee5e1a99b8ecf793fff4d3ed13325 100644 (file)
@@ -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;
index 1f24be9512a7bf9b50c1f97dffc4275fb0b8f98f..d1f5d6fc0dfcd55ba6968a78d57712805f461781 100644 (file)
@@ -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;
index da6149ef4bf82007049186336d888e8048c13b56..6f49002d1f270766992ab391601ee1d5c5afe61a 100644 (file)
@@ -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);
 }
 
 
index d722b28a314628da5f490219934875e1b6f874b2..8920d0c3f569851a851c63cced97141abfa0ee6f 100644 (file)
@@ -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;
index 9775071601a28c165c2b987cdbe2615221c0c2ad..6ce3a3cbcd5d98a54462ec0f5cf4b0dc9bc732aa 100644 (file)
@@ -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 = {
index ce6e96b1b4011d263e3a9c76d9174bb0dfcd2c00..68c768ba6533af56229c8c9fee0aca2ffa883a19 100644 (file)
@@ -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;
 }
 
 
index 9d674deb18bba48f71cdfeb838931cc784d453e5..d335496b7c468f3b4e7de88508f668d92423ca33 100644 (file)
@@ -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;
index 28ecd7ab0aadd16d742f87f01d70b1eeec5df9b3..88d26caac1fce21e7a7e92818ebeaaf498626eb3 100644 (file)
@@ -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;
index 97a7a3f589faef8d74f9212a80f2afffc7b0f71c..17712eb06171c3ca7152f02f6aadd17e1bffe4bc 100644 (file)
@@ -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);
 }
index 4ddb0b9c7034b1fc250ceb7c16b88d9eb553cdaf..ea9cf6e1649b0080a1ee0068241661757b2a238c 100644 (file)
@@ -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? */
 }
index 68bd56d1723deae478895e896c300319877bc0ab..0f7e4268bb6beb44a562cfee5c9f0e4823d4ef83 100644 (file)
@@ -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 <gerald@ethereal.com>
@@ -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));
index 2b2dc3b54d41efb3b09f2879f94938184ecf547e..3dbc2c89f26bb1d2a8a026aa8f7d301ba3f01f04 100644 (file)
@@ -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_)
 {
 
 }
index 3f5dbc77d677e2dc05b2b2b3b687241e3382dde3..cff8020079d7680fe078fa85080595179ada6f76 100644 (file)
@@ -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,
index 308a9651460e34517e290b2846e713a4dd4d6ca8..46fa1d7967e49af192d8167356ad056673033787 100644 (file)
@@ -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);
 }
 
 
index 07394ebe54ffc669390a5a28e170c29a966f9c55..ebde04b424aa1c4b939c41b17840a71b8d93e899 100644 (file)
@@ -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;
index bb384264072baf184aff3b932a07b67c65dc64da..079862ed9d3340d15d2244aa7bd2fcff1cb2433b 100644 (file)
@@ -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];
index 06abbd3d5c89064064c610fafd393b92ada31b80..77a8139c67886d61a0e5b07d9b0f17736a24d688 100644 (file)
@@ -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 */
index 51c3c1fdb5673a93aab4a9a12bebca8cbb4befa5..a24adef296f7693f2852d68180c51c8dee40b01c 100644 (file)
@@ -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];
index 06810d7e477c3254de766ad2ad628209f88c9f36..d3e713c0323ab00f0d43d184c5dd8ca5c58591b0 100644 (file)
@@ -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 ;
index 376345ce93023204a9508245d9e2ed0c9cc62c8f..34f6684091ff8f886676c41ba5f707a43febe5ec 100644 (file)
@@ -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));
index 8063aa39f1d316ffa1d9c3f3ba908ea3efa32e07..a7b08ec0c2f26e4e78d1e43a37e56e50a3b9fdc2 100644 (file)
@@ -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)){
index 3a7a9bcf57db60d7316215c341fe8acc1a8932d4..a3dce1e4da291d7a68b3aae410b3ec5a391e13b4 100644 (file)
@@ -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;
     
        /*
index dd940f7d6e71653050b0f2f92402057594fbe51e..0390e4e53dddf1af469ed3c44a757b7d77a20102 100644 (file)
@@ -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));
index b48dee6c354af0f8f0b3975f874b52bca1384db1..90950ab509e141151d048e3568d52737883fc445 100644 (file)
@@ -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));
index 55abf24b8002929480945e42d90d5ae7ceac04c8..c4fc55c9fcbc90e87ea579362b0f87711386a87e 100644 (file)
@@ -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));
index df36c6930b684c08a1dec983700b3d1a58368992..6d4db1306376273d73cc79acb18daf29f19efc24 100644 (file)
@@ -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)){
index b0c0659bd2c9f3020bdeee04a69c3fa07315a7c1..4a261f90adc924c243619f0a414b2595a4858fb0 100644 (file)
@@ -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;
index 1b1499ae123fb5a4ad22104e70983e70dad6dd69..693dbe36f7f7bd8012613f1b2b0cf21316962152 100644 (file)
@@ -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;
index bd96b07468b11041764d341fe247edaf854d66f3..bb38620bb1c4fb76985b0507fa804c43227ead5a 100644 (file)
@@ -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));
index 562bfc23f276f5beedf328e16afa86830a1d5b63..8c66866b52aa857ab69e3f35f048a8cd630b165b 100644 (file)
@@ -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;
 
index f52dfca00e973d8ff8099f28c178b5c3cbfd2ddf..ac3721a66d5857db1e2c5ac8ab52ea30f928fb90 100644 (file)
@@ -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)){
index be08010ca3426313a45a568fcef18ab114491ee4..03ccd7ac3aeac65d9677d12b41475b82bcc58eb3 100644 (file)
@@ -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;
 
index ec178440dcbb263973d4ecb97fe4732f8ad5aecb..cfd4cc3827519b355da8577e71673ff0f743cf6d 100644 (file)
@@ -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){
index 83b8985a149447627f4382fd0478f43db35abb50..5d60ccbab99ac34076fa7c0625b74d198f65f1bc 100644 (file)
@@ -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 <gerald@ethereal.com>
@@ -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));
index 2aa6bdf8ae299c70e312afe83e4f023e1fed79d4..190506a099cded2c2c6376eec5a515a8156fa198 100644 (file)
@@ -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){
index 7aa7aec36433cdcf7ea2f2833186f2c6578fcd31..641140bffebff2e116b3b36eb851d76527266b23 100644 (file)
@@ -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;
 
index 6fa63e01d346b1757d88a074a7f48a14c70462eb..2c5aae3ddb0cef8282d58584d129b8130affc1f0 100644 (file)
@@ -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)){
index 732154ff67eda462eb2d782a37c272b0241f987f..9533ac533a6f4f06909da09d8ed57d698c0ba6da 100644 (file)
@@ -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;
index 8f76139a87f790e35755435cdfd173bee6a58701..d22610b35b996e086e31e6b7bafb39a9ff7c8cdb 100644 (file)
@@ -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;
index 35331b9b98abf300cbe80659dc2dc5cef2024c3c..afd7e47c039d12d623e6b57d0304af7ee3b4427e 100644 (file)
@@ -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;