aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-cops.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-cops.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-cops.c')
-rw-r--r--epan/dissectors/packet-cops.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/epan/dissectors/packet-cops.c b/epan/dissectors/packet-cops.c
index 4eeac3f4b7..0d41b09444 100644
--- a/epan/dissectors/packet-cops.c
+++ b/epan/dissectors/packet-cops.c
@@ -1058,7 +1058,7 @@ static int dissect_cops_object(tvbuff_t *tvb, packet_info *pinfo, guint8 op_code
/* Pad to 32bit boundary */
if (object_len % sizeof (guint32))
- object_len += (sizeof (guint32) - object_len % sizeof (guint32));
+ object_len += ((int)sizeof (guint32) - object_len % (int)sizeof (guint32));
return object_len;
}
@@ -1116,7 +1116,7 @@ static void dissect_cops_pr_objects(tvbuff_t *tvb, packet_info *pinfo, guint32 o
/* Pad to 32bit boundary */
if (object_len % sizeof (guint32))
- object_len += (sizeof (guint32) - object_len % sizeof (guint32));
+ object_len += ((int)sizeof (guint32) - object_len % (int)sizeof (guint32));
pr_len -= object_len - COPS_OBJECT_HDR_SIZE;
offset += object_len - COPS_OBJECT_HDR_SIZE;
@@ -1163,7 +1163,7 @@ static void dissect_cops_object_data(tvbuff_t *tvb, packet_info *pinfo, guint32
offset += 4;
} else if (c_type == 2) { /* IPv6 */
tvb_get_ipv6(tvb, offset, &ipv6addr);
- ifindex = tvb_get_ntohl(tvb, offset + sizeof ipv6addr);
+ ifindex = tvb_get_ntohl(tvb, offset + (int)sizeof ipv6addr);
ti = proto_tree_add_text(tree, tvb, offset, 20, "Contents: IPv6 address %s, ifIndex: %u",
ip6_to_str(&ipv6addr), ifindex);
itf_tree = proto_item_add_subtree(ti, ett_cops_itf);
@@ -1304,7 +1304,7 @@ static void dissect_cops_object_data(tvbuff_t *tvb, packet_info *pinfo, guint32
offset += 4;
} else if (c_type == 2) { /* IPv6 */
tvb_get_ipv6(tvb, offset, &ipv6addr);
- tcp_port = tvb_get_ntohs(tvb, offset + sizeof ipv6addr + 2);
+ tcp_port = tvb_get_ntohs(tvb, offset + (int)sizeof ipv6addr + 2);
ti = proto_tree_add_text(tree, tvb, offset, 20, "Contents: IPv6 address %s, TCP Port Number: %u",
ip6_to_str(&ipv6addr), tcp_port);
pdp_tree = proto_item_add_subtree(ti, ett_cops_pdp);