aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-sflow.c
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 /epan/dissectors/packet-sflow.c
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 'epan/dissectors/packet-sflow.c')
-rw-r--r--epan/dissectors/packet-sflow.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/epan/dissectors/packet-sflow.c b/epan/dissectors/packet-sflow.c
index 94a8fbdd76..6d9b0c9578 100644
--- a/epan/dissectors/packet-sflow.c
+++ b/epan/dissectors/packet-sflow.c
@@ -1746,7 +1746,7 @@ dissect_sflow_24_flow_sample(tvbuff_t *tvb, packet_info *pinfo,
proto_tree_add_text(tree, tvb, offset + 24, 4,
"Output interface: ifIndex %u", output & 0x7fffffff);
}
- offset += sizeof (flow_header);
+ offset += (int)sizeof (flow_header);
/* what kind of flow sample is it? */
packet_type = tvb_get_ntohl(tvb, offset);
@@ -2421,7 +2421,7 @@ dissect_sflow_24_counters_sample(tvbuff_t *tvb, proto_tree *tree, gint offset, p
val_to_str_const(g_ntohl(counters_header.counters_type),
sflow_245_counterstype, "Unknown type"));
- offset += sizeof (counters_header);
+ offset += (int)sizeof (counters_header);
/* most counters types have the "generic" counters first */
switch (g_ntohl(counters_header.counters_type)) {
@@ -2504,19 +2504,19 @@ dissect_sflow_24_counters_sample(tvbuff_t *tvb, proto_tree *tree, gint offset, p
switch (g_ntohl(counters_header.counters_type)) {
case SFLOW_245_COUNTERS_ETHERNET:
tvb_memcpy(tvb, (guint8 *) & ethc, offset, sizeof (ethc));
- offset += sizeof (ethc);
+ offset += (int)sizeof (ethc);
break;
case SFLOW_245_COUNTERS_TOKENRING:
tvb_memcpy(tvb, (guint8 *) & tokc, offset, sizeof (tokc));
- offset += sizeof (tokc);
+ offset += (int)sizeof (tokc);
break;
case SFLOW_245_COUNTERS_VG:
tvb_memcpy(tvb, (guint8 *) & vgc, offset, sizeof (vgc));
- offset += sizeof (vgc);
+ offset += (int)sizeof (vgc);
break;
case SFLOW_245_COUNTERS_VLAN:
tvb_memcpy(tvb, (guint8 *) & vlanc, offset, sizeof (vlanc));
- offset += sizeof (vlanc);
+ offset += (int)sizeof (vlanc);
break;
default: