Use explicit casts.

svn path=/trunk/; revision=48161
This commit is contained in:
Anders Broman 2013-03-07 07:05:45 +00:00
parent 45a75522ed
commit 5d698bfd88
15 changed files with 57 additions and 57 deletions

View File

@ -93,13 +93,13 @@ diam_tree_to_csv(proto_node* node, gpointer data)
field_info* fi; field_info* fi;
header_field_info *hfi; header_field_info *hfi;
if(!node) { if(!node) {
fprintf(stderr,"traverse end: empty node. node='%p' data='%p'\n",node,data); fprintf(stderr,"traverse end: empty node. node='%p' data='%p'\n",(void *)node,(void *)data);
return FALSE; return FALSE;
} }
fi=node->finfo; fi=node->finfo;
hfi=fi ? fi->hfinfo : NULL; hfi=fi ? fi->hfinfo : NULL;
if(!hfi) { if(!hfi) {
fprintf(stderr,"traverse end: hfi not found. node='%p'\n",node); fprintf(stderr,"traverse end: hfi not found. node='%p'\n",(void *)node);
return FALSE; return FALSE;
} }
ftype=fi->value.ftype->ftype; ftype=fi->value.ftype->ftype;
@ -137,7 +137,7 @@ diameteravp_packet(void *pds, packet_info *pinfo, epan_dissect_t *edt _U_, const
proto_node* node = NULL; proto_node* node = NULL;
header_field_info* hfi=NULL; header_field_info* hfi=NULL;
field_info* finfo=NULL; field_info* finfo=NULL;
const diameter_req_ans_pair_t* dp=pdi; const diameter_req_ans_pair_t* dp=(const diameter_req_ans_pair_t*)pdi;
diameteravp_t *ds=NULL; diameteravp_t *ds=NULL;
/* Validate paramerers. */ /* Validate paramerers. */
@ -224,7 +224,7 @@ diameteravp_init(const char *optarg, void* userdata _U_)
GString* filter=NULL; GString* filter=NULL;
GString* error_string=NULL; GString* error_string=NULL;
ds=g_malloc(sizeof(diameteravp_t)); ds=g_new(diameteravp_t,1);
ds->frame=0; ds->frame=0;
ds->diammsg_toprocess=0; ds->diammsg_toprocess=0;
ds->cmd_code=0; ds->cmd_code=0;

View File

@ -63,7 +63,7 @@ gsm_a_stat_packet(
const void *data) const void *data)
{ {
gsm_a_stat_t *stat_p = (gsm_a_stat_t *)tapdata; gsm_a_stat_t *stat_p = (gsm_a_stat_t *)tapdata;
const gsm_a_tap_rec_t *tap_p = (gsm_a_tap_rec_t *)data; const gsm_a_tap_rec_t *tap_p = (const gsm_a_tap_rec_t *)data;
switch (tap_p->pdu_type) switch (tap_p->pdu_type)
{ {

View File

@ -1368,7 +1368,7 @@ iostat_init(const char *optarg, void* userdata _U_)
if(pos==str){ if(pos==str){
register_io_tap(io, i, NULL); register_io_tap(io, i, NULL);
} else if (pos==NULL) { } else if (pos==NULL) {
str = (char*) g_strstrip((gchar*)str); str = (const char*) g_strstrip((gchar*)str);
filter = g_strdup((gchar*) str); filter = g_strdup((gchar*) str);
if (*filter) if (*filter)
register_io_tap(io, i, filter); register_io_tap(io, i, filter);

View File

@ -45,7 +45,7 @@ typedef struct _pci_t {
static int static int
protocolinfo_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt, const void *dummy _U_) protocolinfo_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt, const void *dummy _U_)
{ {
pci_t *rs=prs; pci_t *rs=(pci_t *)prs;
GPtrArray *gp; GPtrArray *gp;
guint i; guint i;
char *str; char *str;
@ -70,7 +70,7 @@ protocolinfo_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt, const vo
} }
for(i=0;i<gp->len;i++){ for(i=0;i<gp->len;i++){
str=proto_construct_match_selected_string(gp->pdata[i], NULL); str=(char *)proto_construct_match_selected_string(gp->pdata[i], NULL);
if(str){ if(str){
col_append_fstr(pinfo->cinfo, COL_INFO, " %s",str); col_append_fstr(pinfo->cinfo, COL_INFO, " %s",str);
} }
@ -107,10 +107,10 @@ protocolinfo_init(const char *optarg, void* userdata _U_)
exit(1); exit(1);
} }
rs=g_malloc(sizeof(pci_t)); rs=g_new(pci_t,1);
rs->hf_index=hfi->id; rs->hf_index=hfi->id;
if((field-filter)>1){ if((field-filter)>1){
rs->filter=g_malloc(field-filter); rs->filter=(char *)g_malloc(field-filter);
g_strlcpy(rs->filter,filter,(field-filter)); g_strlcpy(rs->filter,filter,(field-filter));
} else { } else {
rs->filter=NULL; rs->filter=NULL;

View File

@ -51,7 +51,7 @@ static phs_t *
new_phs_t(phs_t *parent) new_phs_t(phs_t *parent)
{ {
phs_t *rs; phs_t *rs;
rs=g_malloc(sizeof(phs_t)); rs=g_new(phs_t,1);
rs->sibling=NULL; rs->sibling=NULL;
rs->child=NULL; rs->child=NULL;
rs->parent=parent; rs->parent=parent;
@ -154,7 +154,7 @@ phs_draw(phs_t *rs, int indentation)
static void static void
protohierstat_draw(void *prs) protohierstat_draw(void *prs)
{ {
phs_t *rs=prs; phs_t *rs=(phs_t *)prs;
printf("\n"); printf("\n");
printf("===================================================================\n"); printf("===================================================================\n");

View File

@ -81,7 +81,7 @@ static int
radiusstat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt _U_, const void *pri) radiusstat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt _U_, const void *pri)
{ {
radiusstat_t *rs=(radiusstat_t *)prs; radiusstat_t *rs=(radiusstat_t *)prs;
const radius_info_t *ri=pri; const radius_info_t *ri=(const radius_info_t *)pri;
nstime_t delta; nstime_t delta;
int ret = 0; int ret = 0;
@ -191,7 +191,7 @@ radiusstat_init(const char *optarg, void* userdata _U_)
int i; int i;
GString *error_string; GString *error_string;
rs=g_malloc(sizeof(radiusstat_t)); rs=g_new(radiusstat_t,1);
if(!strncmp(optarg,"radius,rtd,",11)){ if(!strncmp(optarg,"radius,rtd,",11)){
rs->filter=g_strdup(optarg+11); rs->filter=g_strdup(optarg+11);
} else { } else {

View File

@ -136,7 +136,7 @@ static rlc_lte_ep_t* alloc_rlc_lte_ep(const struct rlc_lte_tap_info *si, packet_
return NULL; return NULL;
} }
if (!(ep = g_malloc(sizeof(rlc_lte_ep_t)))) { if (!(ep = g_new(rlc_lte_ep_t,1))) {
return NULL; return NULL;
} }
@ -379,7 +379,7 @@ static void rlc_lte_stat_init(const char *optarg, void *userdata _U_)
} }
/* Create top-level struct */ /* Create top-level struct */
hs = g_malloc0(sizeof(rlc_lte_stat_t)); hs = g_new0(rlc_lte_stat_t,1);
hs->ep_list = NULL; hs->ep_list = NULL;

View File

@ -56,13 +56,13 @@ static int already_enabled=0;
static int static int
rpcprogs_packet(void *dummy1 _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const void *pri) rpcprogs_packet(void *dummy1 _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const void *pri)
{ {
const rpc_call_info_value *ri=pri; const rpc_call_info_value *ri=(const rpc_call_info_value *)pri;
nstime_t delta; nstime_t delta;
rpc_program_t *rp=NULL; rpc_program_t *rp=NULL;
if(!prog_list){ if(!prog_list){
/* the list was empty */ /* the list was empty */
rp=g_malloc(sizeof(rpc_program_t)); rp=g_new(rpc_program_t,1);
rp->next=NULL; rp->next=NULL;
rp->program=ri->prog; rp->program=ri->prog;
rp->version=ri->vers; rp->version=ri->vers;
@ -80,7 +80,7 @@ rpcprogs_packet(void *dummy1 _U_, packet_info *pinfo, epan_dissect_t *edt _U_, c
} else if( (ri->prog<prog_list->program) } else if( (ri->prog<prog_list->program)
||((ri->prog==prog_list->program)&&(ri->vers<prog_list->version))){ ||((ri->prog==prog_list->program)&&(ri->vers<prog_list->version))){
/* we should be first entry in list */ /* we should be first entry in list */
rp=g_malloc(sizeof(rpc_program_t)); rp=g_new(rpc_program_t,1);
rp->next=prog_list; rp->next=prog_list;
rp->program=ri->prog; rp->program=ri->prog;
rp->version=ri->vers; rp->version=ri->vers;
@ -106,7 +106,7 @@ rpcprogs_packet(void *dummy1 _U_, packet_info *pinfo, epan_dissect_t *edt _U_, c
|| ( (rp->next->program==ri->prog) || ( (rp->next->program==ri->prog)
&&(rp->next->version>ri->vers))){ &&(rp->next->version>ri->vers))){
rpc_program_t *trp; rpc_program_t *trp;
trp=g_malloc(sizeof(rpc_program_t)); trp=g_new(rpc_program_t,1);
trp->next=rp->next; trp->next=rp->next;
trp->program=ri->prog; trp->program=ri->prog;
trp->version=ri->vers; trp->version=ri->vers;

View File

@ -76,7 +76,7 @@ typedef struct _rpcstat_t {
static void static void
rpcstat_reset(void *prs) rpcstat_reset(void *prs)
{ {
rpcstat_t *rs=prs; rpcstat_t *rs=(rpcstat_t *)prs;
guint32 i; guint32 i;
for(i=0;i<rs->num_procedures;i++){ for(i=0;i<rs->num_procedures;i++){
@ -121,8 +121,8 @@ rpcstat_reset(void *prs)
static int static int
rpcstat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt _U_, const void *pri) rpcstat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt _U_, const void *pri)
{ {
rpcstat_t *rs=prs; rpcstat_t *rs=(rpcstat_t *)prs;
const rpc_call_info_value *ri=pri; const rpc_call_info_value *ri=(const rpc_call_info_value *)pri;
nstime_t delta; nstime_t delta;
rpc_procedure_t *rp; rpc_procedure_t *rp;
@ -193,7 +193,7 @@ rpcstat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
static void static void
rpcstat_draw(void *prs) rpcstat_draw(void *prs)
{ {
rpcstat_t *rs=prs; rpcstat_t *rs=(rpcstat_t *)prs;
guint32 i; guint32 i;
guint64 td; guint64 td;
printf("\n"); printf("\n");
@ -281,7 +281,7 @@ rpcstat_init(const char *optarg, void* userdata _U_)
exit(1); exit(1);
} }
rs=g_malloc(sizeof(rpcstat_t)); rs=g_new(rpcstat_t,1);
rs->prog=rpc_prog_name(program); rs->prog=rpc_prog_name(program);
rs->program=program; rs->program=program;
rs->version=version; rs->version=version;
@ -303,7 +303,7 @@ rpcstat_init(const char *optarg, void* userdata _U_)
rs->num_procedures=rpc_max_proc+1; rs->num_procedures=rpc_max_proc+1;
rs->procedures=g_malloc(sizeof(rpc_procedure_t)*(rs->num_procedures+1)); rs->procedures=g_new(rpc_procedure_t,rs->num_procedures+1);
for(i=0;i<rs->num_procedures;i++){ for(i=0;i<rs->num_procedures;i++){
rs->procedures[i].proc=rpc_proc_name(program, version, i); rs->procedures[i].proc=rpc_proc_name(program, version, i);
rs->procedures[i].num=0; rs->procedures[i].num=0;

View File

@ -73,8 +73,8 @@ rtsp_init_hash( rtspstat_t *sp)
for (i=0 ; rtsp_status_code_vals[i].strptr ; i++ ) for (i=0 ; rtsp_status_code_vals[i].strptr ; i++ )
{ {
gint *key = g_malloc (sizeof(gint)); gint *key = g_new (gint,1);
rtsp_response_code_t *sc = g_malloc (sizeof(rtsp_response_code_t)); rtsp_response_code_t *sc = g_new (rtsp_response_code_t,1);
*key = rtsp_status_code_vals[i].value; *key = rtsp_status_code_vals[i].value;
sc->packets=0; sc->packets=0;
sc->response_code = *key; sc->response_code = *key;
@ -130,7 +130,7 @@ rtsp_reset_hash_requests(gchar *key _U_ , rtsp_request_methode_t *data, gpointer
static void static void
rtspstat_reset(void *psp ) rtspstat_reset(void *psp )
{ {
rtspstat_t *sp=psp; rtspstat_t *sp=(rtspstat_t *)psp;
g_hash_table_foreach( sp->hash_responses, (GHFunc)rtsp_reset_hash_responses, NULL); g_hash_table_foreach( sp->hash_responses, (GHFunc)rtsp_reset_hash_responses, NULL);
g_hash_table_foreach( sp->hash_requests, (GHFunc)rtsp_reset_hash_requests, NULL); g_hash_table_foreach( sp->hash_requests, (GHFunc)rtsp_reset_hash_requests, NULL);
@ -140,17 +140,17 @@ rtspstat_reset(void *psp )
static int static int
rtspstat_packet(void *psp , packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *pri) rtspstat_packet(void *psp , packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *pri)
{ {
const rtsp_info_value_t *value=pri; const rtsp_info_value_t *value=(const rtsp_info_value_t *)pri;
rtspstat_t *sp=(rtspstat_t *) psp; rtspstat_t *sp=(rtspstat_t *) psp;
/* We are only interested in reply packets with a status code */ /* We are only interested in reply packets with a status code */
/* Request or reply packets ? */ /* Request or reply packets ? */
if (value->response_code!=0) { if (value->response_code!=0) {
guint *key=g_malloc( sizeof(guint) ); guint *key=g_new(guint,1);
rtsp_response_code_t *sc; rtsp_response_code_t *sc;
*key=value->response_code; *key=value->response_code;
sc = g_hash_table_lookup( sc = (rtsp_response_code_t *)g_hash_table_lookup(
sp->hash_responses, sp->hash_responses,
key); key);
if (sc==NULL){ if (sc==NULL){
@ -176,7 +176,7 @@ rtspstat_packet(void *psp , packet_info *pinfo _U_, epan_dissect_t *edt _U_, con
else{ else{
*key=599; *key=599;
} }
sc = g_hash_table_lookup( sc = (rtsp_response_code_t *)g_hash_table_lookup(
sp->hash_responses, sp->hash_responses,
key); key);
if (sc==NULL) if (sc==NULL)
@ -187,11 +187,11 @@ rtspstat_packet(void *psp , packet_info *pinfo _U_, epan_dissect_t *edt _U_, con
else if (value->request_method){ else if (value->request_method){
rtsp_request_methode_t *sc; rtsp_request_methode_t *sc;
sc = g_hash_table_lookup( sc = (rtsp_request_methode_t *)g_hash_table_lookup(
sp->hash_requests, sp->hash_requests,
value->request_method); value->request_method);
if (sc==NULL){ if (sc==NULL){
sc=g_malloc( sizeof(rtsp_request_methode_t) ); sc=g_new(rtsp_request_methode_t,1);
sc->response=g_strdup( value->request_method ); sc->response=g_strdup( value->request_method );
sc->packets=1; sc->packets=1;
sc->sp = sp; sc->sp = sp;
@ -209,7 +209,7 @@ rtspstat_packet(void *psp , packet_info *pinfo _U_, epan_dissect_t *edt _U_, con
static void static void
rtspstat_draw(void *psp ) rtspstat_draw(void *psp )
{ {
rtspstat_t *sp=psp; rtspstat_t *sp=(rtspstat_t *)psp;
printf("\n"); printf("\n");
printf("===================================================================\n"); printf("===================================================================\n");
if (! sp->filter[0]) if (! sp->filter[0])

View File

@ -64,7 +64,7 @@ typedef struct _scsistat_t {
static void static void
scsistat_reset(void *prs) scsistat_reset(void *prs)
{ {
scsistat_t *rs=prs; scsistat_t *rs=(scsistat_t *)prs;
guint32 i; guint32 i;
for(i=0; i < MAX_PROCEDURES; i++) { for(i=0; i < MAX_PROCEDURES; i++) {
@ -81,8 +81,8 @@ scsistat_reset(void *prs)
static int static int
scsistat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt _U_, const void *pri) scsistat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt _U_, const void *pri)
{ {
scsistat_t *rs = prs; scsistat_t *rs = (scsistat_t *)prs;
const scsi_task_data_t *ri = pri; const scsi_task_data_t *ri = (const scsi_task_data_t *)pri;
nstime_t delta; nstime_t delta;
scsi_procedure_t *rp; scsi_procedure_t *rp;
@ -137,7 +137,7 @@ scsistat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt _U_, const vo
static void static void
scsistat_draw(void *prs) scsistat_draw(void *prs)
{ {
scsistat_t *rs=prs; scsistat_t *rs=(scsistat_t *)prs;
guint32 i; guint32 i;
guint64 td; guint64 td;
@ -189,7 +189,7 @@ scsistat_init(const char *optarg, void* userdata _U_)
} }
scsi_program=program; scsi_program=program;
rs=g_malloc(sizeof(scsistat_t)); rs=g_new(scsistat_t,1);
if(filter) { if(filter) {
rs->filter=g_strdup(filter); rs->filter=g_strdup(filter);
} else { } else {
@ -225,7 +225,7 @@ scsistat_init(const char *optarg, void* userdata _U_)
rs->cdbnames=scsi_sbc_vals; rs->cdbnames=scsi_sbc_vals;
break; break;
} }
rs->procedures=g_malloc(sizeof(scsi_procedure_t)*MAX_PROCEDURES); rs->procedures=g_new(scsi_procedure_t,MAX_PROCEDURES);
for(i=0; i < MAX_PROCEDURES; i++) { for(i=0; i < MAX_PROCEDURES; i++) {
rs->procedures[i].proc=val_to_str(i, rs->cdbnames, "Unknown-0x%02x"); rs->procedures[i].proc=val_to_str(i, rs->cdbnames, "Unknown-0x%02x");
rs->procedures[i].num=0; rs->procedures[i].num=0;

View File

@ -107,7 +107,7 @@ alloc_sctp_ep(const struct _sctp_info *si)
if(!si) if(!si)
return NULL; return NULL;
if (!(ep = g_malloc(sizeof(sctp_ep_t)))) if (!(ep = g_new(sctp_ep_t,1)))
return NULL; return NULL;
COPY_ADDRESS(&ep->src,&si->ip_src); COPY_ADDRESS(&ep->src,&si->ip_src);

View File

@ -160,8 +160,8 @@ sip_init_hash(sipstat_t *sp)
/* Add all response codes */ /* Add all response codes */
for (i=0 ; vals_status_code[i].strptr ; i++) for (i=0 ; vals_status_code[i].strptr ; i++)
{ {
gint *key = g_malloc (sizeof(gint)); gint *key = g_new (gint,1);
sip_response_code_t *sc = g_malloc (sizeof(sip_response_code_t)); sip_response_code_t *sc = g_new (sip_response_code_t,1);
*key = vals_status_code[i].value; *key = vals_status_code[i].value;
sc->packets=0; sc->packets=0;
sc->response_code = *key; sc->response_code = *key;
@ -218,7 +218,7 @@ sip_reset_hash_requests(gchar *key _U_ , sip_request_method_t *data, gpointer pt
static void static void
sipstat_reset(void *psp ) sipstat_reset(void *psp )
{ {
sipstat_t *sp=psp; sipstat_t *sp=(sipstat_t *)psp;
if (sp) { if (sp) {
sp->packets = 0; sp->packets = 0;
sp->resent_packets = 0; sp->resent_packets = 0;
@ -238,7 +238,7 @@ sipstat_reset(void *psp )
static int static int
sipstat_packet(void *psp, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *pri) sipstat_packet(void *psp, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *pri)
{ {
const sip_info_value_t *value=pri; const sip_info_value_t *value=(const sip_info_value_t *)pri;
sipstat_t *sp = (sipstat_t *)psp; sipstat_t *sp = (sipstat_t *)psp;
/* Total number of packets, including continuation packets */ /* Total number of packets, including continuation packets */
@ -277,12 +277,12 @@ sipstat_packet(void *psp, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const
if (value->response_code != 0) if (value->response_code != 0)
{ {
/* Responses */ /* Responses */
guint *key = g_malloc(sizeof(guint)); guint *key = g_new(guint,1);
sip_response_code_t *sc; sip_response_code_t *sc;
/* Look up response code in hash table */ /* Look up response code in hash table */
*key = value->response_code; *key = value->response_code;
sc = g_hash_table_lookup(sp->hash_responses, key); sc = (sip_response_code_t *)g_hash_table_lookup(sp->hash_responses, key);
if (sc==NULL) if (sc==NULL)
{ {
/* Non-standard status code ; we classify it as others /* Non-standard status code ; we classify it as others
@ -321,7 +321,7 @@ sipstat_packet(void *psp, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const
} }
/* Now look up this fallback code to get its text description */ /* Now look up this fallback code to get its text description */
sc = g_hash_table_lookup(sp->hash_responses, key); sc = (sip_response_code_t *)g_hash_table_lookup(sp->hash_responses, key);
if (sc==NULL) if (sc==NULL)
{ {
return 0; return 0;
@ -335,11 +335,11 @@ sipstat_packet(void *psp, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const
sip_request_method_t *sc; sip_request_method_t *sc;
/* Look up the request method in the table */ /* Look up the request method in the table */
sc = g_hash_table_lookup(sp->hash_requests, value->request_method); sc = (sip_request_method_t *)g_hash_table_lookup(sp->hash_requests, value->request_method);
if (sc == NULL) if (sc == NULL)
{ {
/* First of this type. Create structure and initialise */ /* First of this type. Create structure and initialise */
sc=g_malloc(sizeof(sip_request_method_t)); sc=g_new(sip_request_method_t,1);
sc->response = g_strdup(value->request_method); sc->response = g_strdup(value->request_method);
sc->packets = 1; sc->packets = 1;
sc->sp = sp; sc->sp = sp;
@ -365,7 +365,7 @@ sipstat_packet(void *psp, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const
static void static void
sipstat_draw(void *psp ) sipstat_draw(void *psp )
{ {
sipstat_t *sp=psp; sipstat_t *sp=(sipstat_t *)psp;
printf("\n"); printf("\n");
printf("===================================================================\n"); printf("===================================================================\n");
if (sp->filter == NULL) if (sp->filter == NULL)
@ -398,7 +398,7 @@ sipstat_init(const char *optarg, void* userdata _U_)
filter=NULL; filter=NULL;
} }
sp = g_malloc( sizeof(sipstat_t) ); sp = g_new(sipstat_t,1);
if(filter){ if(filter){
sp->filter=g_strdup(filter); sp->filter=g_strdup(filter);
} else { } else {

View File

@ -51,7 +51,7 @@ static int
smbstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const void *psi) smbstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const void *psi)
{ {
smbstat_t *ss=(smbstat_t *)pss; smbstat_t *ss=(smbstat_t *)pss;
const smb_info_t *si=psi; const smb_info_t *si=(const smb_info_t *)psi;
nstime_t t, deltat; nstime_t t, deltat;
timestat_t *sp=NULL; timestat_t *sp=NULL;
@ -193,7 +193,7 @@ smbstat_init(const char *optarg,void* userdata _U_)
filter=NULL; filter=NULL;
} }
ss=g_malloc(sizeof(smbstat_t)); ss=g_new(smbstat_t,1);
if(filter){ if(filter){
ss->filter=g_strdup(filter); ss->filter=g_strdup(filter);
} else { } else {

View File

@ -39,7 +39,7 @@ static int
sv_packet(void *prs _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const void *pri) sv_packet(void *prs _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const void *pri)
{ {
int i; int i;
const sv_frame_data * sv_data = pri; const sv_frame_data * sv_data = (const sv_frame_data *)pri;
printf("%f %u ", nstime_to_sec(&pinfo->fd->rel_ts), sv_data->smpCnt); printf("%f %u ", nstime_to_sec(&pinfo->fd->rel_ts), sv_data->smpCnt);