From 78ff68d4b58f3887139b2d1fd6fec5c8d2658aa7 Mon Sep 17 00:00:00 2001 From: Ulf Lamping Date: Sat, 25 Dec 2004 13:49:30 +0000 Subject: a lot of warnings removed, most of them about pointer to int casts without using the appropriate GLib macros svn path=/trunk/; revision=12832 --- epan/dissectors/packet-aim-oft.c | 4 +- epan/dissectors/packet-aim-signon.c | 2 +- epan/dissectors/packet-aoe.c | 8 ++-- epan/dissectors/packet-cmip.c | 17 ++++++--- epan/dissectors/packet-cmp.c | 10 +++-- epan/dissectors/packet-dcerpc-spoolss.c | 30 +++++++-------- epan/dissectors/packet-http.c | 2 +- epan/dissectors/packet-ipdc.c | 2 +- epan/dissectors/packet-ipmi.c | 64 +++++++++++++------------------- epan/dissectors/packet-ipsec.c | 2 +- epan/dissectors/packet-llc.c | 4 +- epan/dissectors/packet-mtp3.c | 2 +- epan/dissectors/packet-nfs.c | 24 ++++++------ epan/dissectors/packet-nlm.c | 22 +++++------ epan/dissectors/packet-portmap.c | 2 +- epan/dissectors/packet-rpc.c | 4 +- epan/dissectors/packet-rtsp.c | 2 +- epan/dissectors/packet-sigcomp.c | 2 +- epan/dissectors/packet-sip.c | 4 +- epan/dissectors/packet-smb-sidsnooping.c | 14 +++---- epan/dissectors/packet-smb.c | 48 ++++++++++++------------ epan/dissectors/packet-tcp.c | 26 ++++++------- epan/dissectors/packet-tds.c | 4 +- epan/dissectors/packet-x11.c | 20 +++++----- 24 files changed, 157 insertions(+), 162 deletions(-) (limited to 'epan/dissectors') diff --git a/epan/dissectors/packet-aim-oft.c b/epan/dissectors/packet-aim-oft.c index eabdb1e942..b196d32fef 100644 --- a/epan/dissectors/packet-aim-oft.c +++ b/epan/dissectors/packet-aim-oft.c @@ -44,8 +44,8 @@ static int proto_aim_oft = -1; -static int ett_aim_recvfile = -1; -static int ett_aim_sendfile = -1; +/*static int ett_aim_recvfile = -1; +static int ett_aim_sendfile = -1;*/ /* * cookie (8 chars) diff --git a/epan/dissectors/packet-aim-signon.c b/epan/dissectors/packet-aim-signon.c index 392ddaf36f..f36cded5dc 100644 --- a/epan/dissectors/packet-aim-signon.c +++ b/epan/dissectors/packet-aim-signon.c @@ -121,7 +121,7 @@ static int dissect_aim_snac_signon_signon_reply(tvbuff_t *tvb, return offset; } -static int dissect_aim_tlv_value_registration(proto_item *ti _U_, guint16 value_id _U_, tvbuff_t *tvb _U_, packet_info *pinfo) +static int dissect_aim_tlv_value_registration(proto_item *ti _U_, guint16 value_id _U_, tvbuff_t *tvb _U_, packet_info *pinfo _U_) { /* FIXME */ return 0; diff --git a/epan/dissectors/packet-aoe.c b/epan/dissectors/packet-aoe.c index a01a024cc1..4fdb9e4d3a 100644 --- a/epan/dissectors/packet-aoe.c +++ b/epan/dissectors/packet-aoe.c @@ -190,7 +190,7 @@ static GHashTable *ata_cmd_matched; static guint ata_cmd_hash_matched(gconstpointer k) { - return (guint)k; + return GPOINTER_TO_UINT(k); } static gint @@ -267,12 +267,12 @@ dissect_ata_pdu(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, if(ata_info){ ata_info->response_frame=pinfo->fd->num; g_hash_table_remove(ata_cmd_unmatched, ata_info); - g_hash_table_insert(ata_cmd_matched, (void *)ata_info->request_frame, ata_info); - g_hash_table_insert(ata_cmd_matched, (void *)ata_info->response_frame, ata_info); + g_hash_table_insert(ata_cmd_matched, GUINT_TO_POINTER(ata_info->request_frame), ata_info); + g_hash_table_insert(ata_cmd_matched, GUINT_TO_POINTER(ata_info->response_frame), ata_info); } } } else { - ata_info=g_hash_table_lookup(ata_cmd_matched, (void *)pinfo->fd->num); + ata_info=g_hash_table_lookup(ata_cmd_matched, GUINT_TO_POINTER(pinfo->fd->num)); } if(ata_info){ diff --git a/epan/dissectors/packet-cmip.c b/epan/dissectors/packet-cmip.c index 93ce093f7e..6d06fd4682 100644 --- a/epan/dissectors/packet-cmip.c +++ b/epan/dissectors/packet-cmip.c @@ -303,10 +303,12 @@ static int dissect_filter(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, i } static int dissect_and_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { return dissect_cmip_CMISFilter(FALSE, tvb, offset, pinfo, tree, hf_cmip_and_item); -} +} +#if 0 static int dissect_or_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { return dissect_cmip_CMISFilter(FALSE, tvb, offset, pinfo, tree, hf_cmip_or_item); -} +} +#endif static int dissect_not(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { return dissect_cmip_CMISFilter(FALSE, tvb, offset, pinfo, tree, hf_cmip_not); } @@ -1848,14 +1850,16 @@ static const ber_sequence_t BaseManagedObjectId_sequence[] = { { BER_CLASS_CON, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_baseManagedObjectInstance }, { 0, 0, 0, NULL } }; - + +#if 0 static int dissect_cmip_BaseManagedObjectId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, BaseManagedObjectId_sequence, hf_index, ett_cmip_BaseManagedObjectId); return offset; -} +} +#endif static const ber_sequence_t SET_OF_AttributeId_set_of[1] = { { BER_CLASS_CON, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_attributeIdList_item }, @@ -2281,13 +2285,14 @@ static const value_string RejectProblem_vals[] = { { 0, NULL } }; - +#if 0 static int dissect_cmip_RejectProblem(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL); return offset; -} +} +#endif static const value_string RejectProb_vals[] = { diff --git a/epan/dissectors/packet-cmp.c b/epan/dissectors/packet-cmp.c index 80c8dac665..2db510befb 100644 --- a/epan/dissectors/packet-cmp.c +++ b/epan/dissectors/packet-cmp.c @@ -268,9 +268,11 @@ static int dissect_hashAlg(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, static int dissect_certId(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { return dissect_crmf_CertId(FALSE, tvb, offset, pinfo, tree, hf_cmp_certId); } +#if 0 static int dissect_caPubs_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { return dissect_pkix1explicit_Certificate(FALSE, tvb, offset, pinfo, tree, hf_cmp_caPubs_item); -} +} +#endif static int dissect_privateKey(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { return dissect_crmf_EncryptedValue(FALSE, tvb, offset, pinfo, tree, hf_cmp_privateKey); } @@ -285,10 +287,12 @@ static int dissect_encryptedCert(packet_info *pinfo, proto_tree *tree, tvbuff_t } static int dissect_newSigCert(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { return dissect_pkix1explicit_Certificate(FALSE, tvb, offset, pinfo, tree, hf_cmp_newSigCert); -} +} +#if 0 static int dissect_caCerts_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { return dissect_pkix1explicit_Certificate(FALSE, tvb, offset, pinfo, tree, hf_cmp_caCerts_item); -} +} +#endif static int dissect_certDetails(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { return dissect_crmf_CertTemplate(FALSE, tvb, offset, pinfo, tree, hf_cmp_certDetails); } diff --git a/epan/dissectors/packet-dcerpc-spoolss.c b/epan/dissectors/packet-dcerpc-spoolss.c index d6ebd7545e..a50ded5bb6 100644 --- a/epan/dissectors/packet-dcerpc-spoolss.c +++ b/epan/dissectors/packet-dcerpc-spoolss.c @@ -3256,7 +3256,7 @@ static int SpoolssGetPrinter_q(tvbuff_t *tvb, int offset, packet_info *pinfo, if (check_col(pinfo->cinfo, COL_INFO)) col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level); - dcv->private_data = (void *)level; + dcv->private_data = GUINT_TO_POINTER(level); offset = dissect_spoolss_buffer( tvb, offset, pinfo, tree, drep, NULL); @@ -3275,7 +3275,7 @@ static int SpoolssGetPrinter_r(tvbuff_t *tvb, int offset, packet_info *pinfo, dcerpc_info *di = (dcerpc_info *)pinfo->private_data; dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data; BUFFER buffer; - gint16 level = (guint32)dcv->private_data; + gint16 level = GPOINTER_TO_INT(dcv->private_data); proto_item *item; proto_tree *subtree = NULL; @@ -3601,7 +3601,7 @@ static int SpoolssEnumForms_q(tvbuff_t *tvb, int offset, packet_info *pinfo, offset = dissect_ndr_uint32( tvb, offset, pinfo, tree, drep, hf_level, &level); - dcv->private_data = (void *)level; + dcv->private_data = GUINT_TO_POINTER(level); if (check_col(pinfo->cinfo, COL_INFO)) col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level); @@ -3621,7 +3621,7 @@ static int SpoolssEnumForms_r(tvbuff_t *tvb, int offset, packet_info *pinfo, dcerpc_info *di = (dcerpc_info *)pinfo->private_data; dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data; BUFFER buffer; - guint32 level = (guint32)dcv->private_data, i, count; + guint32 level = GPOINTER_TO_UINT(dcv->private_data), i, count; int buffer_offset; proto_tree_add_uint_hidden( @@ -4127,7 +4127,7 @@ static int SpoolssAddForm_q(tvbuff_t *tvb, int offset, packet_info *pinfo, /* Store info level to match with reply packet */ - dcv->private_data = (void *)level; + dcv->private_data = GUINT_TO_POINTER(level); offset = dissect_FORM_CTR(tvb, offset, pinfo, tree, drep); @@ -4276,7 +4276,7 @@ static int SpoolssGetForm_q(tvbuff_t *tvb, int offset, packet_info *pinfo, offset = dissect_ndr_uint32( tvb, offset, pinfo, tree, drep, hf_form_level, &level); - dcv->private_data = (void *)level; + dcv->private_data = GUINT_TO_POINTER(level); if (check_col(pinfo->cinfo, COL_INFO)) col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", @@ -4296,7 +4296,7 @@ static int SpoolssGetForm_r(tvbuff_t *tvb, int offset, packet_info *pinfo, dcerpc_info *di = (dcerpc_info *)pinfo->private_data; dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data; BUFFER buffer; - guint32 level = (guint32)dcv->private_data; + guint32 level = GPOINTER_TO_UINT(dcv->private_data); proto_tree_add_uint_hidden( tree, hf_form, tvb, offset, 0, 1); @@ -4575,7 +4575,7 @@ static int SpoolssEnumJobs_q(tvbuff_t *tvb, int offset, packet_info *pinfo, offset = dissect_ndr_uint32( tvb, offset, pinfo, tree, drep, hf_level, &level); - dcv->private_data = (void *)level; + dcv->private_data = GUINT_TO_POINTER(level); if (check_col(pinfo->cinfo, COL_INFO)) col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level); @@ -4593,7 +4593,7 @@ static int SpoolssEnumJobs_r(tvbuff_t *tvb, int offset, packet_info *pinfo, { dcerpc_info *di = (dcerpc_info *)pinfo->private_data; dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data; - gint16 level = (guint32)dcv->private_data; + gint16 level = GPOINTER_TO_UINT(dcv->private_data); BUFFER buffer; guint32 num_jobs, i; int buffer_offset; @@ -4717,7 +4717,7 @@ static int SpoolssGetJob_q(tvbuff_t *tvb, int offset, packet_info *pinfo, offset = dissect_ndr_uint32( tvb, offset, pinfo, tree, drep, hf_level, &level); - dcv->private_data = (void *)level; + dcv->private_data = GUINT_TO_POINTER(level); if (check_col(pinfo->cinfo, COL_INFO)) col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d, jobid %d", @@ -4736,7 +4736,7 @@ static int SpoolssGetJob_r(tvbuff_t *tvb, int offset, packet_info *pinfo, { dcerpc_info *di = (dcerpc_info *)pinfo->private_data; dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data; - gint32 level = (guint32)dcv->private_data; + gint32 level = GPOINTER_TO_UINT(dcv->private_data); BUFFER buffer; /* Parse packet */ @@ -5287,7 +5287,7 @@ static int SpoolssEnumPrinterDrivers_q(tvbuff_t *tvb, int offset, offset = dissect_ndr_uint32( tvb, offset, pinfo, tree, drep, hf_level, &level); - dcv->private_data = (void *)level; + dcv->private_data = GUINT_TO_POINTER(level); if (check_col(pinfo->cinfo, COL_INFO)) col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level); @@ -5306,7 +5306,7 @@ static int SpoolssEnumPrinterDrivers_r(tvbuff_t *tvb, int offset, { dcerpc_info *di = (dcerpc_info *)pinfo->private_data; dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data; - guint32 level = (guint32)dcv->private_data, num_drivers, i; + guint32 level = GPOINTER_TO_UINT(dcv->private_data), num_drivers, i; int buffer_offset; BUFFER buffer; @@ -5385,7 +5385,7 @@ static int SpoolssGetPrinterDriver2_q(tvbuff_t *tvb, int offset, offset = dissect_ndr_uint32( tvb, offset, pinfo, tree, drep, hf_level, &level); - dcv->private_data = (void *)level; + dcv->private_data = GUINT_TO_POINTER(level); if (check_col(pinfo->cinfo, COL_INFO)) col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level); @@ -5410,7 +5410,7 @@ static int SpoolssGetPrinterDriver2_r(tvbuff_t *tvb, int offset, { dcerpc_info *di = (dcerpc_info *)pinfo->private_data; dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data; - guint32 level = (guint32)dcv->private_data; + guint32 level = GPOINTER_TO_UINT(dcv->private_data); BUFFER buffer; /* Parse packet */ diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c index 883d86b81b..7b3c7708a9 100644 --- a/epan/dissectors/packet-http.c +++ b/epan/dissectors/packet-http.c @@ -270,7 +270,7 @@ dissect_http_message(tvbuff_t *tvb, int offset, packet_info *pinfo, int colon_offset; headers_t headers; int datalen; - int reported_datalen; + int reported_datalen = -1; dissector_handle_t handle; gboolean dissected; diff --git a/epan/dissectors/packet-ipdc.c b/epan/dissectors/packet-ipdc.c index 3117e3f1eb..4fbd1c76f8 100644 --- a/epan/dissectors/packet-ipdc.c +++ b/epan/dissectors/packet-ipdc.c @@ -88,7 +88,7 @@ dissect_ipdc_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) tvbuff_t *q931_tvb; char *des; - char *enum_val; + char *enum_val = ""; char *tmp_str; char tmp_tag_text[IPDC_STR_LEN + 1]; const value_string *val_ptr; diff --git a/epan/dissectors/packet-ipmi.c b/epan/dissectors/packet-ipmi.c index cc23326ffa..616b7b8e58 100644 --- a/epan/dissectors/packet-ipmi.c +++ b/epan/dissectors/packet-ipmi.c @@ -1944,9 +1944,7 @@ dissect_cmd_Set_Sensor_Thresholds(proto_tree *tree, proto_tree *ipmi_tree, packe if (tree) { proto_tree_add_item(ipmi_tree, hf_SetSensorThresholds_datafield_SensorNumber, tvb, (*poffset)++, 1, TRUE); - } - /* Control Byte */ - if (tree) { + /* Control Byte */ ControlByte = tvb_get_guint8(tvb, authtype ? 33 : 17) ; tf = proto_tree_add_text(ipmi_tree, tvb, *poffset, 1, "Control Byte: %s0x%02x", " ", ControlByte); @@ -1967,39 +1965,33 @@ dissect_cmd_Set_Sensor_Thresholds(proto_tree *tree, proto_tree *ipmi_tree, packe proto_tree_add_item(field_tree, hf_SetSensorThresholds_datafield_ControlByte_Bit0, tvb, *poffset, 1, TRUE); (*poffset)++; - } - /* lower non-critical threshold */ - if (tree) { + + /* lower non-critical threshold */ if(ControlByte&0x01) proto_tree_add_item(ipmi_tree, hf_SetSensorThresholds_datafield_LowerNonCriticalThreshold, tvb, (*poffset)++, 1, TRUE); - } - /* lower critical threshold */ - if (tree) { + + /* lower critical threshold */ if(ControlByte&0x02) proto_tree_add_item(ipmi_tree, hf_SetSensorThresholds_datafield_LowerCriticalThreshold, tvb, (*poffset)++, 1, TRUE); - } - /* lower non-recoverable threshold */ - if (tree) { + + /* lower non-recoverable threshold */ if(ControlByte&0x04) proto_tree_add_item(ipmi_tree, hf_SetSensorThresholds_datafield_LowerNonRecoverableThreshold, tvb, (*poffset)++, 1, TRUE); - } - /* upper non-critical threshold */ - if (tree) { + + /* upper non-critical threshold */ if(ControlByte&0x08) proto_tree_add_item(ipmi_tree, hf_SetSensorThresholds_datafield_UpperNonCriticalThreshold, tvb, (*poffset)++, 1, TRUE); - } - /* upper critical threshold value */ - if (tree) { + + /* upper critical threshold value */ if(ControlByte&0x10) proto_tree_add_item(ipmi_tree, hf_SetSensorThresholds_datafield_UpperCriticalThreshold, tvb, (*poffset)++, 1, TRUE); - } - /* upper non-recoverable threshold value */ - if (tree) { + + /* upper non-recoverable threshold value */ if(ControlByte&0x20) proto_tree_add_item(ipmi_tree, hf_SetSensorThresholds_datafield_UpperNonRecoverableThreshold, tvb, (*poffset)++, 1, TRUE); @@ -2041,39 +2033,33 @@ dissect_cmd_Get_Sensor_Thresholds(proto_tree *tree, proto_tree *ipmi_tree, packe proto_tree_add_item(field_tree, hf_GetSensorThresholds_datafield_ControlByte_Bit0, tvb, *poffset, 1, TRUE); (*poffset)++; - } - /* lower non-critical threshold */ - if (tree) { + + /* lower non-critical threshold */ if(ControlByte&0x01) proto_tree_add_item(ipmi_tree, hf_GetSensorThresholds_datafield_LowerNonCriticalThreshold, tvb, (*poffset)++, 1, TRUE); - } - /* lower critical threshold */ - if (tree) { + + /* lower critical threshold */ if(ControlByte&0x02) proto_tree_add_item(ipmi_tree, hf_GetSensorThresholds_datafield_LowerCriticalThreshold, tvb, (*poffset)++, 1, TRUE); - } - /* lower non-recoverable threshold */ - if (tree) { + + /* lower non-recoverable threshold */ if(ControlByte&0x04) proto_tree_add_item(ipmi_tree, hf_GetSensorThresholds_datafield_LowerNonRecoverableThreshold, tvb, (*poffset)++, 1, TRUE); - } - /* upper non-critical threshold */ - if (tree) { + + /* upper non-critical threshold */ if(ControlByte&0x08) proto_tree_add_item(ipmi_tree, hf_GetSensorThresholds_datafield_UpperNonCriticalThreshold, tvb, (*poffset)++, 1, TRUE); - } - /* upper critical threshold value */ - if (tree) { + + /* upper critical threshold value */ if(ControlByte&0x10) proto_tree_add_item(ipmi_tree, hf_GetSensorThresholds_datafield_UpperCriticalThreshold, tvb, (*poffset)++, 1, TRUE); - } - /* upper non-recoverable threshold value */ - if (tree) { + + /* upper non-recoverable threshold value */ if(ControlByte&0x20) proto_tree_add_item(ipmi_tree, hf_GetSensorThresholds_datafield_UpperNonRecoverableThreshold, tvb, (*poffset)++, 1, TRUE); diff --git a/epan/dissectors/packet-ipsec.c b/epan/dissectors/packet-ipsec.c index 76b974dee7..15abeed0cc 100644 --- a/epan/dissectors/packet-ipsec.c +++ b/epan/dissectors/packet-ipsec.c @@ -218,7 +218,7 @@ dissect_esp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) * (ie none) */ if(tree) { - int len, pad, encapsulated_protocol; + int len = 0, pad = 0, encapsulated_protocol = 0; gboolean auth_decode_ok = FALSE; ti = proto_tree_add_item(tree, proto_esp, tvb, 0, -1, FALSE); diff --git a/epan/dissectors/packet-llc.c b/epan/dissectors/packet-llc.c index 8150a101c3..d38ce01175 100644 --- a/epan/dissectors/packet-llc.c +++ b/epan/dissectors/packet-llc.c @@ -217,7 +217,7 @@ llc_add_oui(guint32 oui, const char *table_name, char *table_ui_name, oui_info_table = g_hash_table_new(g_direct_hash, g_direct_equal); } - g_hash_table_insert(oui_info_table, (gpointer)oui, new_info); + g_hash_table_insert(oui_info_table, GUINT_TO_POINTER(oui), new_info); } void @@ -570,7 +570,7 @@ dissect_snap(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, /* * Do we have information for this OUI? */ - oui_info = g_hash_table_lookup(oui_info_table, (gpointer)oui); + oui_info = g_hash_table_lookup(oui_info_table, GUINT_TO_POINTER(oui)); if (oui_info != NULL) { /* * Yes - use it. diff --git a/epan/dissectors/packet-mtp3.c b/epan/dissectors/packet-mtp3.c index 865aab288d..649081a400 100644 --- a/epan/dissectors/packet-mtp3.c +++ b/epan/dissectors/packet-mtp3.c @@ -341,7 +341,7 @@ dissect_mtp3_sio(tvbuff_t *tvb, packet_info *pinfo, proto_tree *mtp3_tree) proto_tree_add_uint(sio_tree, hf_mtp3_service_indicator, tvb, SIO_OFFSET, SIO_LENGTH, sio); /* Store the SI so that subidissectors know what SI this msg is */ - pinfo->private_data = (void *)(sio & SERVICE_INDICATOR_MASK); + pinfo->private_data = GUINT_TO_POINTER(sio & SERVICE_INDICATOR_MASK); } static void diff --git a/epan/dissectors/packet-nfs.c b/epan/dissectors/packet-nfs.c index 1fe997a6cf..b44116cf61 100644 --- a/epan/dissectors/packet-nfs.c +++ b/epan/dissectors/packet-nfs.c @@ -454,15 +454,15 @@ nfs_fhandle_data_free_all(gpointer key_arg _U_, gpointer value, gpointer user_da static gint nfs_fhandle_frame_equal(gconstpointer k1, gconstpointer k2) { - guint32 key1 = (guint32)k1; - guint32 key2 = (guint32)k2; + guint32 key1 = GPOINTER_TO_UINT(k1); + guint32 key2 = GPOINTER_TO_UINT(k2); return key1==key2; } static guint nfs_fhandle_frame_hash(gconstpointer k) { - guint32 key = (guint32)k; + guint32 key = GPOINTER_TO_UINT(k); return key; } @@ -562,15 +562,15 @@ nfs_name_snoop_matched_hash(gconstpointer k) static gint nfs_name_snoop_unmatched_equal(gconstpointer k1, gconstpointer k2) { - guint32 key1 = (guint32)k1; - guint32 key2 = (guint32)k2; + guint32 key1 = GPOINTER_TO_UINT(k1); + guint32 key2 = GPOINTER_TO_UINT(k2); return key1==key2; } static guint nfs_name_snoop_unmatched_hash(gconstpointer k) { - guint32 key = (guint32)k; + guint32 key = GPOINTER_TO_UINT(k); return key; } @@ -699,7 +699,7 @@ nfs_name_snoop_add_name(int xid, tvbuff_t *tvb, int name_offset, int name_len, i nns->full_name=NULL; /* remove any old entry for this */ - old_nns=g_hash_table_lookup(nfs_name_snoop_unmatched, (gconstpointer)xid); + old_nns=g_hash_table_lookup(nfs_name_snoop_unmatched, GINT_TO_POINTER(xid)); if(old_nns){ /* if we haven't seen the reply yet, then there are no matched entries for it, thus we can dealloc the arrays*/ @@ -714,10 +714,10 @@ nfs_name_snoop_add_name(int xid, tvbuff_t *tvb, int name_offset, int name_len, i g_mem_chunk_free(nfs_name_snoop_chunk, old_nns); } - g_hash_table_remove(nfs_name_snoop_unmatched, (gconstpointer)xid); + g_hash_table_remove(nfs_name_snoop_unmatched, GINT_TO_POINTER(xid)); } - g_hash_table_insert(nfs_name_snoop_unmatched, (gpointer)xid, nns); + g_hash_table_insert(nfs_name_snoop_unmatched, GINT_TO_POINTER(xid), nns); } static void @@ -728,7 +728,7 @@ nfs_name_snoop_add_fh(int xid, tvbuff_t *tvb, int fh_offset, int fh_length) nfs_name_snoop_key_t *key; /* find which request we correspond to */ - nns=g_hash_table_lookup(nfs_name_snoop_unmatched, (gconstpointer)xid); + nns=g_hash_table_lookup(nfs_name_snoop_unmatched, GINT_TO_POINTER(xid)); if(!nns){ /* oops couldnt find matching request, bail out */ return; @@ -756,7 +756,7 @@ nfs_name_snoop_add_fh(int xid, tvbuff_t *tvb, int fh_offset, int fh_length) g_hash_table_remove(nfs_name_snoop_matched, key); } - g_hash_table_remove(nfs_name_snoop_unmatched, (gconstpointer)xid); + g_hash_table_remove(nfs_name_snoop_unmatched, GINT_TO_POINTER(xid)); g_hash_table_insert(nfs_name_snoop_matched, key, nns); } @@ -1503,7 +1503,7 @@ dissect_fhandle_data(tvbuff_t *tvb, int offset, packet_info *pinfo, not work properly with this feature */ g_hash_table_insert(nfs_fhandle_frame_table, - (gpointer)pinfo->fd->num, + GINT_TO_POINTER(pinfo->fd->num), (gpointer)old_fhd); } } diff --git a/epan/dissectors/packet-nlm.c b/epan/dissectors/packet-nlm.c index 24b35f5426..6a3cc0dfb7 100644 --- a/epan/dissectors/packet-nlm.c +++ b/epan/dissectors/packet-nlm.c @@ -153,7 +153,7 @@ nlm_msg_res_unmatched_hash(gconstpointer k) static guint nlm_msg_res_matched_hash(gconstpointer k) { - guint hash = (guint)k; + guint hash = GPOINTER_TO_UINT(k); return hash; } @@ -173,8 +173,8 @@ nlm_msg_res_unmatched_equal(gconstpointer k1, gconstpointer k2) static gint nlm_msg_res_matched_equal(gconstpointer k1, gconstpointer k2) { - guint mk1 = (guint)k1; - guint mk2 = (guint)k2; + guint mk1 = GPOINTER_TO_UINT(k1); + guint mk2 = GPOINTER_TO_UINT(k2); return( mk1==mk2 ); } @@ -204,7 +204,7 @@ nlm_print_msgres_reply(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb) { nlm_msg_res_matched_data *md; - md=g_hash_table_lookup(nlm_msg_res_matched, (gconstpointer)pinfo->fd->num); + md=g_hash_table_lookup(nlm_msg_res_matched, GINT_TO_POINTER(pinfo->fd->num)); if(md){ nstime_t ns; proto_tree_add_uint(tree, hf_nlm_request_in, tvb, 0, 0, md->req_frame); @@ -224,7 +224,7 @@ nlm_print_msgres_request(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb) { nlm_msg_res_matched_data *md; - md=g_hash_table_lookup(nlm_msg_res_matched, (gconstpointer)pinfo->fd->num); + md=g_hash_table_lookup(nlm_msg_res_matched, GINT_TO_POINTER(pinfo->fd->num)); if(md){ proto_tree_add_uint(tree, hf_nlm_reply_in, tvb, 0, 0, md->rep_frame); } @@ -234,12 +234,12 @@ nlm_match_fhandle_reply(packet_info *pinfo, proto_tree *tree) { nlm_msg_res_matched_data *md; - md=g_hash_table_lookup(nlm_msg_res_matched, (gconstpointer)pinfo->fd->num); + md=g_hash_table_lookup(nlm_msg_res_matched, GINT_TO_POINTER(pinfo->fd->num)); if(md && md->rep_frame){ nfs_fhandle_data_t *fhd; fhd=(nfs_fhandle_data_t *)g_hash_table_lookup( nfs_fhandle_frame_table, - (gconstpointer)md->req_frame); + GINT_TO_POINTER(md->req_frame)); if(fhd){ dissect_fhandle_hidden(pinfo, tree, fhd); @@ -251,12 +251,12 @@ nlm_match_fhandle_request(packet_info *pinfo, proto_tree *tree) { nlm_msg_res_matched_data *md; - md=g_hash_table_lookup(nlm_msg_res_matched, (gconstpointer)pinfo->fd->num); + md=g_hash_table_lookup(nlm_msg_res_matched, GINT_TO_POINTER(pinfo->fd->num)); if(md && md->rep_frame){ nfs_fhandle_data_t *fhd; fhd=(nfs_fhandle_data_t *)g_hash_table_lookup( nfs_fhandle_frame_table, - (gconstpointer)md->rep_frame); + GINT_TO_POINTER(md->rep_frame)); if(fhd){ dissect_fhandle_hidden(pinfo, tree, fhd); @@ -282,8 +282,8 @@ nlm_register_unmatched_res(packet_info *pinfo, tvbuff_t *tvb, int offset) md->req_frame=old_umd->req_frame; md->rep_frame=pinfo->fd->num; md->ns=old_umd->ns; - g_hash_table_insert(nlm_msg_res_matched, (gpointer)md->req_frame, (gpointer)md); - g_hash_table_insert(nlm_msg_res_matched, (gpointer)md->rep_frame, (gpointer)md); + g_hash_table_insert(nlm_msg_res_matched, GINT_TO_POINTER(md->req_frame), (gpointer)md); + g_hash_table_insert(nlm_msg_res_matched, GINT_TO_POINTER(md->rep_frame), (gpointer)md); g_hash_table_remove(nlm_msg_res_unmatched, (gconstpointer)old_umd); g_free((gpointer)old_umd->cookie); diff --git a/epan/dissectors/packet-portmap.c b/epan/dissectors/packet-portmap.c index 724f8a95b4..4834a5842b 100644 --- a/epan/dissectors/packet-portmap.c +++ b/epan/dissectors/packet-portmap.c @@ -118,7 +118,7 @@ dissect_getport_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, if(!pinfo->fd->flags.visited){ rpc_call_info_value *rpc_call=pinfo->private_data; /* only do this for UDP, TCP does not need anything like this */ - if(rpc_call && ((int)rpc_call->private_data==PT_UDP) ){ + if(rpc_call && (GPOINTER_TO_UINT(rpc_call->private_data)==PT_UDP) ){ guint32 port; port=tvb_get_ntohl(tvb, offset); if(port){ diff --git a/epan/dissectors/packet-rpc.c b/epan/dissectors/packet-rpc.c index 1b8ed5950c..6ecda01d96 100644 --- a/epan/dissectors/packet-rpc.c +++ b/epan/dissectors/packet-rpc.c @@ -2589,7 +2589,7 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if(rpc_call && rpc_call->rep_num){ fhd=(nfs_fhandle_data_t *)g_hash_table_lookup( nfs_fhandle_frame_table, - (gconstpointer)rpc_call->rep_num); + GINT_TO_POINTER(rpc_call->rep_num)); if(fhd){ dissect_fhandle_hidden(pinfo, ptree, fhd); @@ -2600,7 +2600,7 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if(rpc_call && rpc_call->req_num){ fhd=(nfs_fhandle_data_t *)g_hash_table_lookup( nfs_fhandle_frame_table, - (gconstpointer)rpc_call->req_num); + GINT_TO_POINTER(rpc_call->req_num)); if(fhd){ dissect_fhandle_hidden(pinfo, ptree, fhd); diff --git a/epan/dissectors/packet-rtsp.c b/epan/dissectors/packet-rtsp.c index e0bbb22768..070d1f0865 100644 --- a/epan/dissectors/packet-rtsp.c +++ b/epan/dissectors/packet-rtsp.c @@ -805,7 +805,7 @@ dissect_rtspmessage(tvbuff_t *tvb, int offset, packet_info *pinfo, * Process some headers specially. */ #define HDR_MATCHES(header) \ - (linelen > STRLEN_CONST(header) && \ + ( (size_t)linelen > STRLEN_CONST(header) && \ strncasecmp(line, (header), STRLEN_CONST(header)) == 0) if (HDR_MATCHES(rtsp_transport)) { diff --git a/epan/dissectors/packet-sigcomp.c b/epan/dissectors/packet-sigcomp.c index 761cc3d359..bcc582fd90 100644 --- a/epan/dissectors/packet-sigcomp.c +++ b/epan/dissectors/packet-sigcomp.c @@ -1687,7 +1687,7 @@ dissect_udvm_reference_operand(tvbuff_t *udvm_tvb, proto_tree *sigcomp_udvm_tree */ static int dissect_udvm_multitype_operand(tvbuff_t *udvm_tvb, proto_tree *sigcomp_udvm_tree, - gint offset, gboolean is_addr, gint *start_offset, guint16 *value, gboolean *is_memory_address ) + gint offset, gboolean is_addr _U_, gint *start_offset, guint16 *value, gboolean *is_memory_address ) { guint bytecode; guint display_bytecode; diff --git a/epan/dissectors/packet-sip.c b/epan/dissectors/packet-sip.c index e48592535d..8582db1a1c 100644 --- a/epan/dissectors/packet-sip.c +++ b/epan/dissectors/packet-sip.c @@ -1531,7 +1531,7 @@ guint sip_is_packet_resend(packet_info *pinfo, /* Return any answer stored from previous dissection */ if (pinfo->fd->flags.visited) { - return (guint)(p_get_proto_data(pinfo->fd, proto_sip)); + return GPOINTER_TO_UINT(p_get_proto_data(pinfo->fd, proto_sip)); } /* No packet entry found, consult global hash table */ @@ -1637,7 +1637,7 @@ guint sip_is_packet_resend(packet_info *pinfo, } /* Store return value with this packet */ - p_add_proto_data(pinfo->fd, proto_sip, (void*)result); + p_add_proto_data(pinfo->fd, proto_sip, GUINT_TO_POINTER(result)); return result; } diff --git a/epan/dissectors/packet-smb-sidsnooping.c b/epan/dissectors/packet-smb-sidsnooping.c index 0ee0d4f999..bf3929c109 100644 --- a/epan/dissectors/packet-smb-sidsnooping.c +++ b/epan/dissectors/packet-smb-sidsnooping.c @@ -147,15 +147,15 @@ samr_query_dispinfo(void *dummy _U_, packet_info *pinfo, epan_dissect_t *edt, vo } fi=gp->pdata[0]; - old_ctx=g_hash_table_lookup(ctx_handle_table, (gpointer)pinfo->fd->num); + old_ctx=g_hash_table_lookup(ctx_handle_table, GINT_TO_POINTER(pinfo->fd->num)); if(old_ctx){ - g_hash_table_remove(ctx_handle_table, (gpointer)pinfo->fd->num); + g_hash_table_remove(ctx_handle_table, GINT_TO_POINTER(pinfo->fd->num)); } if(!old_ctx){ old_ctx=g_mem_chunk_alloc(ctx_handle_chunk); memcpy(old_ctx, fi->value.value.bytes->data, 20); } - g_hash_table_insert(ctx_handle_table, (gpointer)pinfo->fd->num, old_ctx); + g_hash_table_insert(ctx_handle_table, GINT_TO_POINTER(pinfo->fd->num), old_ctx); return 0; } @@ -164,7 +164,7 @@ samr_query_dispinfo(void *dummy _U_, packet_info *pinfo, epan_dissect_t *edt, vo return 0; } - old_ctx=g_hash_table_lookup(ctx_handle_table, (gpointer)ri->call_data->req_frame); + old_ctx=g_hash_table_lookup(ctx_handle_table, GINT_TO_POINTER(ri->call_data->req_frame)); if(!old_ctx){ return 0; } @@ -313,8 +313,8 @@ free_all_ctx_handle(gpointer key_arg _U_, gpointer value _U_, gpointer user_data static gint ctx_handle_equal(gconstpointer k1, gconstpointer k2) { - int sn1 = (int)k1; - int sn2 = (int)k2; + int sn1 = GPOINTER_TO_INT(k1); + int sn2 = GPOINTER_TO_INT(k2); return sn1==sn2; } @@ -322,7 +322,7 @@ ctx_handle_equal(gconstpointer k1, gconstpointer k2) static guint ctx_handle_hash(gconstpointer k) { - int sn = (int)k; + int sn = GPOINTER_TO_INT(k); return sn; } diff --git a/epan/dissectors/packet-smb.c b/epan/dissectors/packet-smb.c index ebf92a8402..2f77659a17 100644 --- a/epan/dissectors/packet-smb.c +++ b/epan/dissectors/packet-smb.c @@ -906,14 +906,14 @@ static int smb_saved_info_init_count = 200; static gint smb_saved_info_equal_unmatched(gconstpointer k1, gconstpointer k2) { - register guint32 key1 = (guint32)k1; - register guint32 key2 = (guint32)k2; + register guint32 key1 = GPOINTER_TO_UINT(k1); + register guint32 key2 = GPOINTER_TO_UINT(k2); return key1==key2; } static guint smb_saved_info_hash_unmatched(gconstpointer k) { - register guint32 key = (guint32)k; + register guint32 key = GPOINTER_TO_UINT(k); return key; } @@ -3259,7 +3259,7 @@ dissect_read_file_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tre if (!pinfo->fd->flags.visited) { /* remember the FID for the processing of the response */ si = (smb_info_t *)pinfo->private_data; - si->sip->extra_info=(void *)fid; + si->sip->extra_info=GUINT_TO_POINTER(fid); } /* read count */ @@ -3384,7 +3384,7 @@ dissect_read_file_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tr /* If we have seen the request, then print which FID this refers to */ /* first check if we have seen the request */ if(si->sip != NULL && si->sip->frame_req>0){ - fid=(int)si->sip->extra_info; + fid=GPOINTER_TO_INT(si->sip->extra_info); add_fid(tvb, pinfo, tree, 0, 0, (guint16) fid); } @@ -5189,7 +5189,7 @@ dissect_read_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, i if (!pinfo->fd->flags.visited) { /* remember the FID for the processing of the response */ si = (smb_info_t *)pinfo->private_data; - si->sip->extra_info=(void *)fid; + si->sip->extra_info=GUINT_TO_POINTER(fid); } /* offset */ @@ -5299,7 +5299,7 @@ dissect_read_andx_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /* If we have seen the request, then print which FID this refers to */ /* first check if we have seen the request */ if(si->sip != NULL && si->sip->frame_req>0){ - fid=(int)si->sip->extra_info; + fid=GPOINTER_TO_INT(si->sip->extra_info); add_fid(tvb, pinfo, tree, 0, 0, (guint16) fid); } @@ -5403,7 +5403,7 @@ dissect_write_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, offset += 2; if (!pinfo->fd->flags.visited) { /* remember the FID for the processing of the response */ - si->sip->extra_info=(void *)fid; + si->sip->extra_info=GUINT_TO_POINTER(fid); } /* offset */ @@ -5476,10 +5476,10 @@ dissect_write_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, so we know that future Read/Writes to this TID is (probably) DCERPC. */ - if(g_hash_table_lookup(si->ct->tid_service, (void *)si->tid)){ - g_hash_table_remove(si->ct->tid_service, (void *)si->tid); + if(g_hash_table_lookup(si->ct->tid_service, GUINT_TO_POINTER(si->tid))){ + g_hash_table_remove(si->ct->tid_service, GUINT_TO_POINTER(si->tid)); } - g_hash_table_insert(si->ct->tid_service, (void *)si->tid, (void *)TID_IPC); + g_hash_table_insert(si->ct->tid_service, GUINT_TO_POINTER(si->tid), (void *)TID_IPC); } if(si->sip){ si->sip->flags|=SMB_SIF_TID_IS_IPC; @@ -6334,13 +6334,13 @@ dissect_tree_connect_andx_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree this tree */ if(!pinfo->fd->flags.visited){ /* Remove any previous entry for this TID */ - if(g_hash_table_lookup(si->ct->tid_service, (void *)si->tid)){ - g_hash_table_remove(si->ct->tid_service, (void *)si->tid); + if(g_hash_table_lookup(si->ct->tid_service, GUINT_TO_POINTER(si->tid))){ + g_hash_table_remove(si->ct->tid_service, GUINT_TO_POINTER(si->tid)); } if(strcmp(an,"IPC") == 0){ - g_hash_table_insert(si->ct->tid_service, (void *)si->tid, (void *)TID_IPC); + g_hash_table_insert(si->ct->tid_service, GUINT_TO_POINTER(si->tid), (void *)TID_IPC); } else { - g_hash_table_insert(si->ct->tid_service, (void *)si->tid, (void *)TID_NORMAL); + g_hash_table_insert(si->ct->tid_service, GUINT_TO_POINTER(si->tid), (void *)TID_NORMAL); } } @@ -11516,10 +11516,10 @@ dissect_transaction_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, so we know that future Read/Writes to this TID is (probably) DCERPC. */ - if(g_hash_table_lookup(si->ct->tid_service, (void *)si->tid)){ - g_hash_table_remove(si->ct->tid_service, (void *)si->tid); + if(g_hash_table_lookup(si->ct->tid_service, GUINT_TO_POINTER(si->tid))){ + g_hash_table_remove(si->ct->tid_service, GUINT_TO_POINTER(si->tid)); } - g_hash_table_insert(si->ct->tid_service, (void *)si->tid, (void *)TID_IPC); + g_hash_table_insert(si->ct->tid_service, GUINT_TO_POINTER(si->tid), (void *)TID_IPC); } else if(strncmp("\\MAILSLOT\\", an, 10) == 0){ if (tri != NULL) tri->subcmd=TRANSACTION_MAILSLOT; @@ -14662,7 +14662,7 @@ dissect_smb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) last seen MID matching ours is the right one. This can fail but is better than nothing */ - sip=g_hash_table_lookup(si->ct->unmatched, (void *)pid_mid); + sip=g_hash_table_lookup(si->ct->unmatched, GUINT_TO_POINTER(pid_mid)); if(sip!=NULL){ new_key = g_mem_chunk_alloc(smb_saved_info_key_chunk); new_key->frame = pinfo->fd->num; @@ -14724,7 +14724,7 @@ dissect_smb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) /* first see if we find an unmatched smb "equal" to the current one */ - sip=g_hash_table_lookup(si->ct->unmatched, (void *)pid_mid); + sip=g_hash_table_lookup(si->ct->unmatched, GUINT_TO_POINTER(pid_mid)); if(sip!=NULL){ gboolean cmd_match=FALSE; @@ -14768,7 +14768,7 @@ dissect_smb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) SMBs of different cmds but with identical MID and PID values and if ethereal lost the first reply and the second request. */ - g_hash_table_remove(si->ct->unmatched, (void *)pid_mid); + g_hash_table_remove(si->ct->unmatched, GUINT_TO_POINTER(pid_mid)); sip=NULL; /* XXX should free it as well */ } else { /* we have found a response to some @@ -14803,7 +14803,7 @@ dissect_smb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) * 4, <- Response MID:5 * We DONT want #4 to be presented as a response to #1 */ - g_hash_table_remove(si->ct->unmatched, (void *)pid_mid); + g_hash_table_remove(si->ct->unmatched, GUINT_TO_POINTER(pid_mid)); } else { /* We have already seen another response to this MID. Since the MID in reality is only something like 10 bits @@ -14822,13 +14822,13 @@ dissect_smb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) sip->req_time.secs=pinfo->fd->abs_secs; sip->req_time.nsecs=pinfo->fd->abs_usecs*1000; sip->flags = 0; - if(g_hash_table_lookup(si->ct->tid_service, (void *)si->tid) + if(g_hash_table_lookup(si->ct->tid_service, GUINT_TO_POINTER(si->tid)) == (void *)TID_IPC) { sip->flags |= SMB_SIF_TID_IS_IPC; } sip->cmd = si->cmd; sip->extra_info = NULL; - g_hash_table_insert(si->ct->unmatched, (void *)pid_mid, sip); + g_hash_table_insert(si->ct->unmatched, GUINT_TO_POINTER(pid_mid), sip); new_key = g_mem_chunk_alloc(smb_saved_info_key_chunk); new_key->frame = sip->frame_req; new_key->pid_mid = pid_mid; diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c index 2c291dba0e..204351fde0 100644 --- a/epan/dissectors/packet-tcp.c +++ b/epan/dissectors/packet-tcp.c @@ -436,14 +436,14 @@ scan_for_next_pdu(tvbuff_t *tvb, proto_tree *tcp_tree, packet_info *pinfo, int o tnp->last_frame_time.secs=pinfo->fd->abs_secs; tnp->last_frame_time.nsecs=pinfo->fd->abs_usecs*1000; g_hash_table_insert(tcp_pdu_skipping_table, - (void *)pinfo->fd->num, (void *)tnp); + GINT_TO_POINTER(pinfo->fd->num), (void *)tnp); print_pdu_tracking_data(pinfo, tvb, tcp_tree, tnp); return -1; } if(seqnxtpdu && nxtseq>tnp->nxtpdu){ g_hash_table_insert(tcp_pdu_tracking_table, - (void *)pinfo->fd->num, (void *)tnp->nxtpdu); + GINT_TO_POINTER(pinfo->fd->num), (void *)tnp->nxtpdu); offset+=tnp->nxtpdu-seq; break; } @@ -451,7 +451,7 @@ scan_for_next_pdu(tvbuff_t *tvb, proto_tree *tcp_tree, packet_info *pinfo, int o } else { guint32 pduseq; - tnp=(struct tcp_next_pdu *)g_hash_table_lookup(tcp_pdu_time_table, (void *)pinfo->fd->num); + tnp=(struct tcp_next_pdu *)g_hash_table_lookup(tcp_pdu_time_table, GINT_TO_POINTER(pinfo->fd->num)); if(tnp){ proto_item *item; nstime_t ns; @@ -472,13 +472,13 @@ scan_for_next_pdu(tvbuff_t *tvb, proto_tree *tcp_tree, packet_info *pinfo, int o } /* check if this is a segment in the middle of a pdu */ - tnp=(struct tcp_next_pdu *)g_hash_table_lookup(tcp_pdu_skipping_table, (void *)pinfo->fd->num); + tnp=(struct tcp_next_pdu *)g_hash_table_lookup(tcp_pdu_skipping_table, GINT_TO_POINTER(pinfo->fd->num)); if(tnp){ print_pdu_tracking_data(pinfo, tvb, tcp_tree, tnp); return -1; } - pduseq=(guint32)g_hash_table_lookup(tcp_pdu_tracking_table, (void *)pinfo->fd->num); + pduseq=(guint32)g_hash_table_lookup(tcp_pdu_tracking_table, GINT_TO_POINTER(pinfo->fd->num)); if(pduseq){ offset+=pduseq-seq; } @@ -525,7 +525,7 @@ pdu_store_sequencenumber_of_next_pdu(packet_info *pinfo, guint32 seq, guint32 nx Add check for ACKs and purge list of sequence numbers already acked. */ - g_hash_table_insert(tcp_pdu_time_table, (void *)pinfo->fd->num, (void *)tnp); + g_hash_table_insert(tcp_pdu_time_table, GINT_TO_POINTER(pinfo->fd->num), (void *)tnp); } /* This is called for SYN+ACK packets and the purpose is to verify that we @@ -576,7 +576,7 @@ tcp_get_relative_seq_ack(guint32 frame, guint32 *seq, guint32 *ack, guint32 *win { struct tcp_rel_seq *trs; - trs=g_hash_table_lookup(tcp_rel_seq_table, (void *)frame); + trs=g_hash_table_lookup(tcp_rel_seq_table, GUINT_TO_POINTER(frame)); if(!trs){ return; } @@ -593,7 +593,7 @@ tcp_analyze_get_acked_struct(guint32 frame, gboolean createflag) { struct tcp_acked *ta; - ta=g_hash_table_lookup(tcp_analyze_acked_table, (void *)frame); + ta=g_hash_table_lookup(tcp_analyze_acked_table, GUINT_TO_POINTER(frame)); if((!ta) && createflag){ ta=g_mem_chunk_alloc(tcp_acked_chunk); ta->frame_acked=0; @@ -602,7 +602,7 @@ tcp_analyze_get_acked_struct(guint32 frame, gboolean createflag) ta->flags=0; ta->dupack_num=0; ta->dupack_frame=0; - g_hash_table_insert(tcp_analyze_acked_table, (void *)frame, ta); + g_hash_table_insert(tcp_analyze_acked_table, GUINT_TO_POINTER(frame), ta); } return ta; } @@ -1230,7 +1230,7 @@ ack_finished: trs->seq_base=base_seq; trs->ack_base=base_ack; trs->win_scale=win_scale1; - g_hash_table_insert(tcp_rel_seq_table, (void *)pinfo->fd->num, trs); + g_hash_table_insert(tcp_rel_seq_table, GINT_TO_POINTER(pinfo->fd->num), trs); } } @@ -1391,15 +1391,15 @@ free_all_acked(gpointer key_arg _U_, gpointer value _U_, gpointer user_data _U_) static guint tcp_acked_hash(gconstpointer k) { - guint32 frame = (guint32)k; + guint32 frame = GPOINTER_TO_UINT(k); return frame; } static gint tcp_acked_equal(gconstpointer k1, gconstpointer k2) { - guint32 frame1 = (guint32)k1; - guint32 frame2 = (guint32)k2; + guint32 frame1 = GPOINTER_TO_UINT(k1); + guint32 frame2 = GPOINTER_TO_UINT(k2); return frame1==frame2; } diff --git a/epan/dissectors/packet-tds.c b/epan/dissectors/packet-tds.c index 8de35e9881..374c05d21f 100644 --- a/epan/dissectors/packet-tds.c +++ b/epan/dissectors/packet-tds.c @@ -1028,7 +1028,7 @@ dissect_tds_col_info_token(tvbuff_t *tvb, struct _netlib_data *nl_data, guint of * TODO: check we don't go past end of the token */ static gboolean -read_results_tds5(tvbuff_t *tvb, struct _netlib_data *nl_data, guint offset, guint len) +read_results_tds5(tvbuff_t *tvb, struct _netlib_data *nl_data, guint offset, guint len _U_) { guint name_len; guint cur; @@ -1206,7 +1206,7 @@ dissect_tds_env_chg(tvbuff_t *tvb, guint offset, guint token_sz, } static void -dissect_tds_err_token(tvbuff_t *tvb, guint offset, guint token_sz, proto_tree *tree) +dissect_tds_err_token(tvbuff_t *tvb, guint offset, guint token_sz _U_, proto_tree *tree) { guint16 msg_len; guint8 srvr_len, proc_len; diff --git a/epan/dissectors/packet-x11.c b/epan/dissectors/packet-x11.c index 3bfd6d72ef..cb2a130d71 100644 --- a/epan/dissectors/packet-x11.c +++ b/epan/dissectors/packet-x11.c @@ -2894,7 +2894,7 @@ static void dissect_x11_initial_conn(tvbuff_t *tvb, packet_info *pinfo, * ...and we're expecting a reply to it. */ state->sequencenumber = 0; - g_hash_table_insert(state->seqtable, (int *)state->sequencenumber, + g_hash_table_insert(state->seqtable, GINT_TO_POINTER(state->sequencenumber), (int *)INITIAL_CONN); } @@ -3013,13 +3013,13 @@ static void dissect_x11_request(tvbuff_t *tvb, packet_info *pinfo, if (state->opcode_vals[i].strptr == NULL) { state->opcode_vals[i].strptr = name; g_hash_table_insert(state->valtable, - (int *)state->sequencenumber, + GINT_TO_POINTER(state->sequencenumber), (int *)&state->opcode_vals[i]); break; } else if (strcmp(state->opcode_vals[i].strptr, name) == 0) { g_hash_table_insert(state->valtable, - (int *)state->sequencenumber, + GINT_TO_POINTER(state->sequencenumber), (int *)&state->opcode_vals[i]); break; } @@ -3071,7 +3071,7 @@ static void dissect_x11_request(tvbuff_t *tvb, packet_info *pinfo, * Those requests expect a reply. */ g_hash_table_insert(state->seqtable, - (int *)state->sequencenumber, + GINT_TO_POINTER(state->sequencenumber), (int *)opcode); break; @@ -3082,7 +3082,7 @@ static void dissect_x11_request(tvbuff_t *tvb, packet_info *pinfo, */ if (opcode >= X_FirstExtension && opcode <= X_LastExtension) { g_hash_table_insert(state->seqtable, - (int *)state->sequencenumber, + GINT_TO_POINTER(state->sequencenumber), (int *)opcode); } @@ -4168,7 +4168,7 @@ static void dissect_x11_requests(tvbuff_t *tvb, packet_info *pinfo, if (state->iconn_frame == pinfo->fd->num || (g_hash_table_lookup(state->seqtable, - (int *)state->sequencenumber) == (int *)NOTHING_SEEN && + GINT_TO_POINTER(state->sequencenumber)) == (int *)NOTHING_SEEN && (opcode == 'B' || opcode == 'l') && (plen == 11 || plen == 2816))) { /* @@ -4474,7 +4474,7 @@ dissect_x11_replies(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) * - event (some event occured) */ if (g_hash_table_lookup(state->seqtable, - (int *)state->sequencenumber) == (int *)INITIAL_CONN + GINT_TO_POINTER(state->sequencenumber)) == (int *)INITIAL_CONN || (state->iconn_reply == pinfo->fd->num)) { /* * Either the connection is in the "initial @@ -4567,7 +4567,7 @@ dissect_x11_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, sequence_number = VALUE16(tvb, offset + 2); opcode = (int)g_hash_table_lookup(state->seqtable, - (int *)sequence_number); + GINT_TO_POINTER(sequence_number)); if (state->iconn_frame == 0 && state->resync == FALSE) { @@ -4618,12 +4618,12 @@ dissect_x11_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, } vals_p = g_hash_table_lookup(state->valtable, - (int *)sequence_number); + GINT_TO_POINTER(sequence_number)); if (vals_p != NULL) { major_opcode = VALUE8(tvb, offset + 9); vals_p->value = major_opcode; g_hash_table_remove(state->valtable, - (int *)sequence_number); + GINT_TO_POINTER(sequence_number)); } break; -- cgit v1.2.3