diff options
author | Anders Broman <anders.broman@ericsson.com> | 2013-03-05 22:15:20 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2013-03-05 22:15:20 +0000 |
commit | b204e38aef8bf9905e8d3d1e44361ae77a8f0c3f (patch) | |
tree | b191b3f59b27d26b9f9fc82f64c8b4f8d756467c /ui/cli | |
parent | faa06129a916b6021faa22cc3eb0d6312e9e22a2 (diff) |
Use explicit casts.
svn path=/trunk/; revision=48108
Diffstat (limited to 'ui/cli')
-rw-r--r-- | ui/cli/tap-bootpstat.c | 14 | ||||
-rw-r--r-- | ui/cli/tap-camelcounter.c | 4 | ||||
-rw-r--r-- | ui/cli/tap-camelsrt.c | 4 | ||||
-rw-r--r-- | ui/cli/tap-comparestat.c | 22 |
4 files changed, 22 insertions, 22 deletions
diff --git a/ui/cli/tap-bootpstat.c b/ui/cli/tap-bootpstat.c index af1ed51f8a..2bdb2f3cd5 100644 --- a/ui/cli/tap-bootpstat.c +++ b/ui/cli/tap-bootpstat.c @@ -76,23 +76,23 @@ dhcp_draw_message_type(gchar *key _U_, dhcp_message_type_t *data, gchar * format static void dhcpstat_reset(void *psp) { - dhcpstat_t *sp=psp; + dhcpstat_t *sp=(dhcpstat_t *)psp; g_hash_table_foreach( sp->hash, (GHFunc)dhcp_reset_hash, NULL); } static int dhcpstat_packet(void *psp, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *pri) { - dhcpstat_t *sp=psp; - const bootp_info_value_t value=pri; + dhcpstat_t *sp=(dhcpstat_t *)psp; + const bootp_info_value_t value=(const bootp_info_value_t)pri; dhcp_message_type_t *sc; if (sp==NULL) return 0; - sc = g_hash_table_lookup( + sc = (dhcp_message_type_t *)g_hash_table_lookup( sp->hash, value); if (!sc) { - sc = g_malloc( sizeof(dhcp_message_type_t) ); + sc = g_new(dhcp_message_type_t,1); sc -> packets = 1; sc -> name = value; sc -> sp = sp; @@ -111,7 +111,7 @@ dhcpstat_packet(void *psp, packet_info *pinfo _U_, epan_dissect_t *edt _U_, cons static void dhcpstat_draw(void *psp) { - dhcpstat_t *sp=psp; + dhcpstat_t *sp=(dhcpstat_t *)psp; printf("\n"); printf("===================================================================\n"); @@ -146,7 +146,7 @@ dhcpstat_init(const char *optarg, void* userdata _U_) filter=NULL; } - sp = g_malloc( sizeof(dhcpstat_t) ); + sp = g_new(dhcpstat_t,1); sp->hash = g_hash_table_new( g_str_hash, g_str_equal); if(filter){ sp->filter=g_strdup(filter); diff --git a/ui/cli/tap-camelcounter.c b/ui/cli/tap-camelcounter.c index 600a351e0a..2d82d311cb 100644 --- a/ui/cli/tap-camelcounter.c +++ b/ui/cli/tap-camelcounter.c @@ -59,7 +59,7 @@ static int camelcounter_packet(void *phs, const void *phi) { struct camelcounter_t * p_counter =(struct camelcounter_t *)phs; - const struct camelsrt_info_t * pi=phi; + const struct camelsrt_info_t * pi=(const struct camelsrt_info_t *)phi; if (pi->opcode != 255) p_counter->camel_msg[pi->opcode]++; @@ -90,7 +90,7 @@ static void camelcounter_init(const char *optarg, void* userdata _U_) struct camelcounter_t *p_camelcounter; GString *error_string; - p_camelcounter = g_malloc(sizeof(struct camelcounter_t)); + p_camelcounter = g_new(struct camelcounter_t,1); if(!strncmp(optarg,"camel,counter,",13)){ p_camelcounter->filter=g_strdup(optarg+13); } else { diff --git a/ui/cli/tap-camelsrt.c b/ui/cli/tap-camelsrt.c index 2c0e19dda8..f241a72960 100644 --- a/ui/cli/tap-camelsrt.c +++ b/ui/cli/tap-camelsrt.c @@ -69,7 +69,7 @@ static int camelsrt_packet(void *phs, const void *phi) { struct camelsrt_t *hs=(struct camelsrt_t *)phs; - const struct camelsrt_info_t * pi=phi; + const struct camelsrt_info_t * pi=(const struct camelsrt_info_t *)phi; int i; for (i=0; i<NB_CAMELSRT_CATEGORY; i++) { @@ -204,7 +204,7 @@ static void camelsrt_init(const char *optarg, void* userdata _U_) struct camelsrt_t *p_camelsrt; GString *error_string; - p_camelsrt = g_malloc(sizeof(struct camelsrt_t)); + p_camelsrt = g_new(struct camelsrt_t,1); if(!strncmp(optarg,"camel,srt,",9)){ p_camelsrt->filter=g_strdup(optarg+9); } else { diff --git a/ui/cli/tap-comparestat.c b/ui/cli/tap-comparestat.c index 970854cdae..336e866b28 100644 --- a/ui/cli/tap-comparestat.c +++ b/ui/cli/tap-comparestat.c @@ -109,8 +109,8 @@ comparestat_reset(void *dummy _U_) static int comparestat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const void *arg2) { - comparestat_t *cs=arg; - const ws_ip *ci=arg2; + comparestat_t *cs=(comparestat_t *)arg; + const ws_ip *ci=(const ws_ip *)arg2; frame_info *fInfo; vec_t cksum_vec[3]; guint16 computed_cksum=0; @@ -167,7 +167,7 @@ call_foreach_count_ip_id(gpointer value, gpointer arg) pinfo->fd=(frame_data*)ep_alloc(sizeof(frame_data)); pinfo->fd->num = fInfo->num; - fInfoTemp=se_tree_lookup32(cs->ip_id_tree, fInfo->id); + fInfoTemp=(frame_info *)se_tree_lookup32(cs->ip_id_tree, fInfo->id); if(fInfoTemp==NULL){ /* Detect ongoing package loss */ if((cs->last_hit==FALSE)&&(cs->start_ongoing_hits>compare_start)&&(cs->stop_ongoing_hits<compare_stop)){ @@ -239,7 +239,7 @@ call_foreach_new_order(gpointer value, gpointer arg) frame_info *fInfo=(frame_info*)value, *fInfoTemp; /* overwrite Info column for new ordering */ - fInfoTemp=se_tree_lookup32(cs->nr_tree, fInfo->id); + fInfoTemp=(frame_info *)se_tree_lookup32(cs->nr_tree, fInfo->id); if(fInfoTemp==NULL){ if(TTL_method==FALSE){ if((ADDRESSES_EQUAL(&cs->eth_dst, &fInfo->dl_dst)) || (ADDRESSES_EQUAL(&cs->eth_src, &fInfo->dl_dst))){ @@ -314,7 +314,7 @@ call_foreach_merge_settings(gpointer value, gpointer arg) } if((fInfo->num==tot_packet_amount)&&(cs->stop_packet_nr_first==G_MAXINT32)&&(cs->start_packet_nr_first!=G_MAXINT32)){ - fInfoTemp=se_tree_lookup32(cs->packet_tree, cs->start_packet_nr_first); + fInfoTemp=(frame_info *)se_tree_lookup32(cs->packet_tree, cs->start_packet_nr_first); if(fInfoTemp==NULL){ printf("ERROR: start number not set correctly\n"); return FALSE; @@ -329,10 +329,10 @@ call_foreach_merge_settings(gpointer value, gpointer arg) if(cs->stop_packet_nr_first>cs->start_packet_nr_second){ cs->stop_packet_nr_first=cs->start_packet_nr_second-1; } - fInfoTemp=se_tree_lookup32(cs->packet_tree, cs->stop_packet_nr_first); + fInfoTemp=(frame_info *)se_tree_lookup32(cs->packet_tree, cs->stop_packet_nr_first); while((fInfoTemp!=NULL)?fmod(!fInfoTemp->zebra_time.nsecs, 2):TRUE){ cs->stop_packet_nr_first--; - fInfoTemp=se_tree_lookup32(cs->packet_tree, cs->stop_packet_nr_first); + fInfoTemp=(frame_info *)se_tree_lookup32(cs->packet_tree, cs->stop_packet_nr_first); } } else { /*this only happens if we have too many MAC's or TTL*/ @@ -340,10 +340,10 @@ call_foreach_merge_settings(gpointer value, gpointer arg) if(cs->stop_packet_nr_first>tot_packet_amount-cs->first_file_amount){ cs->stop_packet_nr_first=tot_packet_amount-cs->first_file_amount; } - fInfoTemp=se_tree_lookup32(cs->packet_tree, cs->stop_packet_nr_first); + fInfoTemp=(frame_info *)se_tree_lookup32(cs->packet_tree, cs->stop_packet_nr_first); while((fInfoTemp!=NULL)?fmod(fInfoTemp->zebra_time.nsecs, 2):TRUE){ cs->stop_packet_nr_first--; - fInfoTemp=se_tree_lookup32(cs->packet_tree, cs->stop_packet_nr_first); + fInfoTemp=(frame_info *)se_tree_lookup32(cs->packet_tree, cs->stop_packet_nr_first); } } /* set second stop location */ @@ -441,7 +441,7 @@ call_foreach_print_ip_tree(gpointer value, gpointer user_data) static void comparestat_draw(void *prs) { - comparestat_t *cs=prs; + comparestat_t *cs=(comparestat_t *)prs; GString *filter_str = g_string_new(""); const gchar *statis_string; guint32 first_file_amount, second_file_amount; @@ -529,7 +529,7 @@ comparestat_init(const char *optarg, void* userdata _U_) TTL_method=ttl; ON_method=order; - cs=g_malloc(sizeof(comparestat_t)); + cs=g_new(comparestat_t,1); nstime_set_unset(&cs->current_time); cs->ip_ttl_list=g_array_new(FALSE, FALSE, sizeof(guint8)); cs->last_hit=FALSE; |