diff options
author | Anders Broman <anders.broman@ericsson.com> | 2013-03-07 07:05:45 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2013-03-07 07:05:45 +0000 |
commit | 5d698bfd8898114f24c3e305a2861ab4e98c75e0 (patch) | |
tree | 512905ca5326683a1459e9258849888c366be5f5 | |
parent | 45a75522ed968d105b361b2cd3db5adde23479e4 (diff) | |
download | wireshark-5d698bfd8898114f24c3e305a2861ab4e98c75e0.tar.gz |
Use explicit casts.
svn path=/trunk/; revision=48161
-rw-r--r-- | ui/cli/tap-diameter-avp.c | 8 | ||||
-rw-r--r-- | ui/cli/tap-gsm_astat.c | 2 | ||||
-rw-r--r-- | ui/cli/tap-iostat.c | 2 | ||||
-rw-r--r-- | ui/cli/tap-protocolinfo.c | 8 | ||||
-rw-r--r-- | ui/cli/tap-protohierstat.c | 4 | ||||
-rw-r--r-- | ui/cli/tap-radiusstat.c | 4 | ||||
-rw-r--r-- | ui/cli/tap-rlcltestat.c | 4 | ||||
-rw-r--r-- | ui/cli/tap-rpcprogs.c | 8 | ||||
-rw-r--r-- | ui/cli/tap-rpcstat.c | 12 | ||||
-rw-r--r-- | ui/cli/tap-rtspstat.c | 20 | ||||
-rw-r--r-- | ui/cli/tap-scsistat.c | 12 | ||||
-rw-r--r-- | ui/cli/tap-sctpchunkstat.c | 2 | ||||
-rw-r--r-- | ui/cli/tap-sipstat.c | 22 | ||||
-rw-r--r-- | ui/cli/tap-smbstat.c | 4 | ||||
-rw-r--r-- | ui/cli/tap-sv.c | 2 |
15 files changed, 57 insertions, 57 deletions
diff --git a/ui/cli/tap-diameter-avp.c b/ui/cli/tap-diameter-avp.c index fa0b4c476a..f3b5777bdc 100644 --- a/ui/cli/tap-diameter-avp.c +++ b/ui/cli/tap-diameter-avp.c @@ -93,13 +93,13 @@ diam_tree_to_csv(proto_node* node, gpointer data) field_info* fi; header_field_info *hfi; 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; } fi=node->finfo; hfi=fi ? fi->hfinfo : NULL; 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; } 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; header_field_info* hfi=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; /* Validate paramerers. */ @@ -224,7 +224,7 @@ diameteravp_init(const char *optarg, void* userdata _U_) GString* filter=NULL; GString* error_string=NULL; - ds=g_malloc(sizeof(diameteravp_t)); + ds=g_new(diameteravp_t,1); ds->frame=0; ds->diammsg_toprocess=0; ds->cmd_code=0; diff --git a/ui/cli/tap-gsm_astat.c b/ui/cli/tap-gsm_astat.c index faca4d88e7..f358218979 100644 --- a/ui/cli/tap-gsm_astat.c +++ b/ui/cli/tap-gsm_astat.c @@ -63,7 +63,7 @@ gsm_a_stat_packet( const void *data) { 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) { diff --git a/ui/cli/tap-iostat.c b/ui/cli/tap-iostat.c index c7312215ce..8e18a11c0b 100644 --- a/ui/cli/tap-iostat.c +++ b/ui/cli/tap-iostat.c @@ -1368,7 +1368,7 @@ iostat_init(const char *optarg, void* userdata _U_) if(pos==str){ register_io_tap(io, i, NULL); } else if (pos==NULL) { - str = (char*) g_strstrip((gchar*)str); + str = (const char*) g_strstrip((gchar*)str); filter = g_strdup((gchar*) str); if (*filter) register_io_tap(io, i, filter); diff --git a/ui/cli/tap-protocolinfo.c b/ui/cli/tap-protocolinfo.c index 121a205eb8..39405784fb 100644 --- a/ui/cli/tap-protocolinfo.c +++ b/ui/cli/tap-protocolinfo.c @@ -45,7 +45,7 @@ typedef struct _pci_t { static int 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; guint i; 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++){ - str=proto_construct_match_selected_string(gp->pdata[i], NULL); + str=(char *)proto_construct_match_selected_string(gp->pdata[i], NULL); if(str){ col_append_fstr(pinfo->cinfo, COL_INFO, " %s",str); } @@ -107,10 +107,10 @@ protocolinfo_init(const char *optarg, void* userdata _U_) exit(1); } - rs=g_malloc(sizeof(pci_t)); + rs=g_new(pci_t,1); rs->hf_index=hfi->id; if((field-filter)>1){ - rs->filter=g_malloc(field-filter); + rs->filter=(char *)g_malloc(field-filter); g_strlcpy(rs->filter,filter,(field-filter)); } else { rs->filter=NULL; diff --git a/ui/cli/tap-protohierstat.c b/ui/cli/tap-protohierstat.c index 3ffd8b9cd0..49bf55b85a 100644 --- a/ui/cli/tap-protohierstat.c +++ b/ui/cli/tap-protohierstat.c @@ -51,7 +51,7 @@ static phs_t * new_phs_t(phs_t *parent) { phs_t *rs; - rs=g_malloc(sizeof(phs_t)); + rs=g_new(phs_t,1); rs->sibling=NULL; rs->child=NULL; rs->parent=parent; @@ -154,7 +154,7 @@ phs_draw(phs_t *rs, int indentation) static void protohierstat_draw(void *prs) { - phs_t *rs=prs; + phs_t *rs=(phs_t *)prs; printf("\n"); printf("===================================================================\n"); diff --git a/ui/cli/tap-radiusstat.c b/ui/cli/tap-radiusstat.c index 26271e2806..852c89d0c8 100644 --- a/ui/cli/tap-radiusstat.c +++ b/ui/cli/tap-radiusstat.c @@ -81,7 +81,7 @@ static int radiusstat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt _U_, const void *pri) { 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; int ret = 0; @@ -191,7 +191,7 @@ radiusstat_init(const char *optarg, void* userdata _U_) int i; GString *error_string; - rs=g_malloc(sizeof(radiusstat_t)); + rs=g_new(radiusstat_t,1); if(!strncmp(optarg,"radius,rtd,",11)){ rs->filter=g_strdup(optarg+11); } else { diff --git a/ui/cli/tap-rlcltestat.c b/ui/cli/tap-rlcltestat.c index b3d2e3c71d..3aa87bcb20 100644 --- a/ui/cli/tap-rlcltestat.c +++ b/ui/cli/tap-rlcltestat.c @@ -136,7 +136,7 @@ static rlc_lte_ep_t* alloc_rlc_lte_ep(const struct rlc_lte_tap_info *si, packet_ return NULL; } - if (!(ep = g_malloc(sizeof(rlc_lte_ep_t)))) { + if (!(ep = g_new(rlc_lte_ep_t,1))) { return NULL; } @@ -379,7 +379,7 @@ static void rlc_lte_stat_init(const char *optarg, void *userdata _U_) } /* Create top-level struct */ - hs = g_malloc0(sizeof(rlc_lte_stat_t)); + hs = g_new0(rlc_lte_stat_t,1); hs->ep_list = NULL; diff --git a/ui/cli/tap-rpcprogs.c b/ui/cli/tap-rpcprogs.c index c80dce0127..900621d724 100644 --- a/ui/cli/tap-rpcprogs.c +++ b/ui/cli/tap-rpcprogs.c @@ -56,13 +56,13 @@ static int already_enabled=0; static int 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; rpc_program_t *rp=NULL; if(!prog_list){ /* the list was empty */ - rp=g_malloc(sizeof(rpc_program_t)); + rp=g_new(rpc_program_t,1); rp->next=NULL; rp->program=ri->prog; 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) ||((ri->prog==prog_list->program)&&(ri->vers<prog_list->version))){ /* 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->program=ri->prog; 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->version>ri->vers))){ rpc_program_t *trp; - trp=g_malloc(sizeof(rpc_program_t)); + trp=g_new(rpc_program_t,1); trp->next=rp->next; trp->program=ri->prog; trp->version=ri->vers; diff --git a/ui/cli/tap-rpcstat.c b/ui/cli/tap-rpcstat.c index 32a18c6bb5..9d75ff9842 100644 --- a/ui/cli/tap-rpcstat.c +++ b/ui/cli/tap-rpcstat.c @@ -76,7 +76,7 @@ typedef struct _rpcstat_t { static void rpcstat_reset(void *prs) { - rpcstat_t *rs=prs; + rpcstat_t *rs=(rpcstat_t *)prs; guint32 i; for(i=0;i<rs->num_procedures;i++){ @@ -121,8 +121,8 @@ rpcstat_reset(void *prs) static int rpcstat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt _U_, const void *pri) { - rpcstat_t *rs=prs; - const rpc_call_info_value *ri=pri; + rpcstat_t *rs=(rpcstat_t *)prs; + const rpc_call_info_value *ri=(const rpc_call_info_value *)pri; nstime_t delta; rpc_procedure_t *rp; @@ -193,7 +193,7 @@ rpcstat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt _U_, const voi static void rpcstat_draw(void *prs) { - rpcstat_t *rs=prs; + rpcstat_t *rs=(rpcstat_t *)prs; guint32 i; guint64 td; printf("\n"); @@ -281,7 +281,7 @@ rpcstat_init(const char *optarg, void* userdata _U_) exit(1); } - rs=g_malloc(sizeof(rpcstat_t)); + rs=g_new(rpcstat_t,1); rs->prog=rpc_prog_name(program); rs->program=program; rs->version=version; @@ -303,7 +303,7 @@ rpcstat_init(const char *optarg, void* userdata _U_) 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++){ rs->procedures[i].proc=rpc_proc_name(program, version, i); rs->procedures[i].num=0; diff --git a/ui/cli/tap-rtspstat.c b/ui/cli/tap-rtspstat.c index 8e470c7e14..e372a94e6e 100644 --- a/ui/cli/tap-rtspstat.c +++ b/ui/cli/tap-rtspstat.c @@ -73,8 +73,8 @@ rtsp_init_hash( rtspstat_t *sp) for (i=0 ; rtsp_status_code_vals[i].strptr ; i++ ) { - gint *key = g_malloc (sizeof(gint)); - rtsp_response_code_t *sc = g_malloc (sizeof(rtsp_response_code_t)); + gint *key = g_new (gint,1); + rtsp_response_code_t *sc = g_new (rtsp_response_code_t,1); *key = rtsp_status_code_vals[i].value; sc->packets=0; sc->response_code = *key; @@ -130,7 +130,7 @@ rtsp_reset_hash_requests(gchar *key _U_ , rtsp_request_methode_t *data, gpointer static void 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_requests, (GHFunc)rtsp_reset_hash_requests, NULL); @@ -140,17 +140,17 @@ rtspstat_reset(void *psp ) static int 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; /* We are only interested in reply packets with a status code */ /* Request or reply packets ? */ if (value->response_code!=0) { - guint *key=g_malloc( sizeof(guint) ); + guint *key=g_new(guint,1); rtsp_response_code_t *sc; *key=value->response_code; - sc = g_hash_table_lookup( + sc = (rtsp_response_code_t *)g_hash_table_lookup( sp->hash_responses, key); if (sc==NULL){ @@ -176,7 +176,7 @@ rtspstat_packet(void *psp , packet_info *pinfo _U_, epan_dissect_t *edt _U_, con else{ *key=599; } - sc = g_hash_table_lookup( + sc = (rtsp_response_code_t *)g_hash_table_lookup( sp->hash_responses, key); 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){ rtsp_request_methode_t *sc; - sc = g_hash_table_lookup( + sc = (rtsp_request_methode_t *)g_hash_table_lookup( sp->hash_requests, value->request_method); 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->packets=1; sc->sp = sp; @@ -209,7 +209,7 @@ rtspstat_packet(void *psp , packet_info *pinfo _U_, epan_dissect_t *edt _U_, con static void rtspstat_draw(void *psp ) { - rtspstat_t *sp=psp; + rtspstat_t *sp=(rtspstat_t *)psp; printf("\n"); printf("===================================================================\n"); if (! sp->filter[0]) diff --git a/ui/cli/tap-scsistat.c b/ui/cli/tap-scsistat.c index b8b226f097..c479f8dc27 100644 --- a/ui/cli/tap-scsistat.c +++ b/ui/cli/tap-scsistat.c @@ -64,7 +64,7 @@ typedef struct _scsistat_t { static void scsistat_reset(void *prs) { - scsistat_t *rs=prs; + scsistat_t *rs=(scsistat_t *)prs; guint32 i; for(i=0; i < MAX_PROCEDURES; i++) { @@ -81,8 +81,8 @@ scsistat_reset(void *prs) static int scsistat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt _U_, const void *pri) { - scsistat_t *rs = prs; - const scsi_task_data_t *ri = pri; + scsistat_t *rs = (scsistat_t *)prs; + const scsi_task_data_t *ri = (const scsi_task_data_t *)pri; nstime_t delta; scsi_procedure_t *rp; @@ -137,7 +137,7 @@ scsistat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt _U_, const vo static void scsistat_draw(void *prs) { - scsistat_t *rs=prs; + scsistat_t *rs=(scsistat_t *)prs; guint32 i; guint64 td; @@ -189,7 +189,7 @@ scsistat_init(const char *optarg, void* userdata _U_) } scsi_program=program; - rs=g_malloc(sizeof(scsistat_t)); + rs=g_new(scsistat_t,1); if(filter) { rs->filter=g_strdup(filter); } else { @@ -225,7 +225,7 @@ scsistat_init(const char *optarg, void* userdata _U_) rs->cdbnames=scsi_sbc_vals; 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++) { rs->procedures[i].proc=val_to_str(i, rs->cdbnames, "Unknown-0x%02x"); rs->procedures[i].num=0; diff --git a/ui/cli/tap-sctpchunkstat.c b/ui/cli/tap-sctpchunkstat.c index 1d1ff52a18..1b0f26c134 100644 --- a/ui/cli/tap-sctpchunkstat.c +++ b/ui/cli/tap-sctpchunkstat.c @@ -107,7 +107,7 @@ alloc_sctp_ep(const struct _sctp_info *si) if(!si) return NULL; - if (!(ep = g_malloc(sizeof(sctp_ep_t)))) + if (!(ep = g_new(sctp_ep_t,1))) return NULL; COPY_ADDRESS(&ep->src,&si->ip_src); diff --git a/ui/cli/tap-sipstat.c b/ui/cli/tap-sipstat.c index f2dc0d5024..30783be982 100644 --- a/ui/cli/tap-sipstat.c +++ b/ui/cli/tap-sipstat.c @@ -160,8 +160,8 @@ sip_init_hash(sipstat_t *sp) /* Add all response codes */ for (i=0 ; vals_status_code[i].strptr ; i++) { - gint *key = g_malloc (sizeof(gint)); - sip_response_code_t *sc = g_malloc (sizeof(sip_response_code_t)); + gint *key = g_new (gint,1); + sip_response_code_t *sc = g_new (sip_response_code_t,1); *key = vals_status_code[i].value; sc->packets=0; sc->response_code = *key; @@ -218,7 +218,7 @@ sip_reset_hash_requests(gchar *key _U_ , sip_request_method_t *data, gpointer pt static void sipstat_reset(void *psp ) { - sipstat_t *sp=psp; + sipstat_t *sp=(sipstat_t *)psp; if (sp) { sp->packets = 0; sp->resent_packets = 0; @@ -238,7 +238,7 @@ sipstat_reset(void *psp ) static int 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; /* 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) { /* Responses */ - guint *key = g_malloc(sizeof(guint)); + guint *key = g_new(guint,1); sip_response_code_t *sc; /* Look up response code in hash table */ *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) { /* 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 */ - 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) { 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; /* 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) { /* 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->packets = 1; sc->sp = sp; @@ -365,7 +365,7 @@ sipstat_packet(void *psp, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const static void sipstat_draw(void *psp ) { - sipstat_t *sp=psp; + sipstat_t *sp=(sipstat_t *)psp; printf("\n"); printf("===================================================================\n"); if (sp->filter == NULL) @@ -398,7 +398,7 @@ sipstat_init(const char *optarg, void* userdata _U_) filter=NULL; } - sp = g_malloc( sizeof(sipstat_t) ); + sp = g_new(sipstat_t,1); if(filter){ sp->filter=g_strdup(filter); } else { diff --git a/ui/cli/tap-smbstat.c b/ui/cli/tap-smbstat.c index def34b89ea..99d65ddc23 100644 --- a/ui/cli/tap-smbstat.c +++ b/ui/cli/tap-smbstat.c @@ -51,7 +51,7 @@ static int smbstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const void *psi) { 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; timestat_t *sp=NULL; @@ -193,7 +193,7 @@ smbstat_init(const char *optarg,void* userdata _U_) filter=NULL; } - ss=g_malloc(sizeof(smbstat_t)); + ss=g_new(smbstat_t,1); if(filter){ ss->filter=g_strdup(filter); } else { diff --git a/ui/cli/tap-sv.c b/ui/cli/tap-sv.c index 6b54e8820b..8ef6acb0ff 100644 --- a/ui/cli/tap-sv.c +++ b/ui/cli/tap-sv.c @@ -39,7 +39,7 @@ static int sv_packet(void *prs _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const void *pri) { 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); |