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
This commit is contained in:
Guy Harris 2005-08-06 03:44:55 +00:00
parent b992c73391
commit 5fb6e97fb4
61 changed files with 188 additions and 206 deletions

View 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;

View 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);

View 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;
}

View 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;
}

View 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 = {

View 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);
}

View 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);
}

View 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;
}

View 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;
}

View 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);
}

View 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

View 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;

View 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;

View 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;

View 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;

View 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;

View 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;

View 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 */

View 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;

View 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);
}

View 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;

View 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;

View 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;

View 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);
}

View 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;

View 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 = {

View 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;
}

View 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;

View 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;

View 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);
}

View 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? */
}

View 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));

View 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_)
{
}

View 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,

View 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);
}

View 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;

View 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];

View 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 */

View 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];

View 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 ;

View 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));

View 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)){

View 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;
/*

View 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));

View 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));

View 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));

View 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)){

View 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;

View 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;

View 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));

View 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;

View 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)){

View 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;

View 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){

View 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));

View 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){

View 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;

View 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)){

View 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;

View 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;

View 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;