aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2012-12-26 05:57:06 +0000
committerGuy Harris <guy@alum.mit.edu>2012-12-26 05:57:06 +0000
commit8ed7a73e22c049a2e013bb436e599bff41fc5b9b (patch)
treead4a4cc6fb4ff4d3e3ffe3a3f8e3d056e441ae46 /plugins
parent8ede6b7dc09aa636f87147ab432a137c209e8aca (diff)
Fix a bunch of warnings.
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of sizeof. Cast away some implicit 64-bit-to-32-bit conversion errors due to use of strtol() and strtoul(). Change some data types to avoid those implicit conversion warnings. When assigning a constant to a float, make sure the constant isn't a double, by appending "f" to the constant. Constify a bunch of variables, parameters, and return values to eliminate warnings due to strings being given const qualifiers. Cast away those warnings in some cases where an API we don't control forces us to do so. Enable a bunch of additional warnings by default. Note why at least some of the other warnings aren't enabled. randpkt.c and text2pcap.c are used to build programs, so they don't need to be in EXTRA_DIST. If the user specifies --enable-warnings-as-errors, add -Werror *even if the user specified --enable-extra-gcc-flags; assume they know what they're doing and are willing to have the compile fail due to the extra GCC warnings being treated as errors. svn path=/trunk/; revision=46748
Diffstat (limited to 'plugins')
-rw-r--r--plugins/ethercat/packet-ams.c186
-rw-r--r--plugins/ethercat/packet-ams.h34
-rw-r--r--plugins/ethercat/packet-ecatmb.c22
-rw-r--r--plugins/ethercat/packet-ethercat-datagram.c22
-rw-r--r--plugins/ethercat/packet-ethercat-frame.h2
-rw-r--r--plugins/ethercat/packet-ioraw.h2
-rw-r--r--plugins/ethercat/packet-nv.c28
-rw-r--r--plugins/ethercat/packet-nv.h4
-rw-r--r--plugins/gryphon/packet-gryphon.c6
-rw-r--r--plugins/mate/mate_runtime.c18
-rw-r--r--plugins/mate/mate_setup.c8
-rw-r--r--plugins/mate/mate_util.c4
-rw-r--r--plugins/opcua/opcua.c2
-rw-r--r--plugins/opcua/opcua_simpletypes.c8
-rw-r--r--plugins/profinet/packet-dcerpc-pn-io.c2
-rw-r--r--plugins/profinet/packet-pn-mrp.c2
-rw-r--r--plugins/wimax/crc.c4
-rw-r--r--plugins/wimax/mac_hd_generic_decoder.c22
-rw-r--r--plugins/wimax/msg_dlmap.c8
-rw-r--r--plugins/wimax/packet-wmx.c14
-rw-r--r--plugins/wimax/wimax_harq_map_decoder.c8
-rw-r--r--plugins/wimaxasncp/packet-wimaxasncp.c26
-rw-r--r--plugins/wimaxasncp/wimaxasncp_dict.l8
23 files changed, 215 insertions, 225 deletions
diff --git a/plugins/ethercat/packet-ams.c b/plugins/ethercat/packet-ams.c
index 3e096f11d5..0740c98c06 100644
--- a/plugins/ethercat/packet-ams.c
+++ b/plugins/ethercat/packet-ams.c
@@ -431,43 +431,43 @@ static gint dissect_ams(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
proto_tree_add_string(ams_tree, hf_ams_targetnetid, tvb, offset, AmsNetId_Len, szText);
offset += AmsNetId_Len;
- proto_tree_add_item(ams_tree, hf_ams_targetport, tvb, offset, sizeof(guint16), ENC_LITTLE_ENDIAN);
- offset += sizeof(guint16);
+ proto_tree_add_item(ams_tree, hf_ams_targetport, tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
+ offset += (int)sizeof(guint16);
NetIdFormater(tvb, offset, szText, nMax);
proto_tree_add_string(ams_tree, hf_ams_sendernetid, tvb, offset, AmsNetId_Len, szText);
offset += AmsNetId_Len;
- proto_tree_add_item(ams_tree, hf_ams_senderport, tvb, offset, sizeof(guint16), ENC_LITTLE_ENDIAN);
- offset += sizeof(guint16);
+ proto_tree_add_item(ams_tree, hf_ams_senderport, tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
+ offset += (int)sizeof(guint16);
- proto_tree_add_item(ams_tree, hf_ams_cmdid, tvb, offset, sizeof(guint16), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_tree, hf_ams_cmdid, tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
cmdId = tvb_get_letohs(tvb, offset);
- offset+=sizeof(guint16);
+ offset+=(int)sizeof(guint16);
- anItem = proto_tree_add_item(ams_tree, hf_ams_stateflags, tvb, offset, sizeof(guint16), ENC_LITTLE_ENDIAN);
+ anItem = proto_tree_add_item(ams_tree, hf_ams_stateflags, tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
ams_statetree = proto_item_add_subtree(anItem, ett_ams_stateflags);
- proto_tree_add_item(ams_statetree, hf_ams_stateresponse,tvb, offset, sizeof(guint16), ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ams_statetree, hf_ams_statenoreturn,tvb, offset, sizeof(guint16), ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ams_statetree, hf_ams_stateadscmd,tvb, offset, sizeof(guint16), ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ams_statetree, hf_ams_statesyscmd,tvb, offset, sizeof(guint16), ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ams_statetree, hf_ams_statehighprio,tvb, offset, sizeof(guint16), ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ams_statetree, hf_ams_statetimestampadded,tvb, offset, sizeof(guint16), ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ams_statetree, hf_ams_stateudp,tvb, offset, sizeof(guint16), ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ams_statetree, hf_ams_stateinitcmd,tvb, offset, sizeof(guint16), ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ams_statetree, hf_ams_statebroadcast,tvb, offset, sizeof(guint16), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_statetree, hf_ams_stateresponse,tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_statetree, hf_ams_statenoreturn,tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_statetree, hf_ams_stateadscmd,tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_statetree, hf_ams_statesyscmd,tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_statetree, hf_ams_statehighprio,tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_statetree, hf_ams_statetimestampadded,tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_statetree, hf_ams_stateudp,tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_statetree, hf_ams_stateinitcmd,tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_statetree, hf_ams_statebroadcast,tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
stateflags = tvb_get_letohs(tvb, offset);
- offset+=sizeof(guint16);
+ offset+=(int)sizeof(guint16);
- proto_tree_add_item(ams_tree, hf_ams_cbdata, tvb, offset, sizeof(guint32), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_tree, hf_ams_cbdata, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
cbdata = tvb_get_letohl(tvb,offset);
- offset+=sizeof(guint32);
+ offset+=(int)sizeof(guint32);
- proto_tree_add_item(ams_tree, hf_ams_errorcode, tvb, offset, sizeof(guint32),ENC_LITTLE_ENDIAN);
- offset+=sizeof(guint32);
+ proto_tree_add_item(ams_tree, hf_ams_errorcode, tvb, offset, (int)sizeof(guint32),ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(guint32);
- proto_tree_add_item(ams_tree, hf_ams_invokeid, tvb, offset, sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=sizeof(guint32);
+ proto_tree_add_item(ams_tree, hf_ams_invokeid, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(guint32);
}
else
{
@@ -492,14 +492,14 @@ static gint dissect_ams(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
if( ams_length-offset >= TAdsReadReq_Len )
{
ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsreadrequest);
- proto_tree_add_item(ams_adstree, hf_ams_adsindexgroup, tvb, offset, sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adsindexgroup, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(guint32);
- proto_tree_add_item(ams_adstree, hf_ams_adsindexoffset, tvb, offset, sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adsindexoffset, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(guint32);
- proto_tree_add_item(ams_adstree, hf_ams_adscblength, tvb, offset, sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adscblength, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(guint32);
}
}
}
@@ -511,17 +511,17 @@ static gint dissect_ams(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
if( tree )
{
anItem = proto_tree_add_item(ams_tree, hf_ams_adswriterequest, tvb, offset, ams_length-offset, ENC_NA);
- if( ams_length-offset >= TAdsWriteReq_Len - sizeof(guint16) )
+ if( ams_length-offset >= TAdsWriteReq_Len - (int)sizeof(guint16) )
{
ams_adstree = proto_item_add_subtree(anItem, ett_ams_adswriterequest);
proto_tree_add_item(ams_adstree, hf_ams_adsindexgroup, tvb, offset, 4, ENC_LITTLE_ENDIAN);
- offset+=sizeof(guint32);
+ offset+=(int)sizeof(guint32);
proto_tree_add_item(ams_adstree, hf_ams_adsindexoffset, tvb, offset, 4, ENC_LITTLE_ENDIAN);
- offset+=sizeof(guint32);
+ offset+=(int)sizeof(guint32);
proto_tree_add_item(ams_adstree, hf_ams_adscblength, tvb, offset, 4, ENC_LITTLE_ENDIAN);
- offset+=sizeof(guint32);
+ offset+=(int)sizeof(guint32);
proto_tree_add_item(ams_adstree, hf_ams_adsdata, tvb, offset, ams_length-offset, ENC_NA);
}
@@ -535,20 +535,20 @@ static gint dissect_ams(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
if( tree )
{
anItem = proto_tree_add_item(ams_tree, hf_ams_adsreadwriterequest, tvb, offset, ams_length-offset, ENC_NA);
- if( ams_length-offset >= TAdsReadWriteReq_Len - sizeof(guint16))
+ if( ams_length-offset >= TAdsReadWriteReq_Len - (int)sizeof(guint16))
{
ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsreadwriterequest);
- proto_tree_add_item(ams_adstree, hf_ams_adsindexgroup, tvb, offset, sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adsindexgroup, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(guint32);
- proto_tree_add_item(ams_adstree, hf_ams_adsindexoffset, tvb, offset, sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adsindexoffset, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(guint32);
- proto_tree_add_item(ams_adstree, hf_ams_adscbreadlength, tvb, offset, sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adscbreadlength, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(guint32);
- proto_tree_add_item(ams_adstree, hf_ams_adscbwritelength, tvb, offset, sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adscbwritelength, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(guint32);
proto_tree_add_item(ams_adstree, hf_ams_adsdata, tvb, offset+16, ams_length-offset, ENC_NA);
}
@@ -565,7 +565,7 @@ static gint dissect_ams(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
if( ams_length-offset >= TAdsReadStateReq_Len )
{
ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsreadstaterequest);
- proto_tree_add_item(ams_adstree, hf_ams_adsinvokeid, tvb, offset, sizeof(guint32), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_adstree, hf_ams_adsinvokeid, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
}
}
}
@@ -577,17 +577,17 @@ static gint dissect_ams(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
if( tree )
{
anItem = proto_tree_add_item(ams_tree, hf_ams_adswritectrlrequest, tvb, offset, ams_length-offset, ENC_NA);
- if( ams_length-offset >= TAdsWriteControlReq_Len - sizeof(guint16) )
+ if( ams_length-offset >= TAdsWriteControlReq_Len - (int)sizeof(guint16) )
{
ams_adstree = proto_item_add_subtree(anItem, ett_ams_adswritectrlrequest);
proto_tree_add_item(ams_adstree, hf_ams_adsstate, tvb, offset, 2, ENC_LITTLE_ENDIAN);
- offset+=sizeof(guint16);
+ offset+=(int)sizeof(guint16);
proto_tree_add_item(ams_adstree, hf_ams_adsdevicestate, tvb, offset, 2, ENC_LITTLE_ENDIAN);
- offset+=sizeof(guint16);
+ offset+=(int)sizeof(guint16);
- proto_tree_add_item(ams_adstree, hf_ams_adscblength, tvb, offset, sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adscblength, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(guint32);
proto_tree_add_item(ams_adstree, hf_ams_adsdata, tvb, offset, ams_length-offset, ENC_NA);
}
@@ -604,7 +604,7 @@ static gint dissect_ams(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
if( ams_length-offset >= TAdsReadDeviceInfoReq_Len )
{
ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsreaddinforequest);
- proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, sizeof(guint32), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
}
}
}
@@ -619,23 +619,23 @@ static gint dissect_ams(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
if( ams_length-offset >= TAdsAddDeviceNotificationReq_Len )
{
ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsadddnrequest);
- proto_tree_add_item(ams_adstree, hf_ams_adsindexgroup, tvb, offset, sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adsindexgroup, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(guint32);
- proto_tree_add_item(ams_adstree, hf_ams_adsindexoffset, tvb, offset, sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adsindexoffset, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(guint32);
- proto_tree_add_item(ams_adstree, hf_ams_adscblength, tvb, offset, sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adscblength, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(guint32);
- proto_tree_add_item(ams_adstree, hf_ams_adstransmode, tvb, offset, sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adstransmode, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(guint32);
- proto_tree_add_item(ams_adstree, hf_ams_adsmaxdelay, tvb, offset, sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adsmaxdelay, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(guint32);
- proto_tree_add_item(ams_adstree, hf_ams_adscycletime, tvb, offset, sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adscycletime, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(guint32);
}
}
}
@@ -650,7 +650,7 @@ static gint dissect_ams(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
if( ams_length-offset >= TAdsDelDeviceNotificationReq_Len )
{
ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsdeldnrequest);
- proto_tree_add_item(ams_adstree, hf_ams_adsnotificationhandle, tvb, offset, sizeof(guint32), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_adstree, hf_ams_adsnotificationhandle, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
}
}
}
@@ -668,13 +668,13 @@ static gint dissect_ams(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
if( ams_length-offset >= TAdsDeviceNotificationReq_Len )
{
ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsdnrequest);
- proto_tree_add_item(ams_adstree, hf_ams_adscblength, tvb, offset, sizeof(guint32), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_adstree, hf_ams_adscblength, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
/*cbLength = tvb_get_letohs(tvb, offset);*/
- offset+=sizeof(guint32);
+ offset+=(int)sizeof(guint32);
- proto_tree_add_item(ams_adstree, hf_ams_adsnoteblocksstamps, tvb, offset, sizeof(guint32), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_adstree, hf_ams_adsnoteblocksstamps, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
/*nStamps = tvb_get_letohs(tvb, offset);*/
- offset+=sizeof(guint32);
+ offset+=(int)sizeof(guint32);
/*ToDo: dissect noteblocks*/
}
@@ -695,14 +695,14 @@ static gint dissect_ams(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
if( tree )
{
anItem = proto_tree_add_item(ams_tree, hf_ams_adsreadresponse, tvb, offset, ams_length-offset, ENC_NA);
- if( ams_length-offset >= TAdsReadRes_Len - sizeof(guint16) )
+ if( ams_length-offset >= TAdsReadRes_Len - (int)sizeof(guint16) )
{
ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsreadresponse);
- proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(guint32);
- proto_tree_add_item(ams_adstree, hf_ams_adscblength, tvb, offset, sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adscblength, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(guint32);
proto_tree_add_item(ams_adstree, hf_ams_adsdata, tvb, offset, ams_length-offset, ENC_NA);
}
@@ -719,7 +719,7 @@ static gint dissect_ams(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
if( ams_length-offset >= TAdsWriteRes_Len )
{
ams_adstree = proto_item_add_subtree(anItem, ett_ams_adswriteresponse);
- proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, sizeof(guint32), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
}
}
}
@@ -731,14 +731,14 @@ static gint dissect_ams(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
if( tree )
{
anItem = proto_tree_add_item(ams_tree, hf_ams_adsreadwriteresponse, tvb, offset, ams_length-offset, ENC_NA);
- if( ams_length-offset >= TAdsReadWriteRes_Len - sizeof(guint16) )
+ if( ams_length-offset >= TAdsReadWriteRes_Len - (int)sizeof(guint16) )
{
ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsreadwriteresponse);
- proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(guint32);
- proto_tree_add_item(ams_adstree, hf_ams_adscblength, tvb, offset, sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adscblength, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(guint32);
proto_tree_add_item(ams_adstree, hf_ams_adsdata, tvb, offset, ams_length-offset, ENC_NA);
}
@@ -755,13 +755,13 @@ static gint dissect_ams(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
if( ams_length-offset >= TAdsReadStateRes_Len )
{
ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsreadstateresponse);
- proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(guint32);
- proto_tree_add_item(ams_adstree, hf_ams_adsstate, tvb, offset, sizeof(guint16), ENC_LITTLE_ENDIAN);
- offset+=sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adsstate, tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(guint32);
- proto_tree_add_item(ams_adstree, hf_ams_adsdevicestate, tvb, offset, sizeof(guint16), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_adstree, hf_ams_adsdevicestate, tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
}
}
}
@@ -776,7 +776,7 @@ static gint dissect_ams(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
if( ams_length-offset >= TAdsWriteControlRes_Len )
{
ams_adstree = proto_item_add_subtree(anItem, ett_ams_adswritectrlresponse);
- proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, sizeof(guint32), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
}
}
}
@@ -791,13 +791,13 @@ static gint dissect_ams(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
if( ams_length-offset >= TAdsReadDeviceInfoRes_Len )
{
ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsreaddinforesponse);
- proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(guint32);
- proto_tree_add_item(ams_adstree, hf_ams_adsversionversion, tvb, offset++, sizeof(guint8), ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ams_adstree, hf_ams_adsversionrevision, tvb, offset++, sizeof(guint8), ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ams_adstree, hf_ams_adsversionbuild, tvb, offset, sizeof(guint16), ENC_LITTLE_ENDIAN);
- offset+=sizeof(guint16);
+ proto_tree_add_item(ams_adstree, hf_ams_adsversionversion, tvb, offset++, (int)sizeof(guint8), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_adstree, hf_ams_adsversionrevision, tvb, offset++, (int)sizeof(guint8), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_adstree, hf_ams_adsversionbuild, tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(guint16);
proto_tree_add_item(ams_adstree, hf_ams_adsdevicename, tvb, offset, ams_length-offset, ENC_ASCII|ENC_NA);
}
@@ -814,10 +814,10 @@ static gint dissect_ams(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
if( ams_length-offset >= TAdsAddDeviceNotificationRes_Len )
{
ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsadddnresponse);
- proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(guint32);
- proto_tree_add_item(ams_adstree, hf_ams_adsnotificationhandle, tvb, offset, sizeof(guint32), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_adstree, hf_ams_adsnotificationhandle, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
}
}
}
@@ -832,7 +832,7 @@ static gint dissect_ams(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
if( ams_length-offset >= TAdsDelDeviceNotificationRes_Len )
{
ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsdeldnresponse);
- proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, sizeof(guint32), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
}
}
}
diff --git a/plugins/ethercat/packet-ams.h b/plugins/ethercat/packet-ams.h
index befa02b696..6ffc2315a7 100644
--- a/plugins/ethercat/packet-ams.h
+++ b/plugins/ethercat/packet-ams.h
@@ -675,7 +675,7 @@ typedef struct AmsNetId_
{
guint8 b[6];
} AmsNetId;
-#define AmsNetId_Len sizeof(AmsNetId)
+#define AmsNetId_Len (int)sizeof(AmsNetId)
typedef struct AmsAddr_
{
@@ -710,7 +710,7 @@ typedef struct
ErrCodeUnion anErrCodeUnion;
UserUnion aUserUnion;
} AmsHead;
-#define AmsHead_Len sizeof(AmsHead)
+#define AmsHead_Len (int)sizeof(AmsHead)
/* State flags */
@@ -992,7 +992,7 @@ typedef struct
guint32 invokeId;
} TAdsReadDeviceInfoReq;
-#define TAdsReadDeviceInfoReq_Len sizeof(TAdsReadDeviceInfoReq)
+#define TAdsReadDeviceInfoReq_Len (int)sizeof(TAdsReadDeviceInfoReq)
/*typedef struct
{
@@ -1007,7 +1007,7 @@ typedef struct
{
guint32 invokeId;
} TAdsReadStateReq;
-#define TAdsReadStateReq_Len sizeof(TAdsReadStateReq)
+#define TAdsReadStateReq_Len (int)sizeof(TAdsReadStateReq)
typedef struct
{
@@ -1015,7 +1015,7 @@ typedef struct
guint32 indexOffset;
guint32 cbLength;
} TAdsReadReq;
-#define TAdsReadReq_Len sizeof(TAdsReadReq)
+#define TAdsReadReq_Len (int)sizeof(TAdsReadReq)
/*typedef struct
{
@@ -1053,26 +1053,26 @@ typedef struct
guint32 indexOffset;
AdsNotificationAttrib noteAttrib;
} TAdsAddDeviceNotificationReq;
-#define TAdsAddDeviceNotificationReq_Len sizeof(TAdsAddDeviceNotificationReq)
+#define TAdsAddDeviceNotificationReq_Len (int)sizeof(TAdsAddDeviceNotificationReq)
typedef struct
{
guint32 hNotification;
} TAdsDelDeviceNotificationReq;
-#define TAdsDelDeviceNotificationReq_Len sizeof(TAdsDelDeviceNotificationReq)
+#define TAdsDelDeviceNotificationReq_Len (int)sizeof(TAdsDelDeviceNotificationReq)
typedef struct
{
guint32 cbLength;
guint32 nStamps;
} TAdsDeviceNotificationReq;
-#define TAdsDeviceNotificationReq_Len sizeof(TAdsDeviceNotificationReq)
+#define TAdsDeviceNotificationReq_Len (int)sizeof(TAdsDeviceNotificationReq)
typedef struct
{
guint32 result;
} TAdsRes;
-#define TAdsRes_Len sizeof(TAdsRes)
+#define TAdsRes_Len (int)sizeof(TAdsRes)
typedef struct
{
@@ -1087,13 +1087,13 @@ typedef struct
AdsVersion version;
char sName[ADS_FIXEDNAMESIZE];
} TAdsReadDeviceInfoRes;
-#define TAdsReadDeviceInfoRes_Len sizeof(TAdsReadDeviceInfoRes)
+#define TAdsReadDeviceInfoRes_Len (int)sizeof(TAdsReadDeviceInfoRes)
typedef struct
{
guint32 result;
} TAdsWriteControlRes;
-#define TAdsWriteControlRes_Len sizeof(TAdsWriteControlRes)
+#define TAdsWriteControlRes_Len (int)sizeof(TAdsWriteControlRes)
typedef struct
{
@@ -1101,7 +1101,7 @@ typedef struct
guint16 adsState;
guint16 deviceState;
} TAdsReadStateRes;
-#define TAdsReadStateRes_Len sizeof(TAdsReadStateRes)
+#define TAdsReadStateRes_Len (int)sizeof(TAdsReadStateRes)
typedef struct
{
@@ -1109,7 +1109,7 @@ typedef struct
guint32 cbLength;
guint16 firstDataWord;
} TAdsReadRes;
-#define TAdsReadRes_Len sizeof(TAdsReadRes)
+#define TAdsReadRes_Len (int)sizeof(TAdsReadRes)
typedef struct
{
@@ -1117,26 +1117,26 @@ typedef struct
guint32 cbLength;
guint16 firstDataWord;
} TAdsReadWriteRes;
-#define TAdsReadWriteRes_Len sizeof(TAdsReadWriteRes)
+#define TAdsReadWriteRes_Len (int)sizeof(TAdsReadWriteRes)
typedef struct
{
guint32 result;
} TAdsWriteRes;
-#define TAdsWriteRes_Len sizeof(TAdsWriteRes)
+#define TAdsWriteRes_Len (int)sizeof(TAdsWriteRes)
typedef struct
{
guint32 result;
guint32 handle;
} TAdsAddDeviceNotificationRes;
-#define TAdsAddDeviceNotificationRes_Len sizeof(TAdsAddDeviceNotificationRes)
+#define TAdsAddDeviceNotificationRes_Len (int)sizeof(TAdsAddDeviceNotificationRes)
typedef struct
{
guint32 result;
} TAdsDelDeviceNotificationRes;
-#define TAdsDelDeviceNotificationRes_Len sizeof(TAdsDelDeviceNotificationRes)
+#define TAdsDelDeviceNotificationRes_Len (int)sizeof(TAdsDelDeviceNotificationRes)
/* structure for decoding the header -----------------------------------------*/
diff --git a/plugins/ethercat/packet-ecatmb.c b/plugins/ethercat/packet-ecatmb.c
index 7620734ab4..3ab266c3f4 100644
--- a/plugins/ethercat/packet-ecatmb.c
+++ b/plugins/ethercat/packet-ecatmb.c
@@ -253,14 +253,14 @@ static const true_false_string tfs_complete =
void init_mbx_header(PETHERCAT_MBOX_HEADER pMbox, tvbuff_t *tvb, gint offset)
{
- pMbox->Length = tvb_get_letohs(tvb, offset); offset+=sizeof(guint16);
- pMbox->Address = tvb_get_letohs(tvb, offset); offset+=sizeof(guint16);
+ pMbox->Length = tvb_get_letohs(tvb, offset); offset+=(int)sizeof(guint16);
+ pMbox->Address = tvb_get_letohs(tvb, offset); offset+=(int)sizeof(guint16);
pMbox->aControlUnion.Control = tvb_get_letohs(tvb, offset);
}
void init_eoe_header(PETHERCAT_EOE_HEADER pEoE, tvbuff_t *tvb, gint offset)
{
- pEoE->anEoeHeaderInfoUnion.Info = tvb_get_letohs(tvb, offset); offset+=sizeof(guint16);
+ pEoE->anEoeHeaderInfoUnion.Info = tvb_get_letohs(tvb, offset); offset+=(int)sizeof(guint16);
pEoE->anEoeHeaderDataUnion.Result = tvb_get_letohs(tvb, offset);
}
@@ -286,7 +286,7 @@ void init_coe_header(PETHERCAT_COE_HEADER pCoE, tvbuff_t *tvb, gint offset)
void init_sdo_header(PETHERCAT_SDO_HEADER pSdo, tvbuff_t *tvb, gint offset)
{
pSdo->anSdoHeaderUnion.CS = tvb_get_guint8(tvb, offset++);
- pSdo->Index = tvb_get_letohs(tvb, offset);offset+=sizeof(guint16);
+ pSdo->Index = tvb_get_letohs(tvb, offset);offset+=(int)sizeof(guint16);
pSdo->SubIndex = tvb_get_guint8(tvb, offset++);
pSdo->Data = tvb_get_letohl(tvb, offset);
}
@@ -295,7 +295,7 @@ void init_sdo_info_header(PETHERCAT_SDO_INFO_HEADER pInfo, tvbuff_t *tvb, gint o
{
pInfo->anSdoControlUnion.Control = tvb_get_guint8(tvb, offset++);
pInfo->Reserved = tvb_get_guint8(tvb, offset);
- pInfo->FragmentsLeft = sizeof(guint16);
+ pInfo->FragmentsLeft = (int)sizeof(guint16);
}
@@ -435,7 +435,7 @@ static void CANopenSdoResFormatter(PETHERCAT_SDO_HEADER pSdo, char *szText, gint
static void CANopenSdoInfoFormatter(PETHERCAT_SDO_INFO_HEADER pHead, char *szText, gint nMax)
{
guint8 opCode = pHead->anSdoControlUnion.v.OpCode & 0x7F;
- char* txt2 = "";
+ const char* txt2 = "";
if ( (pHead->anSdoControlUnion.v.OpCode & 0x80) != 0 )
txt2 = " - More Follows";
switch (opCode)
@@ -1161,10 +1161,10 @@ static void dissect_ecat_eoe(tvbuff_t *tvb, gint offset, packet_info *pinfo, pro
proto_tree_add_item(ecat_eoe_macfilter_filter_tree, hf_ecat_mailbox_eoe_macfilter_filters[nCnt], tvb, offset+nCnt*ETHERNET_ADDRESS_LEN, ETHERNET_ADDRESS_LEN, ENC_NA);
offset+=16*ETHERNET_ADDRESS_LEN;
- anItem = proto_tree_add_item(ecat_eoe_macfilter_tree, hf_ecat_mailbox_eoe_macfilter_filtermask, tvb, offset, 4*sizeof(guint32), ENC_NA);
+ anItem = proto_tree_add_item(ecat_eoe_macfilter_tree, hf_ecat_mailbox_eoe_macfilter_filtermask, tvb, offset, 4*(int)sizeof(guint32), ENC_NA);
ecat_eoe_macfilter_filtermask_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_eoe_macfilter_filtermask);
for( nCnt=0; nCnt<options.v.MacFilterMaskCount; nCnt++)
- proto_tree_add_item(ecat_eoe_macfilter_filtermask_tree, hf_ecat_mailbox_eoe_macfilter_filtermasks[nCnt], tvb, offset+nCnt*sizeof(guint32), sizeof(guint32), ENC_NA);
+ proto_tree_add_item(ecat_eoe_macfilter_filtermask_tree, hf_ecat_mailbox_eoe_macfilter_filtermasks[nCnt], tvb, offset+nCnt*(int)sizeof(guint32), (int)sizeof(guint32), ENC_NA);
}
else
proto_item_append_text(anItem, " - Invalid length!");
@@ -1319,15 +1319,15 @@ static void dissect_ecat_mailbox(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
/* Add length information to the mailbox header */
proto_tree_add_item(ecat_mailbox_header_tree, hf_ecat_mailboxlength, tvb, offset, sizeof(hdr.Length), ENC_LITTLE_ENDIAN);
- offset+=sizeof(hdr.Length);
+ offset+=(int)sizeof(hdr.Length);
/* Add address information to the mailbox header */
proto_tree_add_item(ecat_mailbox_header_tree, hf_ecat_mailboxaddress, tvb, offset, sizeof(hdr.Address), ENC_LITTLE_ENDIAN);
- offset+=sizeof(hdr.Address);
+ offset+=(int)sizeof(hdr.Address);
/* Add priority information to the mailbox header */
proto_tree_add_text(ecat_mailbox_header_tree, tvb, offset, 1, "Priority: %d", tvb_get_guint8(tvb, offset) & 0x3);
- offset+=sizeof(guint8);
+ offset+=(int)sizeof(guint8);
/* Add type information to the mailbox header */
MailboxTypeFormatter(&hdr, szText, nMax);
diff --git a/plugins/ethercat/packet-ethercat-datagram.c b/plugins/ethercat/packet-ethercat-datagram.c
index 827af0f500..60dacf25e7 100644
--- a/plugins/ethercat/packet-ethercat-datagram.c
+++ b/plugins/ethercat/packet-ethercat-datagram.c
@@ -291,9 +291,9 @@ static void init_EcParserHDR(EcParserHDR* pHdr, tvbuff_t *tvb, gint offset)
{
pHdr->cmd = tvb_get_guint8(tvb, offset++);
pHdr->idx = tvb_get_guint8(tvb, offset++);
- pHdr->anAddrUnion.a.adp = tvb_get_letohs(tvb, offset); offset+=sizeof(guint16);
- pHdr->anAddrUnion.a.ado = tvb_get_letohs(tvb, offset); offset+=sizeof(guint16);
- pHdr->len = tvb_get_letohs(tvb, offset); offset+=sizeof(guint16);
+ pHdr->anAddrUnion.a.adp = tvb_get_letohs(tvb, offset); offset+=(int)sizeof(guint16);
+ pHdr->anAddrUnion.a.ado = tvb_get_letohs(tvb, offset); offset+=(int)sizeof(guint16);
+ pHdr->len = tvb_get_letohs(tvb, offset); offset+=(int)sizeof(guint16);
pHdr->intr = tvb_get_letohs(tvb, offset);
}
@@ -303,7 +303,7 @@ static void init_dc_measure(guint32* pDC, tvbuff_t *tvb, gint offset)
for ( i=0; i<4; i++ )
{
pDC[i] = tvb_get_letohl(tvb, offset);
- offset+=sizeof(guint32);
+ offset+=(int)sizeof(guint32);
}
}
@@ -555,14 +555,14 @@ static void dissect_ecat_datagram(tvbuff_t *tvb, packet_info *pinfo, proto_tree
PROTO_ITEM_SET_HIDDEN(aitem);
}
- suboffset+= sizeof(ecHdr.cmd);
+ suboffset+= (int)sizeof(ecHdr.cmd);
proto_tree_add_item(ecat_header_tree, hf_ecat_idx, tvb, suboffset, sizeof(ecHdr.idx), ENC_LITTLE_ENDIAN);
if( subCount < 10 ){
aitem = proto_tree_add_item(ecat_header_tree, hf_ecat_sub_idx[subCount], tvb, suboffset, sizeof(ecHdr.idx), ENC_LITTLE_ENDIAN);
PROTO_ITEM_SET_HIDDEN(aitem);
}
- suboffset+= sizeof(ecHdr.idx);
+ suboffset+= (int)sizeof(ecHdr.idx);
switch ( ecHdr.cmd )
{
@@ -575,7 +575,7 @@ static void dissect_ecat_datagram(tvbuff_t *tvb, packet_info *pinfo, proto_tree
PROTO_ITEM_SET_HIDDEN(aitem);
}
- suboffset += (sizeof(ecHdr.anAddrUnion.a.adp)+sizeof(ecHdr.anAddrUnion.a.ado));
+ suboffset += (int)((sizeof(ecHdr.anAddrUnion.a.adp)+sizeof(ecHdr.anAddrUnion.a.ado)));
break;
default:
proto_tree_add_item(ecat_header_tree, hf_ecat_adp, tvb, suboffset, sizeof(ecHdr.anAddrUnion.a.adp), ENC_LITTLE_ENDIAN);
@@ -584,14 +584,14 @@ static void dissect_ecat_datagram(tvbuff_t *tvb, packet_info *pinfo, proto_tree
PROTO_ITEM_SET_HIDDEN(aitem);
}
- suboffset+= sizeof(ecHdr.anAddrUnion.a.adp);
+ suboffset+= (int)sizeof(ecHdr.anAddrUnion.a.adp);
proto_tree_add_item(ecat_header_tree, hf_ecat_ado, tvb, suboffset, sizeof(ecHdr.anAddrUnion.a.ado), ENC_LITTLE_ENDIAN);
if( subCount < 10 ){
aitem = proto_tree_add_item(ecat_header_tree, hf_ecat_sub_ado[subCount], tvb, suboffset, sizeof(ecHdr.anAddrUnion.a.ado), ENC_LITTLE_ENDIAN);
PROTO_ITEM_SET_HIDDEN(aitem);
}
- suboffset+= sizeof(ecHdr.anAddrUnion.a.ado);
+ suboffset+= (int)sizeof(ecHdr.anAddrUnion.a.ado);
}
{
@@ -609,11 +609,11 @@ static void dissect_ecat_datagram(tvbuff_t *tvb, packet_info *pinfo, proto_tree
proto_tree_add_item(length_sub_tree, hf_ecat_length_c, tvb, suboffset, sizeof(ecHdr.len), ENC_LITTLE_ENDIAN);
proto_tree_add_item(length_sub_tree, hf_ecat_length_m, tvb, suboffset, sizeof(ecHdr.len), ENC_LITTLE_ENDIAN);
- suboffset+= sizeof(ecHdr.len);
+ suboffset+= (int)sizeof(ecHdr.len);
}
proto_tree_add_item(ecat_header_tree, hf_ecat_int, tvb, suboffset, sizeof(ecHdr.intr), ENC_LITTLE_ENDIAN);
- suboffset+= sizeof(ecHdr.intr);
+ suboffset+= (int)sizeof(ecHdr.intr);
}
else
{
diff --git a/plugins/ethercat/packet-ethercat-frame.h b/plugins/ethercat/packet-ethercat-frame.h
index 94662a3acf..f552a2444a 100644
--- a/plugins/ethercat/packet-ethercat-frame.h
+++ b/plugins/ethercat/packet-ethercat-frame.h
@@ -38,6 +38,6 @@ typedef union _EtherCATFrameParser
} EtherCATFrameParserHDR;
typedef EtherCATFrameParserHDR *PEtherCATFrameParserHDR;
-#define EtherCATFrameParserHDR_Len sizeof(EtherCATFrameParserHDR)
+#define EtherCATFrameParserHDR_Len (int)sizeof(EtherCATFrameParserHDR)
#endif
diff --git a/plugins/ethercat/packet-ioraw.h b/plugins/ethercat/packet-ioraw.h
index b67e0f2055..fbbc1ceafe 100644
--- a/plugins/ethercat/packet-ioraw.h
+++ b/plugins/ethercat/packet-ioraw.h
@@ -30,6 +30,6 @@ typedef struct _IoRawParser
{
guint32 head;
} IoRawParserHDR, *PIoRawParserHDR;
-#define IoRawParserHDR_Len sizeof(IoRawParserHDR)
+#define IoRawParserHDR_Len (int)sizeof(IoRawParserHDR)
#endif /* _PACKET_IORAW_H_*/
diff --git a/plugins/ethercat/packet-nv.c b/plugins/ethercat/packet-nv.c
index 58bc9f1633..1ecaca676c 100644
--- a/plugins/ethercat/packet-nv.c
+++ b/plugins/ethercat/packet-nv.c
@@ -96,7 +96,7 @@ static void dissect_nv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree *nv_tree, *nv_header_tree, *nv_var_tree,*nv_varheader_tree;
gint offset = 0;
char szText[200];
- int nMax = sizeof(szText)-1;
+ int nMax = (int)sizeof(szText)-1;
gint i;
@@ -119,16 +119,16 @@ static void dissect_nv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
nv_header_tree = proto_item_add_subtree(ti, ett_nv_header);
- ti= proto_tree_add_item(nv_header_tree, hf_nv_publisher, tvb, offset, sizeof(guint8)*6, ENC_NA);
+ ti= proto_tree_add_item(nv_header_tree, hf_nv_publisher, tvb, offset, (int)sizeof(guint8)*6, ENC_NA);
NvPublisherFormater(tvb, offset, szText, nMax);
proto_item_set_text(ti, "%s", szText);
- offset+=(sizeof(guint8)*6);
+ offset+=((int)sizeof(guint8)*6);
- proto_tree_add_item(nv_header_tree, hf_nv_count, tvb, offset, sizeof(guint16), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(nv_header_tree, hf_nv_count, tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
nv_count = tvb_get_letohs(tvb, offset);
- offset+=sizeof(guint16);
+ offset+=(int)sizeof(guint16);
- proto_tree_add_item(nv_header_tree, hf_nv_cycleindex, tvb, offset, sizeof(guint16), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(nv_header_tree, hf_nv_cycleindex, tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
offset = NvParserHDR_Len;
for ( i=0; i < nv_count; i++ )
@@ -143,17 +143,17 @@ static void dissect_nv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti = proto_tree_add_item(nv_var_tree, hf_nv_varheader, tvb, offset, ETYPE_88A4_NV_DATA_HEADER_Len, ENC_NA);
nv_varheader_tree = proto_item_add_subtree(ti, ett_nv_varheader);
- proto_tree_add_item(nv_varheader_tree, hf_nv_id, tvb, offset, sizeof(guint16), ENC_LITTLE_ENDIAN);
- offset+=sizeof(guint16);
+ proto_tree_add_item(nv_varheader_tree, hf_nv_id, tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(guint16);
- proto_tree_add_item(nv_varheader_tree, hf_nv_hash, tvb, offset, sizeof(guint16), ENC_LITTLE_ENDIAN);
- offset+=sizeof(guint16);
+ proto_tree_add_item(nv_varheader_tree, hf_nv_hash, tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(guint16);
- proto_tree_add_item(nv_varheader_tree, hf_nv_length, tvb, offset, sizeof(guint16), ENC_LITTLE_ENDIAN);
- offset+=sizeof(guint16);
+ proto_tree_add_item(nv_varheader_tree, hf_nv_length, tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(guint16);
- proto_tree_add_item(nv_varheader_tree, hf_nv_quality, tvb, offset, sizeof(guint16), ENC_LITTLE_ENDIAN);
- offset+=sizeof(guint16);
+ proto_tree_add_item(nv_varheader_tree, hf_nv_quality, tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(guint16);
proto_tree_add_item(nv_var_tree, hf_nv_data, tvb, offset, var_length, ENC_NA);
offset+=var_length;
diff --git a/plugins/ethercat/packet-nv.h b/plugins/ethercat/packet-nv.h
index e1ad83d0bd..19fbe951e2 100644
--- a/plugins/ethercat/packet-nv.h
+++ b/plugins/ethercat/packet-nv.h
@@ -34,7 +34,7 @@ typedef struct _ETYPE_88A4_NV_DATA_HEADER
guint16 Length;
guint16 Quality;
} ETYPE_88A4_NV_DATA_HEADER;
-#define ETYPE_88A4_NV_DATA_HEADER_Len sizeof(ETYPE_88A4_NV_DATA_HEADER)
+#define ETYPE_88A4_NV_DATA_HEADER_Len (int)sizeof(ETYPE_88A4_NV_DATA_HEADER)
typedef struct _NvParserHDR
{
@@ -43,6 +43,6 @@ typedef struct _NvParserHDR
guint16 CycleIndex;
guint16 Reserved;
} NvParserHDR;
-#define NvParserHDR_Len sizeof(NvParserHDR)
+#define NvParserHDR_Len (int)sizeof(NvParserHDR)
#endif /* _PACKET_NV_H_*/
diff --git a/plugins/gryphon/packet-gryphon.c b/plugins/gryphon/packet-gryphon.c
index 74f54ba50c..0f21d49346 100644
--- a/plugins/gryphon/packet-gryphon.c
+++ b/plugins/gryphon/packet-gryphon.c
@@ -1117,10 +1117,12 @@ eventnum(tvbuff_t *tvb, int offset, proto_tree *pt)
static int
resp_time(tvbuff_t *tvb, int offset, proto_tree *pt)
{
+ guint64 val;
nstime_t timestamp;
- timestamp.secs = tvb_get_ntoh64(tvb, offset)/100000;
- timestamp.nsecs = (tvb_get_ntoh64(tvb, offset)%100000)*1000;
+ val = tvb_get_ntoh64(tvb, offset);
+ timestamp.secs = val/100000;
+ timestamp.nsecs = (int)((val%100000)*1000);
proto_tree_add_time(pt, hf_gryphon_resp_time, tvb, offset, 8, &timestamp);
offset += 8;
diff --git a/plugins/mate/mate_runtime.c b/plugins/mate/mate_runtime.c
index 8b35b218fc..2425251be8 100644
--- a/plugins/mate/mate_runtime.c
+++ b/plugins/mate/mate_runtime.c
@@ -149,7 +149,7 @@ extern void initialize_mate_runtime(void) {
}
rd->current_items = 0;
- rd->now = -1.0;
+ rd->now = -1.0f;
rd->highest_analyzed_frame = 0;
rd->frames = g_hash_table_new(g_direct_hash,g_direct_equal);
@@ -189,10 +189,10 @@ static mate_gop* new_gop(mate_cfg_gop* cfg, mate_pdu* pdu, gchar* key) {
gop->expiration = cfg->expiration > 0.0 ? cfg->expiration + rd->now : (float) -1.0 ;
gop->idle_expiration = cfg->idle_timeout > 0.0 ? cfg->idle_timeout + rd->now : (float) -1.0 ;
gop->time_to_die = cfg->lifetime > 0.0 ? cfg->lifetime + rd->now : (float) -1.0 ;
- gop->time_to_timeout = 0.0;
+ gop->time_to_timeout = 0.0f;
gop->last_time = gop->start_time = rd->now;
- gop->release_time = 0.0;
+ gop->release_time = 0.0f;
gop->num_of_pdus = 0;
gop->num_of_after_release_pdus = 0;
@@ -205,7 +205,7 @@ static mate_gop* new_gop(mate_cfg_gop* cfg, mate_pdu* pdu, gchar* key) {
pdu->gop = gop;
pdu->next = NULL;
pdu->is_start = TRUE;
- pdu->time_in_gop = 0.0;
+ pdu->time_in_gop = 0.0f;
g_hash_table_insert(cfg->gop_index,gop->gop_key,gop);
return gop;
@@ -245,12 +245,12 @@ static mate_gog* new_gog(mate_cfg_gog* cfg, mate_gop* gop) {
gog->avpl = new_avpl(cfg->name);
gog->last_n = 0;
- gog->expiration = 0.0;
- gog->idle_expiration = 0.0;
+ gog->expiration = 0.0f;
+ gog->idle_expiration = 0.0f;
gog->start_time = rd->now;
- gog->release_time = 0.0;
- gog->last_time = 0.0;
+ gog->release_time = 0.0f;
+ gog->last_time = 0.0f;
gog->gops = NULL;
gog->last_gop = NULL;
@@ -734,7 +734,7 @@ static mate_pdu* new_pdu(mate_cfg_pdu* cfg, guint32 framenum, field_info* proto,
pdu->gop = NULL;
pdu->next = NULL;
- pdu->time_in_gop = -1.0;
+ pdu->time_in_gop = -1.0f;
pdu->first = FALSE;
pdu->is_start = FALSE;
diff --git a/plugins/mate/mate_setup.c b/plugins/mate/mate_setup.c
index 093f8035b7..177df5a735 100644
--- a/plugins/mate/mate_setup.c
+++ b/plugins/mate/mate_setup.c
@@ -607,15 +607,15 @@ extern mate_config* mate_make_config(const gchar* filename, int mate_hfid) {
matecfg->defaults.pdu.replace_mode = AVPL_INSERT;
/* gop prefs */
- matecfg->defaults.gop.expiration = -1.0;
- matecfg->defaults.gop.idle_timeout = -1.0;
- matecfg->defaults.gop.lifetime = -1.0;
+ matecfg->defaults.gop.expiration = -1.0f;
+ matecfg->defaults.gop.idle_timeout = -1.0f;
+ matecfg->defaults.gop.lifetime = -1.0f;
matecfg->defaults.gop.pdu_tree_mode = GOP_FRAME_TREE;
matecfg->defaults.gop.show_times = TRUE;
matecfg->defaults.gop.drop_unassigned = FALSE;
/* gog prefs */
- matecfg->defaults.gog.expiration = 5.0;
+ matecfg->defaults.gog.expiration = 5.0f;
matecfg->defaults.gog.show_times = TRUE;
matecfg->defaults.gog.gop_tree_mode = GOP_BASIC_TREE;
diff --git a/plugins/mate/mate_util.c b/plugins/mate/mate_util.c
index 118ace70fd..fb141fe623 100644
--- a/plugins/mate/mate_util.c
+++ b/plugins/mate/mate_util.c
@@ -907,8 +907,8 @@ extern AVP* match_avp(AVP* src, AVP* op) {
gchar* p;
guint ls;
guint lo;
- float fs = 0.0;
- float fo = 0.0;
+ float fs = 0.0f;
+ float fo = 0.0f;
gboolean lower = FALSE;
#ifdef _AVP_DEBUGGING
diff --git a/plugins/opcua/opcua.c b/plugins/opcua/opcua.c
index a577c44c1f..d42ace6c85 100644
--- a/plugins/opcua/opcua.c
+++ b/plugins/opcua/opcua.c
@@ -114,7 +114,7 @@ enum MessageType
};
/** OpcUa Transport Message Type Names */
-static char* g_szMessageTypes[] =
+static const char* g_szMessageTypes[] =
{
"Hello message",
"Acknowledge message",
diff --git a/plugins/opcua/opcua_simpletypes.c b/plugins/opcua/opcua_simpletypes.c
index 3fee5ff66f..0bbcb6f928 100644
--- a/plugins/opcua/opcua_simpletypes.c
+++ b/plugins/opcua/opcua_simpletypes.c
@@ -450,14 +450,14 @@ void parseXmlElement(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, int hfIndex
void parseFloat(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, int hfIndex)
{
- proto_tree_add_item(tree, hfIndex, tvb, *pOffset, sizeof(gfloat), ENC_LITTLE_ENDIAN);
- *pOffset += sizeof(gfloat);
+ proto_tree_add_item(tree, hfIndex, tvb, *pOffset, (int)sizeof(gfloat), ENC_LITTLE_ENDIAN);
+ *pOffset += (int)sizeof(gfloat);
}
void parseDouble(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, int hfIndex)
{
- proto_tree_add_item(tree, hfIndex, tvb, *pOffset, sizeof(gdouble), ENC_LITTLE_ENDIAN);
- *pOffset += sizeof(gdouble);
+ proto_tree_add_item(tree, hfIndex, tvb, *pOffset, (int)sizeof(gdouble), ENC_LITTLE_ENDIAN);
+ *pOffset += (int)sizeof(gdouble);
}
void parseDateTime(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, int hfIndex)
diff --git a/plugins/profinet/packet-dcerpc-pn-io.c b/plugins/profinet/packet-dcerpc-pn-io.c
index a7eb546572..0497ec56b5 100644
--- a/plugins/profinet/packet-dcerpc-pn-io.c
+++ b/plugins/profinet/packet-dcerpc-pn-io.c
@@ -6737,7 +6737,7 @@ dissect_ARFSUDataAdjust_block(tvbuff_t *tvb, int offset,
return offset;
}
-static char* decode_ARType_spezial(guint16 ARType, guint16 ARAccess)
+static const char* decode_ARType_spezial(guint16 ARType, guint16 ARAccess)
{
if (ARType == 0x0001)
return ("IO Controller AR");
diff --git a/plugins/profinet/packet-pn-mrp.c b/plugins/profinet/packet-pn-mrp.c
index 46505cd281..ccc79ae4f9 100644
--- a/plugins/profinet/packet-pn-mrp.c
+++ b/plugins/profinet/packet-pn-mrp.c
@@ -232,7 +232,7 @@ dissect_PNMRP_LinkDown(tvbuff_t *tvb, int offset,
return offset;
}
-static char * mrp_Prio2msg(guint16 prio)
+static const char * mrp_Prio2msg(guint16 prio)
{
if (prio == 0x0000)
diff --git a/plugins/wimax/crc.c b/plugins/wimax/crc.c
index 7b92868333..b2dc4090dd 100644
--- a/plugins/wimax/crc.c
+++ b/plugins/wimax/crc.c
@@ -28,7 +28,7 @@
#include "crc.h"
-#define WMAX_MAC_CRC32_POLYNOMIAL 0x04c11db7L /* polynomial used in calculating the CRC-32 checksum */
+#define WMAX_MAC_CRC32_POLYNOMIAL 0x04c11db7U /* polynomial used in calculating the CRC-32 checksum */
#define CCITT_X25_CRC16_POLYNOMIAL 0x1021 /* polynomial used in calculating the CRC-16 checksum */
#define WMAX_MAC_CRC8_POLYNOMIAL 0x07 /* polynomial used in calculating the CRC-8 checksum */
#define CRC32_INITIAL_VALUE 0xFFFFFFFF
@@ -66,7 +66,7 @@ void wimax_mac_gen_crc32_table(void)
crc = ( index << 24 );
for ( bit = 0; bit < 8; bit++ )
{
- if ( crc & 0x80000000L )
+ if ( crc & 0x80000000U )
crc = ( crc << 1 ) ^ WMAX_MAC_CRC32_POLYNOMIAL;
else
crc = ( crc << 1 );
diff --git a/plugins/wimax/mac_hd_generic_decoder.c b/plugins/wimax/mac_hd_generic_decoder.c
index 1cc60fdfcb..c869c91417 100644
--- a/plugins/wimax/mac_hd_generic_decoder.c
+++ b/plugins/wimax/mac_hd_generic_decoder.c
@@ -703,9 +703,9 @@ void dissect_mac_header_generic_decoder(tvbuff_t *tvb, packet_info *pinfo, proto
static guint8 frag_number[MAX_CID];
static guint cid_list[MAX_CID];
static guint cid_base;
- static char *reassem_str = "Reassembled Data transport PDU (%u bytes)";
- static char *data_str = "Data transport PDU (%u bytes)";
- char *str_ptr;
+ static const char reassem_str[] = "Reassembled Data transport PDU (%u bytes)";
+ static const char data_str[] = "Data transport PDU (%u bytes)";
+ const char *str_ptr;
gint length, i, cid_index;
guint tvb_len, ret_length, ubyte, new_tvb_len;
guint new_payload_len = 0;
@@ -819,7 +819,7 @@ void dissect_mac_header_generic_decoder(tvbuff_t *tvb, packet_info *pinfo, proto
{
if (length >= (gint)sizeof(mac_crc))
{
- length -= sizeof(mac_crc);
+ length -= (int)sizeof(mac_crc);
}
}
generic_item = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, length, "Encrypted PDU (%u bytes)", length);
@@ -986,7 +986,7 @@ void dissect_mac_header_generic_decoder(tvbuff_t *tvb, packet_info *pinfo, proto
proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, length, "Error - the frame is too short (%u bytes)", length);
return;
}
- length -= sizeof(mac_crc);
+ length -= (int)sizeof(mac_crc);
}
while (length > 0)
{
@@ -1029,10 +1029,10 @@ void dissect_mac_header_generic_decoder(tvbuff_t *tvb, packet_info *pinfo, proto
while (pinfo->fd->num > cid_adj_array_size)
{
cid_adj_array_size += 1024;
- cid_adj_array = g_realloc(cid_adj_array, sizeof(guint) * cid_adj_array_size);
- frag_num_array = g_realloc(frag_num_array, sizeof(guint8) * cid_adj_array_size);
+ cid_adj_array = g_realloc(cid_adj_array, (int)sizeof(guint) * cid_adj_array_size);
+ frag_num_array = g_realloc(frag_num_array, (int)sizeof(guint8) * cid_adj_array_size);
/* Clear the added memory */
- memset(&cid_adj_array[cid_adj_array_size - 1024], 0, sizeof(guint) * 1024);
+ memset(&cid_adj_array[cid_adj_array_size - 1024], 0, (int)sizeof(guint) * 1024);
}
if (first_gmh)
{
@@ -1220,11 +1220,11 @@ check_crc:
/* check the length */
if (MIN(tvb_len, tvb_reported_length(tvb)) >= mac_len)
{ /* get the CRC */
- mac_crc = tvb_get_ntohl(tvb, mac_len - sizeof(mac_crc));
+ mac_crc = tvb_get_ntohl(tvb, mac_len - (int)sizeof(mac_crc));
/* calculate the CRC */
- calculated_crc = wimax_mac_calc_crc32(tvb_get_ptr(tvb, 0, mac_len - sizeof(mac_crc)), mac_len - sizeof(mac_crc));
+ calculated_crc = wimax_mac_calc_crc32(tvb_get_ptr(tvb, 0, mac_len - (int)sizeof(mac_crc)), mac_len - (int)sizeof(mac_crc));
/* display the CRC */
- generic_item = proto_tree_add_item(tree, hf_mac_header_generic_crc, tvb, mac_len - sizeof(mac_crc), sizeof(mac_crc), ENC_BIG_ENDIAN);
+ generic_item = proto_tree_add_item(tree, hf_mac_header_generic_crc, tvb, mac_len - (int)sizeof(mac_crc), (int)sizeof(mac_crc), ENC_BIG_ENDIAN);
if (mac_crc != calculated_crc)
{
proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc);
diff --git a/plugins/wimax/msg_dlmap.c b/plugins/wimax/msg_dlmap.c
index 91ca190284..ba51129b0c 100644
--- a/plugins/wimax/msg_dlmap.c
+++ b/plugins/wimax/msg_dlmap.c
@@ -2180,7 +2180,7 @@ gint wimax_decode_dlmapc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *base_tre
ti_dlmap_ies = proto_tree_add_text(tree, tvb, offset, length, "DL-MAP IEs (%d bytes)", length);
ie_tree = proto_item_add_subtree(ti_dlmap_ies, ett_dlmap_ie);
- /* length = BYTE_TO_NIB(mac_len - sizeof(mac_crc) - 1); */ /* convert length to nibbles */
+ /* length = BYTE_TO_NIB(mac_len - (int)sizeof(mac_crc) - 1); */ /* convert length to nibbles */
while (dl_ie_count--) {
nib += dissect_dlmap_ie(ie_tree, bufptr, nib, tvb_len * 2, tvb);
@@ -2212,11 +2212,11 @@ gint wimax_decode_dlmapc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *base_tre
/* check the length */
if (MIN(tvb_len, tvb_reported_length(tvb)) >= mac_len)
{ /* get the CRC */
- mac_crc = tvb_get_ntohl(tvb, mac_len - sizeof(mac_crc));
+ mac_crc = tvb_get_ntohl(tvb, mac_len - (int)sizeof(mac_crc));
/* calculate the CRC */
- calculated_crc = wimax_mac_calc_crc32(tvb_get_ptr(tvb, 0, mac_len - sizeof(mac_crc)), mac_len - sizeof(mac_crc));
+ calculated_crc = wimax_mac_calc_crc32(tvb_get_ptr(tvb, 0, mac_len - (int)sizeof(mac_crc)), mac_len - (int)sizeof(mac_crc));
/* display the CRC */
- generic_item = proto_tree_add_item(base_tree, hf_mac_header_compress_dlmap_crc, tvb, mac_len - sizeof(mac_crc), sizeof(mac_crc), ENC_BIG_ENDIAN);
+ generic_item = proto_tree_add_item(base_tree, hf_mac_header_compress_dlmap_crc, tvb, mac_len - (int)sizeof(mac_crc), (int)sizeof(mac_crc), ENC_BIG_ENDIAN);
if (mac_crc != calculated_crc)
{
proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc);
diff --git a/plugins/wimax/packet-wmx.c b/plugins/wimax/packet-wmx.c
index fbb4a7b540..d1574e2f34 100644
--- a/plugins/wimax/packet-wmx.c
+++ b/plugins/wimax/packet-wmx.c
@@ -597,11 +597,11 @@ static gint ett_wimax_cdma = -1;
static gint ett_wimax_ffb = -1;
#endif
-static gchar *tlv_val_1byte = "TLV value: %s (0x%02x)";
-static gchar *tlv_val_2byte = "TLV value: %s (0x%04x)";
-static gchar *tlv_val_3byte = "TLV value: %s (0x%06x)";
-static gchar *tlv_val_4byte = "TLV value: %s (0x%08x)";
-static gchar *tlv_val_5byte = "TLV value: %s (0x%08x...)";
+static const gchar tlv_val_1byte[] = "TLV value: %s (0x%02x)";
+static const gchar tlv_val_2byte[] = "TLV value: %s (0x%04x)";
+static const gchar tlv_val_3byte[] = "TLV value: %s (0x%06x)";
+static const gchar tlv_val_4byte[] = "TLV value: %s (0x%08x)";
+static const gchar tlv_val_5byte[] = "TLV value: %s (0x%08x...)";
/*************************************************************/
/* add_tlv_subtree() */
@@ -627,7 +627,7 @@ proto_tree *add_tlv_subtree(tlv_info_t *this, gint idx, proto_tree *tree, int hf
guint8 size_of_tlv_length_field;
guint8 tlv_type;
guint32 tlv_value;
- gchar *hex_fmt;
+ const gchar *hex_fmt;
/* Retrieve the necessary TLV information */
tlv_val_offset = get_tlv_value_offset(this);
@@ -719,7 +719,7 @@ proto_tree *add_protocol_subtree(tlv_info_t *this, gint idx, proto_tree *tree, i
guint32 tlv_value;
va_list ap; /* points to each unnamed arg in turn */
gchar *message = NULL;
- gchar *hex_fmt;
+ const gchar *hex_fmt;
/* Retrieve the necessary TLV information */
tlv_val_offset = get_tlv_value_offset(this);
diff --git a/plugins/wimax/wimax_harq_map_decoder.c b/plugins/wimax/wimax_harq_map_decoder.c
index 3904e1d2d4..b601b76bef 100644
--- a/plugins/wimax/wimax_harq_map_decoder.c
+++ b/plugins/wimax/wimax_harq_map_decoder.c
@@ -140,7 +140,7 @@ void dissector_wimax_harq_map_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_t
{ /* add the UL-MAp IEs info */
proto_item_append_text(parent_item, ",UL-MAP IEs");
/* process the compact ul_map ies */
- while(offset < (length - sizeof(harq_map_msg_crc)))
+ while(offset < (length - (int)sizeof(harq_map_msg_crc)))
{ /* decode Compact UL-MAP IEs */
ie_length = wimax_compact_ulmap_ie_decoder(harq_map_tree, pinfo, tvb, offset, nibble_offset);
/* Prevent endless loop with erroneous data. */
@@ -160,11 +160,11 @@ void dissector_wimax_harq_map_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_t
/* add the CRC info */
proto_item_append_text(parent_item, ",CRC");
/* get the CRC */
- harq_map_msg_crc = tvb_get_ntohl(tvb, length - sizeof(harq_map_msg_crc));
+ harq_map_msg_crc = tvb_get_ntohl(tvb, length - (int)sizeof(harq_map_msg_crc));
/* calculate the HARQ MAM Message CRC */
- calculated_crc = wimax_mac_calc_crc32(tvb_get_ptr(tvb, 0, length - sizeof(harq_map_msg_crc)), length - sizeof(harq_map_msg_crc));
+ calculated_crc = wimax_mac_calc_crc32(tvb_get_ptr(tvb, 0, length - (int)sizeof(harq_map_msg_crc)), length - (int)sizeof(harq_map_msg_crc));
/* display the CRC */
- it = proto_tree_add_item(harq_map_tree, hf_harq_map_msg_crc, tvb, length - sizeof(harq_map_msg_crc), sizeof(harq_map_msg_crc), ENC_BIG_ENDIAN);
+ it = proto_tree_add_item(harq_map_tree, hf_harq_map_msg_crc, tvb, length - (int)sizeof(harq_map_msg_crc), (int)sizeof(harq_map_msg_crc), ENC_BIG_ENDIAN);
/* verify the CRC */
if (harq_map_msg_crc != calculated_crc)
{
diff --git a/plugins/wimaxasncp/packet-wimaxasncp.c b/plugins/wimaxasncp/packet-wimaxasncp.c
index b56102e571..f907b078c8 100644
--- a/plugins/wimaxasncp/packet-wimaxasncp.c
+++ b/plugins/wimaxasncp/packet-wimaxasncp.c
@@ -1972,7 +1972,7 @@ static guint dissect_wimaxasncp_backend(
guint offset = 0;
guint16 ui16;
guint32 ui32;
- guint8 *pmsid;
+ const guint8 *pmsid;
guint16 tid = 0;
gboolean dbit_show;
@@ -2518,7 +2518,7 @@ static void add_tlv_reg_info(
{
char *name;
char *abbrev;
- char *blurb;
+ const char *blurb;
/* ------------------------------------------------------------------------
* add root reg info
@@ -2627,32 +2627,25 @@ static void add_tlv_reg_info(
break;
case WIMAXASNCP_TLV_ID:
- g_free(name);
g_free(abbrev);
- name = "IPv4 Address";
-
abbrev = alnumerize(
g_strdup_printf("wimaxasncp.tlv.%s.ipv4_value", tlv->name));
add_reg_info(
- &tlv->hf_ipv4, name, abbrev, FT_IPv4, BASE_NONE, blurb);
-
- name = "IPv6 Address";
+ &tlv->hf_ipv4, "IPv4 Address", abbrev, FT_IPv4, BASE_NONE, blurb);
abbrev = alnumerize(
g_strdup_printf("wimaxasncp.tlv.%s.ipv6_value", tlv->name));
add_reg_info(
- &tlv->hf_ipv6, name, abbrev, FT_IPv6, BASE_NONE, blurb);
-
- name = "BS ID";
+ &tlv->hf_ipv6, "IPv6 Address", abbrev, FT_IPv6, BASE_NONE, blurb);
abbrev = alnumerize(
g_strdup_printf("wimaxasncp.tlv.%s.bsid_value", tlv->name));
add_reg_info(
- &tlv->hf_bsid, name, abbrev, FT_ETHER, BASE_NONE, blurb);
+ &tlv->hf_bsid, "BS ID", abbrev, FT_ETHER, BASE_NONE, blurb);
break;
@@ -2687,24 +2680,19 @@ static void add_tlv_reg_info(
break;
case WIMAXASNCP_TLV_IP_ADDRESS:
- g_free(name);
g_free(abbrev);
- name = "IPv4 Address";
-
abbrev = alnumerize(
g_strdup_printf("wimaxasncp.tlv.%s.ipv4_value", tlv->name));
add_reg_info(
- &tlv->hf_ipv4, name, abbrev, FT_IPv4, BASE_NONE, blurb);
-
- name = "IPv6 Address";
+ &tlv->hf_ipv4, "IPv4 Address", abbrev, FT_IPv4, BASE_NONE, blurb);
abbrev = alnumerize(
g_strdup_printf("wimaxasncp.tlv.%s.ipv6_value", tlv->name));
add_reg_info(
- &tlv->hf_ipv6, name, abbrev, FT_IPv6, BASE_NONE, blurb);
+ &tlv->hf_ipv6, "IPv6 Address", abbrev, FT_IPv6, BASE_NONE, blurb);
break;
diff --git a/plugins/wimaxasncp/wimaxasncp_dict.l b/plugins/wimaxasncp/wimaxasncp_dict.l
index 71259ef51c..9c55a79d97 100644
--- a/plugins/wimaxasncp/wimaxasncp_dict.l
+++ b/plugins/wimaxasncp/wimaxasncp_dict.l
@@ -85,7 +85,7 @@ typedef struct entity_t {
#define MAX_INCLUDE_DEPTH 10
#define YY_INPUT(buf,result,max_size) { result = current_yyinput(buf,max_size); }
#define ECHO
-#define APPEND(txt,len) append_to_buffer(txt,len)
+#define APPEND(txt,len) append_to_buffer(txt,(int)len)
static entity_t ents;
static YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
@@ -108,7 +108,7 @@ static gint16 *attr_uint16;
static guint wimaxasncp_bits(guint bits, char *n);
static gint wimaxasncp_decode_type(const gchar *name);
static void wimaxasncp_dict_debug(const gchar *fmt, ...);
-static void append_to_buffer(gchar *txt, int len);
+static void append_to_buffer(const gchar *txt, int len);
static FILE *wimaxasncp_dict_open(const gchar*, const gchar*);
static GString *dict_error = NULL;
@@ -313,7 +313,7 @@ since_attr since=\042
}
<GET_UINT_ATTR>{number} {
- *attr_uint = strtoul(yytext,NULL,0);
+ *attr_uint = (guint)strtoul(yytext,NULL,0);
D(("%s\n",yytext););
attr_uint = NULL;
BEGIN END_ATTR;
@@ -531,7 +531,7 @@ void wimaxasncp_dict_unused(void) {
yy_top_state();
}
-static void append_to_buffer(gchar *txt, int len) {
+static void append_to_buffer(const gchar *txt, int len) {
if (strbuf == NULL) {
read_ptr = write_ptr = strbuf = g_malloc(size_strbuf);