From beroset:

remove C++ incompatibilities 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48409
This commit is contained in:
Anders Broman 2013-03-18 22:38:56 +00:00
parent 60c7db1796
commit d8bd66c291
3 changed files with 23 additions and 23 deletions

View File

@ -807,7 +807,7 @@ airpcap_if_get_device_supported_channels_array(PAirpcapHandle ah, guint * pNumSu
if (numInfo == 0)
return NULL;
pSupportedChannels = g_malloc(numInfo * (sizeof *pSupportedChannels));
pSupportedChannels = (Dot11Channel *)g_malloc(numInfo * (sizeof *pSupportedChannels));
for (i = 0; i < numInfo; i++)
{
@ -1117,7 +1117,7 @@ airpcap_if_info_new(char *name, char *description)
ad = airpcap_if_open(name, ebuf);
if (ad)
{
if_info = g_malloc0(sizeof (airpcap_if_info_t));
if_info = (airpcap_if_info_t *)g_malloc0(sizeof (airpcap_if_info_t));
if_info->name = g_strdup(name);
if (description == NULL){
if_info->description = NULL;
@ -1167,7 +1167,7 @@ airpcap_driver_fake_if_info_new(void)
* Retrieve the first AirPcap adapter available. If no interface is found,
* it is not possible to retrieve the driver's settings, so return NULL.
*/
if_info = g_list_nth_data(airpcap_if_list,0);
if_info = (airpcap_if_info_t *)g_list_nth_data(airpcap_if_list,0);
if (if_info == NULL)
return NULL;
@ -1175,7 +1175,7 @@ airpcap_driver_fake_if_info_new(void)
ad = airpcap_if_open(if_info->name, ebuf);
if (ad)
{
fake_if_info = g_malloc(sizeof (airpcap_if_info_t));
fake_if_info = (airpcap_if_info_t *)g_malloc(sizeof (airpcap_if_info_t));
fake_if_info->name = g_strdup(if_info->name);
fake_if_info->description = g_strdup(if_info->description);
fake_if_info->loopback = FALSE;
@ -1341,7 +1341,7 @@ airpcap_if_save_driver_keys(PAirpcapHandle ad, airpcap_if_info_t *if_info)
static void
free_airpcap_if_cb(gpointer data, gpointer user_data _U_)
{
airpcap_if_info_t *if_info = data;
airpcap_if_info_t *if_info = (airpcap_if_info_t *)data;
if (NULL == if_info)
return;
@ -1528,7 +1528,7 @@ airpcap_if_clear_decryption_settings(airpcap_if_info_t* info_if)
info_if->keysCollectionSize = 0;
info_if->DecryptionOn = FALSE;
info_if->DecryptionOn = AIRPCAP_DECRYPTION_OFF;
info_if->saved = FALSE;
}
}
@ -2414,7 +2414,7 @@ set_airpcap_decryption(gboolean on_off)
ad = airpcap_if_open(curr_if->name, ebuf);
if (ad)
{
curr_if->DecryptionOn = (gboolean)AIRPCAP_DECRYPTION_OFF;
curr_if->DecryptionOn = AIRPCAP_DECRYPTION_OFF;
airpcap_if_set_decryption_state(ad,curr_if->DecryptionOn);
/* Save configuration for the curr_if */
if (!airpcap_if_store_cur_config_as_adapter_default(ad))

View File

@ -131,7 +131,7 @@ dissect_reload_framing_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst,
pinfo->ptype, pinfo->srcport, pinfo->destport, 0);
if (conversation)
reload_framing_info = conversation_get_proto_data(conversation, proto_reload_framing);
reload_framing_info = (reload_conv_info_t *)conversation_get_proto_data(conversation, proto_reload_framing);
/* Get the type
* http://tools.ietf.org/html/draft-ietf-p2psip-base-12
@ -186,14 +186,14 @@ dissect_reload_framing_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
transaction_id_key[1].length = 1;
transaction_id_key[1].key = &pinfo->srcport;
transaction_id_key[2].length = (pinfo->src.len) / (guint)sizeof(guint32);
transaction_id_key[2].key = g_malloc(pinfo->src.len);
transaction_id_key[2].key = (guint32 *)g_malloc(pinfo->src.len);
memcpy(transaction_id_key[2].key, pinfo->src.data, pinfo->src.len);
}
else {
transaction_id_key[1].length = 1;
transaction_id_key[1].key = &pinfo->destport;
transaction_id_key[2].length = (pinfo->dst.len) / (guint)sizeof(guint32);
transaction_id_key[2].key = g_malloc(pinfo->dst.len);
transaction_id_key[2].key = (guint32 *)g_malloc(pinfo->dst.len);
memcpy(transaction_id_key[2].key, pinfo->dst.data, pinfo->dst.len);
}
transaction_id_key[3].length=0;
@ -215,18 +215,18 @@ dissect_reload_framing_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
/* No. Attach that information to the conversation, and add
* it to the list of information structures.
*/
reload_framing_info = se_alloc(sizeof(reload_conv_info_t));
reload_framing_info = se_new(reload_conv_info_t);
reload_framing_info->transaction_pdus = se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK,
"reload_framing_transaction_pdus");
conversation_add_proto_data(conversation, proto_reload_framing, reload_framing_info);
}
if (!pinfo->fd->flags.visited) {
if ((reload_frame =
if ((reload_frame = (reload_frame_t *)
se_tree_lookup32_array(reload_framing_info->transaction_pdus, transaction_id_key)) == NULL) {
transaction_id_key[2].key = key_save;
transaction_id_key[2].length = len_save;
reload_frame = se_alloc(sizeof(reload_frame_t));
reload_frame = se_new(reload_frame_t);
reload_frame->data_frame = 0;
reload_frame->ack_frame = 0;
reload_frame->req_time = pinfo->fd->abs_ts;
@ -251,7 +251,7 @@ dissect_reload_framing_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
}
}
else {
reload_frame=se_tree_lookup32_array(reload_framing_info->transaction_pdus, transaction_id_key);
reload_frame=(reload_frame_t *)se_tree_lookup32_array(reload_framing_info->transaction_pdus, transaction_id_key);
transaction_id_key[2].key = key_save;
transaction_id_key[2].length = len_save;
}
@ -259,7 +259,7 @@ dissect_reload_framing_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (!reload_frame) {
/* create a "fake" pana_trans structure */
reload_frame = ep_alloc(sizeof(reload_frame_t));
reload_frame = ep_new(reload_frame_t);
reload_frame->data_frame = (type==DATA) ? pinfo->fd->num : 0;
reload_frame->ack_frame = (type!=DATA) ? pinfo->fd->num : 0;
reload_frame->req_time = pinfo->fd->abs_ts;

View File

@ -345,9 +345,9 @@ static gint fill_tpncp_id_vals(value_string string[], FILE *file) {
gint i = 0, tpncp_id = 0;
gchar *tpncp_name = NULL, *line_in_file = NULL;
line_in_file = ep_alloc(MAX_TPNCP_DB_ENTRY_LEN);
line_in_file = (gchar *)ep_alloc(MAX_TPNCP_DB_ENTRY_LEN);
line_in_file[0] = 0;
tpncp_name = ep_alloc(MAX_TPNCP_DB_ENTRY_LEN);
tpncp_name = (gchar *)ep_alloc(MAX_TPNCP_DB_ENTRY_LEN);
tpncp_name[0] = 0;
while (fgets(line_in_file, MAX_TPNCP_DB_ENTRY_LEN, file) != NULL) {
@ -377,13 +377,13 @@ static gint fill_enums_id_vals(FILE *file) {
gchar *line_in_file = NULL, *enum_name = NULL,
*enum_type = NULL, *enum_str = NULL;
line_in_file = ep_alloc(MAX_TPNCP_DB_ENTRY_LEN);
line_in_file = (gchar *)ep_alloc(MAX_TPNCP_DB_ENTRY_LEN);
line_in_file[0] = 0;
enum_name = ep_alloc(MAX_TPNCP_DB_ENTRY_LEN);
enum_name = (gchar *)ep_alloc(MAX_TPNCP_DB_ENTRY_LEN);
enum_name[0] = 0;
enum_type = ep_alloc(MAX_TPNCP_DB_ENTRY_LEN);
enum_type = (gchar *)ep_alloc(MAX_TPNCP_DB_ENTRY_LEN);
enum_type[0] = 0;
enum_str = ep_alloc(MAX_TPNCP_DB_ENTRY_LEN);
enum_str = (gchar *)ep_alloc(MAX_TPNCP_DB_ENTRY_LEN);
enum_str[0] = 0;
while (fgets(line_in_file, MAX_TPNCP_DB_ENTRY_LEN, file) != NULL) {
@ -572,11 +572,11 @@ static gint init_tpncp_data_fields_info(tpncp_data_field_info *data_fields_info,
}
};
tpncp_db_entry = ep_alloc(MAX_TPNCP_DB_ENTRY_LEN);
tpncp_db_entry = (gchar *)ep_alloc(MAX_TPNCP_DB_ENTRY_LEN);
tpncp_db_entry[0] = 0;
/* Register common fields of hf_register_info struture. */
hf_entr.hfinfo.type = 0;
hf_entr.hfinfo.type = FT_NONE;
hf_entr.hfinfo.strings = NULL;
hf_entr.hfinfo.bitmask = 0x0;
hf_entr.hfinfo.blurb = NULL;