Use explicit casts.

svn path=/trunk/; revision=48260
This commit is contained in:
Anders Broman 2013-03-12 06:41:00 +00:00
parent d0efafbcb1
commit 2cc00294c7
8 changed files with 111 additions and 111 deletions

View File

@ -146,7 +146,7 @@ static GHashTable* header_fields_hash = NULL;
static void
header_fields_update_cb(void *r, const char **err)
{
header_field_t *rec = r;
header_field_t *rec = (header_field_t *)r;
char c;
if (rec->header_name == NULL) {
@ -175,8 +175,8 @@ header_fields_update_cb(void *r, const char **err)
static void *
header_fields_copy_cb(void* n, const void* o, size_t siz _U_)
{
header_field_t* new_rec = n;
const header_field_t* old_rec = o;
header_field_t* new_rec = (header_field_t*)n;
const header_field_t* old_rec = (const header_field_t*)o;
if (old_rec->header_name) {
new_rec->header_name = g_strdup(old_rec->header_name);
@ -196,7 +196,7 @@ header_fields_copy_cb(void* n, const void* o, size_t siz _U_)
static void
header_fields_free_cb(void*r)
{
header_field_t* rec = r;
header_field_t* rec = (header_field_t*)r;
if (rec->header_name) g_free(rec->header_name);
if (rec->header_desc) g_free(rec->header_desc);
@ -391,7 +391,7 @@ http_reqs_stats_tree_init(stats_tree* st)
static int
http_reqs_stats_tree_packet(stats_tree* st, packet_info* pinfo, epan_dissect_t* edt _U_, const void* p)
{
const http_info_value_t* v = p;
const http_info_value_t* v = (const http_info_value_t*)p;
int reqs_by_this_host;
int reqs_by_this_addr;
int resps_by_this_addr;
@ -449,7 +449,7 @@ http_req_stats_tree_init(stats_tree* st)
static int
http_req_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_, epan_dissect_t* edt _U_, const void* p)
{
const http_info_value_t* v = p;
const http_info_value_t* v = (const http_info_value_t*)p;
int reqs_by_this_host;
if (v->request_method) {
@ -512,7 +512,7 @@ http_stats_tree_init(stats_tree* st)
static int
http_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_, epan_dissect_t* edt _U_, const void* p)
{
const http_info_value_t* v = p;
const http_info_value_t* v = (const http_info_value_t*)p;
guint i = v->response_code;
int resp_grp;
const gchar *resp_str;
@ -595,10 +595,10 @@ get_http_conversation_data(packet_info *pinfo)
/* Retrieve information from conversation
* or add it if it isn't there yet
*/
conv_data = conversation_get_proto_data(conversation, proto_http);
conv_data = (http_conv_t *)conversation_get_proto_data(conversation, proto_http);
if(!conv_data) {
/* Setup the conversation structure itself */
conv_data = wmem_alloc0(wmem_file_scope(), sizeof(http_conv_t));
conv_data = (http_conv_t *)wmem_alloc0(wmem_file_scope(), sizeof(http_conv_t));
conversation_add_proto_data(conversation, proto_http,
conv_data);
@ -613,7 +613,7 @@ get_http_conversation_data(packet_info *pinfo)
*/
static http_req_res_t* push_req_res(http_conv_t *conv_data)
{
http_req_res_t *req_res = wmem_alloc0(wmem_file_scope(), sizeof(http_req_res_t));
http_req_res_t *req_res = (http_req_res_t *)wmem_alloc0(wmem_file_scope(), sizeof(http_req_res_t));
nstime_set_unset(&(req_res->req_ts));
req_res->number = ++conv_data->req_res_num;
@ -744,7 +744,7 @@ dissect_http_message(tvbuff_t *tvb, int offset, packet_info *pinfo,
}
}
stat_info = ep_alloc(sizeof(http_info_value_t));
stat_info = ep_new(http_info_value_t);
stat_info->framenum = pinfo->fd->num;
stat_info->response_code = 0;
stat_info->request_method = NULL;
@ -1017,7 +1017,7 @@ dissect_http_message(tvbuff_t *tvb, int offset, packet_info *pinfo,
if (tree) {
proto_item *pi;
http_req_res_t *curr = p_get_proto_data(pinfo->fd, proto_http);
http_req_res_t *curr = (http_req_res_t *)p_get_proto_data(pinfo->fd, proto_http);
http_req_res_t *prev = curr ? curr->prev : NULL;
http_req_res_t *next = curr ? curr->next : NULL;
@ -1343,7 +1343,7 @@ dissect_http_message(tvbuff_t *tvb, int offset, packet_info *pinfo,
* an active listener to process it (which happens when
* the export object window is open). */
if(have_tap_listener(http_eo_tap)) {
eo_info = ep_alloc(sizeof(http_eo_t));
eo_info = ep_new(http_eo_t);
eo_info->hostname = conv_data->http_host;
eo_info->filename = conv_data->request_uri;
@ -1793,8 +1793,8 @@ chunked_encoding_dissector(tvbuff_t **tvb_ptr, packet_info *pinfo,
/* Dechunk the "chunked response" to a new memory buffer */
orig_datalen = datalen;
raw_data = g_malloc(datalen);
raw_len = 0;
raw_data = (guint8 *)g_malloc(datalen);
raw_len = 0;
chunks_decoded = 0;
chunked_data_size = 0;
@ -2261,10 +2261,10 @@ header_fields_initialize_cb(void)
if (num_header_fields) {
header_fields_hash = g_hash_table_new(g_str_hash, g_str_equal);
hf = g_malloc0(sizeof(hf_register_info) * num_header_fields);
hf = g_new0(hf_register_info, num_header_fields);
for (i = 0; i < num_header_fields; i++) {
hf_id = g_malloc(sizeof(gint));
hf_id = g_new(gint,1);
*hf_id = -1;
header_name = g_strdup(header_fields[i].header_name);

View File

@ -6928,7 +6928,7 @@ dissect_isup_generic_name_parameter(tvbuff_t *parameter_tvb, proto_tree *paramet
gint gen_name_length;
char *gen_name = NULL;
gen_name = ep_alloc(MAXGNAME + 1);
gen_name = (char *)ep_alloc(MAXGNAME + 1);
gen_name[0] = '\0';
gen_name_length = tvb_length(parameter_tvb) - 1;
indicator = tvb_get_guint8(parameter_tvb, 0);
@ -10737,7 +10737,7 @@ dissect_application_isup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint8 itu_isup_variant = ISUP_ITU_STANDARD_VARIANT; /* Default */
if(pinfo->private_data) {
content_type_parameter_str = ascii_strdown_inplace(pinfo->private_data);
content_type_parameter_str = ascii_strdown_inplace((gchar *)pinfo->private_data);
if(strstr(content_type_parameter_str,"ansi")) {
isup_standard = ANSI_STANDARD;
col_append_str(pinfo->cinfo, COL_PROTOCOL, "/ISUP(ANSI)");

View File

@ -145,7 +145,7 @@ dissect_json(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
static void before_object(void *tvbparse_data, const void *wanted_data _U_, tvbparse_elem_t *tok) {
json_parser_data_t *data = (json_parser_data_t *) tvbparse_data;
proto_tree *tree = ep_stack_peek(data->stack);
proto_tree *tree = (proto_tree *)ep_stack_peek(data->stack);
proto_tree *subtree;
proto_item *ti;
@ -164,7 +164,7 @@ static void after_object(void *tvbparse_data, const void *wanted_data _U_, tvbpa
static void before_member(void *tvbparse_data, const void *wanted_data _U_, tvbparse_elem_t *tok) {
json_parser_data_t *data = (json_parser_data_t *) tvbparse_data;
proto_tree *tree = ep_stack_peek(data->stack);
proto_tree *tree = (proto_tree *)ep_stack_peek(data->stack);
proto_tree *subtree;
proto_item *ti;
@ -177,7 +177,7 @@ static void before_member(void *tvbparse_data, const void *wanted_data _U_, tvbp
static void after_member(void *tvbparse_data, const void *wanted_data _U_, tvbparse_elem_t *tok) {
json_parser_data_t *data = (json_parser_data_t *) tvbparse_data;
proto_tree *tree = ep_stack_pop(data->stack);
proto_tree *tree = (proto_tree *)ep_stack_pop(data->stack);
if (tree) {
tvbparse_elem_t *key_tok = tok->sub;
@ -194,7 +194,7 @@ static void after_member(void *tvbparse_data, const void *wanted_data _U_, tvbpa
static void before_array(void *tvbparse_data, const void *wanted_data _U_, tvbparse_elem_t *tok) {
json_parser_data_t *data = (json_parser_data_t *) tvbparse_data;
proto_tree *tree = ep_stack_peek(data->stack);
proto_tree *tree = (proto_tree *)ep_stack_peek(data->stack);
proto_tree *subtree;
proto_item *ti;
@ -226,7 +226,7 @@ static void after_array(void *tvbparse_data, const void *wanted_data _U_, tvbpar
static char *json_string_unescape(tvbparse_elem_t *tok)
{
char *str = ep_alloc(tok->len - 1);
char *str = (char *)ep_alloc(tok->len - 1);
int i, j;
j = 0;
@ -350,7 +350,7 @@ static char *json_string_unescape(tvbparse_elem_t *tok)
static void after_value(void *tvbparse_data, const void *wanted_data _U_, tvbparse_elem_t *tok) {
json_parser_data_t *data = (json_parser_data_t *) tvbparse_data;
proto_tree *tree = ep_stack_peek(data->stack);
proto_tree *tree = (proto_tree *)ep_stack_peek(data->stack);
json_token_type_t value_id = JSON_TOKEN_INVALID;
if (tok->sub)

View File

@ -383,14 +383,14 @@ dissect_megaco_text(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (g_ascii_strncasecmp(word, "MEGACO", 6) != 0 && tvb_get_guint8(tvb, tvb_offset ) != '!'){
gint8 class;
gint8 ber_class;
gboolean pc;
gint32 tag;
dissector_handle_t handle = data_handle;
get_ber_identifier(tvb, 0, &class, &pc, &tag);
get_ber_identifier(tvb, 0, &ber_class, &pc, &tag);
if (class == BER_CLASS_UNI && pc && tag == BER_UNI_TAG_SEQUENCE ) {
if (ber_class == BER_CLASS_UNI && pc && tag == BER_UNI_TAG_SEQUENCE ) {
handle = h248_handle;
}
@ -1264,7 +1264,7 @@ nextcontext:
TermID[0] = 'e';
term->len = tokenlen;
term->str = (gchar*)(term->buffer = TermID);
term->str = (const gchar*)(term->buffer = TermID);
gcp_cmd_add_term(msg, trx, cmd, term, wild_term, keep_persistent_data);
@ -1277,7 +1277,7 @@ nextcontext:
case '*':
wild_term = GCP_WILDCARD_ALL;
term->len = 1;
term->buffer = (guint8*)(term->str = "*");
term->buffer = (const guint8*)(term->str = "*");
gcp_cmd_add_term(msg, trx, cmd, term, wild_term, keep_persistent_data);
@ -1309,7 +1309,7 @@ nextcontext:
tokenlen));
term->len = tokenlen;
term->buffer = (guint8*)(term->str = tvb_format_text(tvb, tvb_offset, tokenlen));
term->buffer = (const guint8*)(term->str = tvb_format_text(tvb, tvb_offset, tokenlen));
gcp_cmd_add_term(msg, trx, cmd, term, wild_term, keep_persistent_data);
@ -1760,7 +1760,7 @@ dissect_megaco_h245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *megaco_tree,
if(len<20480){
int i;
tvbuff_t *h245_tvb;
guint8 *buf = g_malloc(10240);
guint8 *buf = (guint8 *)g_malloc(10240);
/* first, skip to where the encoded pdu starts, this is
the first hex digit after the '=' char.
@ -1839,7 +1839,7 @@ dissect_megaco_h324_h223caprn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *meg
if(len<20480){
int i;
tvbuff_t *h245_tvb;
guint8 *buf = g_malloc(10240);
guint8 *buf = (guint8 *)g_malloc(10240);
/* first, skip to where the encoded pdu starts, this is
the first hex digit after the '=' char.

View File

@ -400,9 +400,9 @@ static guint16 evaluate_meta_item_dxt(proto_tree *meta_tree, tvbuff_t *tvb, pack
break;
case META_ID_AAL5PROTO:
aal5proto = tvb_get_guint8(tvb, offs);
p_sscop_info = p_get_proto_data(pinfo->fd, proto_sscop);
p_sscop_info = (sscop_payload_info *)p_get_proto_data(pinfo->fd, proto_sscop);
if (!p_sscop_info) {
p_sscop_info = se_alloc0(sizeof(sscop_payload_info));
p_sscop_info = se_new0(sscop_payload_info);
p_add_proto_data(pinfo->fd, proto_sscop, p_sscop_info);
}
switch (aal5proto) {

View File

@ -1562,7 +1562,7 @@ static void dissect_mgcp_firstline(tvbuff_t *tvb, packet_info *pinfo, proto_tree
matching conversation is available. */
mgcp_call_key.transid = mi->transid;
mgcp_call_key.conversation = conversation;
mgcp_call = g_hash_table_lookup(mgcp_calls, &mgcp_call_key);
mgcp_call = (mgcp_call_t *)g_hash_table_lookup(mgcp_calls, &mgcp_call_key);
if (mgcp_call)
{
/* Indicate the frame to which this is a reply. */
@ -1682,7 +1682,7 @@ static void dissect_mgcp_firstline(tvbuff_t *tvb, packet_info *pinfo, proto_tree
mgcp_call_key.conversation = conversation;
/* Look up the request */
mgcp_call = g_hash_table_lookup(mgcp_calls, &mgcp_call_key);
mgcp_call = (mgcp_call_t *)g_hash_table_lookup(mgcp_calls, &mgcp_call_key);
if (mgcp_call != NULL)
{
/* We've seen a request with this TRANSID, with the same
@ -1715,12 +1715,12 @@ static void dissect_mgcp_firstline(tvbuff_t *tvb, packet_info *pinfo, proto_tree
frame numbers are 1-origin, so we use 0
to mean "we don't yet know in which frame
the reply for this call appears". */
new_mgcp_call_key = se_alloc(sizeof(*new_mgcp_call_key));
*new_mgcp_call_key = mgcp_call_key;
mgcp_call = se_alloc(sizeof(*mgcp_call));
mgcp_call->req_num = pinfo->fd->num;
mgcp_call->rsp_num = 0;
mgcp_call->transid = mi->transid;
new_mgcp_call_key = (mgcp_call_info_key *)se_alloc(sizeof(*new_mgcp_call_key));
*new_mgcp_call_key = mgcp_call_key;
mgcp_call = (mgcp_call_t *)se_alloc(sizeof(*mgcp_call));
mgcp_call->req_num = pinfo->fd->num;
mgcp_call->rsp_num = 0;
mgcp_call->transid = mi->transid;
mgcp_call->responded = FALSE;
mgcp_call->req_time=pinfo->fd->abs_ts;
g_strlcpy(mgcp_call->code,mi->code,5);

View File

@ -1431,7 +1431,7 @@ main_cf_cb_file_closing(capture_file *cf)
* data structures, so it wouldn't be easy to use a progress bar,
* rather than, say, a progress spinner, here! */
if(cf->count > 10000) {
close_dlg = simple_dialog(ESD_TYPE_STOP, ESD_BTN_NONE,
close_dlg = (GtkWidget *)simple_dialog(ESD_TYPE_STOP, ESD_BTN_NONE,
"%sClosing file!%s\n\nPlease wait ...",
simple_dialog_primary_start(),
simple_dialog_primary_end());

View File

@ -208,31 +208,31 @@ build_conversation_filter(int action, gboolean show_dialog)
switch(pi->profinet_type) {
case(1):
buf = g_strdup_printf("(ip.src eq %s and ip.dst eq %s and cba.acco.dcom == 1) || (ip.src eq %s and ip.dst eq %s and cba.acco.dcom == 0)",
ip_to_str( pi->net_dst.data),
ip_to_str( pi->net_src.data),
ip_to_str( pi->net_src.data),
ip_to_str( pi->net_dst.data));
ip_to_str( (const guint8 *)pi->net_dst.data),
ip_to_str( (const guint8 *)pi->net_src.data),
ip_to_str( (const guint8 *)pi->net_src.data),
ip_to_str( (const guint8 *)pi->net_dst.data));
break;
case(2):
buf = g_strdup_printf("(ip.src eq %s and ip.dst eq %s and cba.acco.dcom == 1) || (ip.src eq %s and ip.dst eq %s and cba.acco.dcom == 0)",
ip_to_str( pi->net_src.data),
ip_to_str( pi->net_dst.data),
ip_to_str( pi->net_dst.data),
ip_to_str( pi->net_src.data));
ip_to_str( (const guint8 *)pi->net_src.data),
ip_to_str( (const guint8 *)pi->net_dst.data),
ip_to_str( (const guint8 *)pi->net_dst.data),
ip_to_str( (const guint8 *)pi->net_src.data));
break;
case(3):
buf = g_strdup_printf("(ip.src eq %s and ip.dst eq %s and cba.acco.srt == 1) || (ip.src eq %s and ip.dst eq %s and cba.acco.srt == 0)",
ip_to_str( pi->net_dst.data),
ip_to_str( pi->net_src.data),
ip_to_str( pi->net_src.data),
ip_to_str( pi->net_dst.data));
ip_to_str( (const guint8 *)pi->net_dst.data),
ip_to_str( (const guint8 *)pi->net_src.data),
ip_to_str( (const guint8 *)pi->net_src.data),
ip_to_str( (const guint8 *)pi->net_dst.data));
break;
case(4):
buf = g_strdup_printf("(ip.src eq %s and ip.dst eq %s and cba.acco.srt == 1) || (ip.src eq %s and ip.dst eq %s and cba.acco.srt == 0)",
ip_to_str( pi->net_src.data),
ip_to_str( pi->net_dst.data),
ip_to_str( pi->net_dst.data),
ip_to_str( pi->net_src.data));
ip_to_str( (const guint8 *)pi->net_src.data),
ip_to_str( (const guint8 *)pi->net_dst.data),
ip_to_str( (const guint8 *)pi->net_dst.data),
ip_to_str( (const guint8 *)pi->net_src.data));
break;
default:
return NULL;
@ -254,8 +254,8 @@ build_conversation_filter(int action, gboolean show_dialog)
if( pi->net_src.type == AT_IPv4 && pi->net_dst.type == AT_IPv4 ) {
/* TCP over IPv4 */
buf = g_strdup_printf("(ip.addr eq %s and ip.addr eq %s) and (tcp.port eq %d and tcp.port eq %d)",
ip_to_str( pi->net_src.data),
ip_to_str( pi->net_dst.data),
ip_to_str( (const guint8 *)pi->net_src.data),
ip_to_str( (const guint8 *)pi->net_dst.data),
pi->srcport, pi->destport );
} else if( pi->net_src.type == AT_IPv6 && pi->net_dst.type == AT_IPv6 ) {
/* TCP over IPv6 */
@ -280,8 +280,8 @@ build_conversation_filter(int action, gboolean show_dialog)
if( pi->net_src.type == AT_IPv4 && pi->net_dst.type == AT_IPv4 ) {
/* UDP over IPv4 */
buf = g_strdup_printf("(ip.addr eq %s and ip.addr eq %s) and (udp.port eq %d and udp.port eq %d)",
ip_to_str( pi->net_src.data),
ip_to_str( pi->net_dst.data),
ip_to_str( (const guint8 *)pi->net_src.data),
ip_to_str( (const guint8 *)pi->net_dst.data),
pi->srcport, pi->destport );
} else if( pi->net_src.type == AT_IPv6 && pi->net_dst.type == AT_IPv6 ) {
/* UDP over IPv6 */
@ -306,8 +306,8 @@ build_conversation_filter(int action, gboolean show_dialog)
if( pi->net_src.type == AT_IPv4 && pi->net_dst.type == AT_IPv4 ) {
/* IPv4 */
buf = g_strdup_printf("ip.addr eq %s and ip.addr eq %s",
ip_to_str( pi->net_src.data),
ip_to_str( pi->net_dst.data));
ip_to_str( (const guint8 *)pi->net_src.data),
ip_to_str( (const guint8 *)pi->net_dst.data));
} else if( pi->net_src.type == AT_IPv6 && pi->net_dst.type == AT_IPv6 ) {
/* IPv6 */
buf = g_strdup_printf("ipv6.addr eq %s and ipv6.addr eq %s",
@ -333,8 +333,8 @@ build_conversation_filter(int action, gboolean show_dialog)
if( pi->dl_src.type == AT_ETHER && pi->dl_dst.type == AT_ETHER ) {
/* Ethernet */
buf = g_strdup_printf("eth.addr eq %s and eth.addr eq %s",
ether_to_str( pi->dl_src.data),
ether_to_str( pi->dl_dst.data));
ether_to_str( (const guint8 *)pi->dl_src.data),
ether_to_str( (const guint8 *)pi->dl_dst.data));
} else {
return NULL;
}
@ -3195,7 +3195,7 @@ main_menu_new(GtkAccelGroup ** table)
static void
menu_dissector_filter_cb(GtkAction *action _U_, gpointer callback_data)
{
dissector_filter_t *filter_entry = callback_data;
dissector_filter_t *filter_entry = (dissector_filter_t *)callback_data;
GtkWidget *filter_te;
const char *buf;
@ -3218,7 +3218,7 @@ menu_dissector_filter_cb(GtkAction *action _U_, gpointer callback_data)
static gboolean
menu_dissector_filter_spe_cb(frame_data *fd _U_, epan_dissect_t *edt, gpointer callback_data)
{
dissector_filter_t *filter_entry = callback_data;
dissector_filter_t *filter_entry = (dissector_filter_t *)callback_data;
/* XXX - this gets the packet_info of the last dissected packet, */
/* which is not necessarily the last selected packet */
@ -3256,7 +3256,7 @@ menu_dissector_filter(capture_file *cf)
/* no items */
if (!list_entry){
action = g_object_new (GTK_TYPE_ACTION,
action = (GtkAction *)g_object_new (GTK_TYPE_ACTION,
"name", "filter-list-empty",
"label", "No filters",
"sensitive", FALSE,
@ -3276,10 +3276,10 @@ menu_dissector_filter(capture_file *cf)
}
while (list_entry != NULL) {
filter_entry = list_entry->data;
filter_entry = (dissector_filter_t *)list_entry->data;
action_name = g_strdup_printf ("filter-%u", i);
/*g_warning("action_name %s, filter_entry->name %s",action_name,filter_entry->name);*/
action = g_object_new (GTK_TYPE_ACTION,
action = (GtkAction *)g_object_new (GTK_TYPE_ACTION,
"name", action_name,
"label", filter_entry->name,
"sensitive", menu_dissector_filter_spe_cb(/* frame_data *fd _U_*/ NULL, cf->edt, filter_entry),
@ -3320,7 +3320,7 @@ menus_init(void)
packet_list_heading_action_group = gtk_action_group_new ("PacketListHeadingPopUpMenuActionGroup");
gtk_action_group_add_actions (packet_list_heading_action_group, /* the action group */
(gpointer)packet_list_heading_menu_popup_action_entries, /* an array of action descriptions */
packet_list_heading_menu_popup_action_entries, /* an array of action descriptions */
G_N_ELEMENTS(packet_list_heading_menu_popup_action_entries), /* the number of entries */
popup_menu_object); /* data to pass to the action callbacks */
@ -3647,14 +3647,14 @@ void register_lua_menu_bar_menu_items(
{
menu_item_t *menu_item_data;
menu_item_data = g_malloc0(sizeof (menu_item_t));
menu_item_data = g_new0(menu_item_t,1);
menu_item_data->gui_path = gui_path;
menu_item_data->name = name;
menu_item_data->label = label;
menu_item_data->stock_id = stock_id;
menu_item_data->accelerator = accelerator;
menu_item_data->tooltip = tooltip;
menu_item_data->callback = callback;
menu_item_data->callback = (GCallback)callback;
menu_item_data->callback_data = callback_data;
menu_item_data->enabled = enabled;
menu_item_data->selected_packet_enabled = selected_packet_enabled;
@ -3841,7 +3841,7 @@ make_menu_actions(const char *path, const menu_item_t *menu_item_data)
lbl = (char*)tok;
}
action = g_object_new (
action = (GtkAction *)g_object_new (
GTK_TYPE_ACTION,
"name", tok,
"label", lbl,
@ -3864,7 +3864,7 @@ make_menu_actions(const char *path, const menu_item_t *menu_item_data)
lbl = (char*)tok;
}
action = g_object_new (
action = (GtkAction *)g_object_new (
GTK_TYPE_ACTION,
"name", tok,
"label", lbl,
@ -3911,7 +3911,7 @@ merge_lua_menu_items(GList *lcl_merge_lua_menu_items_list)
gchar *xpath;
while (lcl_merge_lua_menu_items_list != NULL) {
menu_item_data = lcl_merge_lua_menu_items_list->data;
menu_item_data = (menu_item_t *)lcl_merge_lua_menu_items_list->data;
xpath = g_strdup_printf("%s/%s", menu_item_data->gui_path, menu_item_data->name);
xml = make_menu_xml(xpath);
@ -4025,7 +4025,7 @@ remove_present_file_name(GList *recent_files_list, const gchar *cf_name)
gchar *widget_cf_name;
for (li = g_list_first(recent_files_list); li; li = li->next) {
widget_cf_name = li->data;
widget_cf_name = (gchar *)li->data;
if (
#ifdef _WIN32
/* do a case insensitive compare on win32 */
@ -4062,7 +4062,7 @@ recent_changed_cb (GtkUIManager *ui_manager,
action_groups = gtk_ui_manager_get_action_groups (ui_manager);
for (l = action_groups; l != NULL; l = l->next)
{
GtkActionGroup *group = l->data;
GtkActionGroup *group = (GtkActionGroup *)l->data;
if (strcmp (gtk_action_group_get_name (group), "recent-files-group") == 0){
/* this unrefs the action group and all of its actions */
@ -4084,7 +4084,7 @@ recent_clear_cb(GtkAction *action _U_, gpointer user_data _U_)
/* Get the list of recent files, free the list and store the empty list with the widget */
submenu_recent_files = gtk_ui_manager_get_widget(ui_manager_main_menubar, MENU_RECENT_FILES_PATH);
recent_files_list = g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
recent_files_list = (GList *)g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
/* Free the name strings ?? */
g_list_free(recent_files_list);
recent_files_list = NULL;
@ -4114,7 +4114,7 @@ add_recent_items (guint merge_id, GtkUIManager *ui_manager)
if(!submenu_recent_files){
g_warning("add_recent_items: No submenu_recent_files found, path= MENU_RECENT_FILES_PATH");
}
items = g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
items = (GList *)g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
gtk_ui_manager_insert_action_group (ui_manager, action_group, 0);
g_object_set_data (G_OBJECT (ui_manager),
@ -4123,7 +4123,7 @@ add_recent_items (guint merge_id, GtkUIManager *ui_manager)
/* no items */
if (!items){
action = g_object_new (GTK_TYPE_ACTION,
action = (GtkAction *)g_object_new (GTK_TYPE_ACTION,
"name", "recent-info-empty",
"label", "No recently used files",
"sensitive", FALSE,
@ -4146,10 +4146,10 @@ add_recent_items (guint merge_id, GtkUIManager *ui_manager)
i < prefs.gui_recent_files_count_max && l != NULL;
i +=1, l = l->next)
{
gchar *item_name = l->data;
gchar *item_name = (gchar *)l->data;
action_name = g_strdup_printf ("recent-info-%u", i);
action = g_object_new (GTK_TYPE_ACTION,
action = (GtkAction *)g_object_new (GTK_TYPE_ACTION,
"name", action_name,
"label", item_name,
"stock_id", WIRESHARK_STOCK_SAVE,
@ -4183,7 +4183,7 @@ add_recent_items (guint merge_id, GtkUIManager *ui_manager)
FALSE);
/* Add a clear Icon */
action = g_object_new (GTK_TYPE_ACTION,
action = (GtkAction *)g_object_new (GTK_TYPE_ACTION,
"name", "clear-recent-info",
"label", "Clear the recent files list",
"stock_id", GTK_STOCK_CLEAR,
@ -4233,7 +4233,7 @@ add_tap_plugins (guint merge_id, GtkUIManager *ui_manager)
stats_tree_cfg *cfg = (stats_tree_cfg*)iter->data;
if (cfg->plugin) {
action_name = g_strdup_printf(MENU_STATISTICS_PATH "/%s", cfg->abbr);
action = g_object_new (GTK_TYPE_ACTION,
action = (GtkAction *)g_object_new (GTK_TYPE_ACTION,
"name", action_name,
"label", cfg->name,
NULL);
@ -4269,7 +4269,7 @@ menu_open_filename(gchar *cf_name)
if(!submenu_recent_files){
g_warning("menu_open_filename: No submenu_recent_files found, path= MENU_RECENT_FILES_PATH");
}
recent_files_list = g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
recent_files_list = (GList *)g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
/* XXX: ask user to remove item, it's maybe only a temporary problem */
/* open and read the capture file (this will close an existing file) */
if (cf_open(&cfile, cf_name, FALSE, &err) == CF_OK) {
@ -4304,7 +4304,7 @@ menu_open_recent_file_cmd(GtkAction *action)
cf_read(&cfile, FALSE);
} else {
submenu_recent_files = gtk_ui_manager_get_widget(ui_manager_main_menubar, MENU_RECENT_FILES_PATH);
recent_files_list = g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
recent_files_list = (GList *)g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
recent_files_list = remove_present_file_name(recent_files_list, cf_name);
g_object_set_data(G_OBJECT(submenu_recent_files), "recent-files-list", recent_files_list);
@ -4347,10 +4347,10 @@ add_menu_recent_capture_file_absolute(const gchar *cf_name)
g_free(normalized_cf_name);
return;
}
recent_files_list = g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
recent_files_list = (GList *)g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
cnt = 1;
for (li = g_list_first(recent_files_list); li; cnt++) {
widget_cf_name = li->data;
widget_cf_name = (gchar *)li->data;
/* Find the next element BEFORE we (possibly) free the current one below */
li = li->next;
@ -4415,10 +4415,10 @@ menu_recent_file_write_all(FILE *rf)
if(!submenu_recent_files){
g_warning("menu_recent_file_write_all: No submenu_recent_files found, path= MENU_RECENT_FILES_PATH");
}
recent_files_list = g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
recent_files_list = (GList *)g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
list = g_list_last(recent_files_list);
while (list != NULL) {
cf_name = list->data;
cf_name = (gchar *)list->data;
if (cf_name) {
if(u3_active())
fprintf (rf, RECENT_KEY_CAPTURE_FILE ": %s\n", u3_contract_device_path(cf_name));
@ -4437,7 +4437,7 @@ menu_recent_file_write_all(FILE *rf)
child = g_list_last(children);
while (child != NULL) {
/* get capture filename from the menu item label */
cf_name = g_object_get_data(G_OBJECT(child->data), MENU_RECENT_FILES_KEY);
cf_name = (gchar *)g_object_get_data(G_OBJECT(child->data), MENU_RECENT_FILES_KEY);
if (cf_name) {
if(u3_active())
fprintf (rf, RECENT_KEY_CAPTURE_FILE ": %s\n", u3_contract_device_path(cf_name));
@ -4967,7 +4967,7 @@ set_menus_for_selected_packet(capture_file *cf)
for (ii = ga->len - 1; ii > 0 ; ii -= 1) {
v = g_ptr_array_index (ga, ii);
v = (field_info *)g_ptr_array_index (ga, ii);
hfinfo = v->hfinfo;
if (!g_str_has_prefix(hfinfo->abbrev, "text") &&
@ -5090,7 +5090,7 @@ set_menus_for_selected_packet(capture_file *cf)
frame_selected && decode_as_ok());
if (properties) {
prev_abbrev = g_object_get_data(G_OBJECT(ui_manager_packet_list_menu), "menu_abbrev");
prev_abbrev = (char *)g_object_get_data(G_OBJECT(ui_manager_packet_list_menu), "menu_abbrev");
if (!prev_abbrev || (strcmp(prev_abbrev, abbrev) != 0)) {
/*No previous protocol or protocol changed - update Protocol Preferences menu*/
module_t *prefs_module_p = prefs_find_module(abbrev);
@ -5134,7 +5134,7 @@ set_menus_for_selected_packet(capture_file *cf)
dissector_filter_t *filter_entry;
gchar *path;
filter_entry = list_entry->data;
filter_entry = (dissector_filter_t *)list_entry->data;
path = g_strdup_printf("/Menubar/AnalyzeMenu/ConversationFilterMenu/Filters/filter-%u", i);
set_menu_sensitivity(ui_manager_main_menubar, path,
@ -5149,8 +5149,8 @@ set_menus_for_selected_packet(capture_file *cf)
static void
menu_prefs_toggle_bool (GtkWidget *w, gpointer data)
{
gboolean *value = data;
module_t *module = g_object_get_data (G_OBJECT(w), "module");
gboolean *value = (gboolean *)data;
module_t *module = (module_t *)g_object_get_data (G_OBJECT(w), "module");
module->prefs_changed = TRUE;
*value = !(*value);
@ -5165,8 +5165,8 @@ menu_prefs_toggle_bool (GtkWidget *w, gpointer data)
static void
menu_prefs_change_enum (GtkWidget *w, gpointer data)
{
gint *value = data;
module_t *module = g_object_get_data (G_OBJECT(w), "module");
gint *value = (gint *)data;
module_t *module = (module_t *)g_object_get_data (G_OBJECT(w), "module");
gint new_value = GPOINTER_TO_INT(g_object_get_data (G_OBJECT(w), "enumval"));
if (!gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM(w)))
@ -5194,9 +5194,9 @@ menu_prefs_reset(void)
static void
menu_prefs_change_ok (GtkWidget *w, gpointer parent_w)
{
GtkWidget *entry = g_object_get_data (G_OBJECT(w), "entry");
module_t *module = g_object_get_data (G_OBJECT(w), "module");
pref_t *pref = g_object_get_data (G_OBJECT(w), "pref");
GtkWidget *entry = (GtkWidget *)g_object_get_data (G_OBJECT(w), "entry");
module_t *module = (module_t *)g_object_get_data (G_OBJECT(w), "module");
pref_t *pref = (pref_t *)g_object_get_data (G_OBJECT(w), "pref");
const gchar *new_value = gtk_entry_get_text(GTK_ENTRY(entry));
range_t *newrange;
gchar *p;
@ -5265,8 +5265,8 @@ menu_prefs_change_cancel (GtkWidget *w _U_, gpointer parent_w)
static void
menu_prefs_edit_dlg (GtkWidget *w, gpointer data)
{
pref_t *pref = data;
module_t *module = g_object_get_data (G_OBJECT(w), "module");
pref_t *pref = (pref_t *)data;
module_t *module = (module_t *)g_object_get_data (G_OBJECT(w), "module");
gchar *value = NULL;
GtkWidget *win, *main_grid, *main_vb, *bbox, *cancel_bt, *ok_bt;
@ -5328,7 +5328,7 @@ menu_prefs_edit_dlg (GtkWidget *w, gpointer data)
bbox = dlg_button_row_new(GTK_STOCK_CANCEL,GTK_STOCK_OK, NULL);
gtk_box_pack_end(GTK_BOX(main_vb), bbox, FALSE, FALSE, 0);
ok_bt = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_OK);
ok_bt = (GtkWidget *)g_object_get_data(G_OBJECT(bbox), GTK_STOCK_OK);
g_object_set_data (G_OBJECT(ok_bt), "module", module);
g_object_set_data (G_OBJECT(ok_bt), "entry", entry);
g_object_set_data (G_OBJECT(ok_bt), "pref", pref);
@ -5336,7 +5336,7 @@ menu_prefs_edit_dlg (GtkWidget *w, gpointer data)
dlg_set_activate(entry, ok_bt);
cancel_bt = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_CANCEL);
cancel_bt = (GtkWidget *)g_object_get_data(G_OBJECT(bbox), GTK_STOCK_CANCEL);
g_signal_connect(cancel_bt, "clicked", G_CALLBACK(menu_prefs_change_cancel), win);
window_set_cancel_button(win, cancel_bt, NULL);
@ -5351,7 +5351,7 @@ add_protocol_prefs_generic_menu(pref_t *pref, gpointer data, GtkUIManager *ui_me
GtkWidget *menu_preferences;
GtkWidget *menu_item, *menu_sub_item, *sub_menu;
GSList *group = NULL;
module_t *module = data;
module_t *module = (module_t *)data;
const enum_val_t *enum_valp;
gchar *label = NULL;
@ -5682,7 +5682,7 @@ set_menus_for_selected_tree_row(capture_file *cf)
proto_can_match_selected(cf->finfo_selected, cf->edt));
set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/ViewMenu/ExpandSubtrees",
cf->finfo_selected->tree_type != -1);
prev_abbrev = g_object_get_data(G_OBJECT(ui_manager_tree_view_menu), "menu_abbrev");
prev_abbrev = (char *)g_object_get_data(G_OBJECT(ui_manager_tree_view_menu), "menu_abbrev");
if (!prev_abbrev || (strcmp (prev_abbrev, abbrev) != 0)) {
/* No previous protocol or protocol changed - update Protocol Preferences menu */
module_t *prefs_module_p = prefs_find_module(abbrev);