diff options
author | Guy Harris <guy@alum.mit.edu> | 2012-12-26 05:57:06 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2012-12-26 05:57:06 +0000 |
commit | 8ed7a73e22c049a2e013bb436e599bff41fc5b9b (patch) | |
tree | ad4a4cc6fb4ff4d3e3ffe3a3f8e3d056e441ae46 /epan/dissectors/packet-dmp.c | |
parent | 8ede6b7dc09aa636f87147ab432a137c209e8aca (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-dmp.c')
-rw-r--r-- | epan/dissectors/packet-dmp.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/epan/dissectors/packet-dmp.c b/epan/dissectors/packet-dmp.c index 959e3a8430..f04c39dc20 100644 --- a/epan/dissectors/packet-dmp.c +++ b/epan/dissectors/packet-dmp.c @@ -1674,7 +1674,7 @@ static gchar *dissect_7bit_string (tvbuff_t *tvb, gint offset, gint length) return (gchar *) decoded; } -static gchar *dissect_thales_mts_id (tvbuff_t *tvb, gint offset, gint length) +static const gchar *dissect_thales_mts_id (tvbuff_t *tvb, gint offset, gint length) { /* Thales XOmail uses this format: "MTA-NAME/000000000000" */ if (length >= 7 && length <= 22) { @@ -1687,7 +1687,7 @@ static gchar *dissect_thales_mts_id (tvbuff_t *tvb, gint offset, gint length) return ILLEGAL_FORMAT; } -static gchar *dissect_thales_ipm_id (tvbuff_t *tvb, gint offset, gint length, gint modifier) +static const gchar *dissect_thales_ipm_id (tvbuff_t *tvb, gint offset, gint length, gint modifier) { /* Thales XOmail uses this format: "<prefix>0000 YYMMDDhhmmssZ" */ if (length >= 6 && length <= 20 && modifier >= 0 && modifier <= 2) { @@ -1842,12 +1842,12 @@ static gint dissect_dmp_sic (tvbuff_t *tvb, packet_info *pinfo, } else if ((key & 0xF0) == 0xB0) { /* bit 7-4: 1011 */ length = 7; bytes = 6; - value = ((guint64)tvb_get_ntohs (tvb, offset) & 0x0FFF) << 32 | + value = ((guint64)(tvb_get_ntohs (tvb, offset) & 0x0FFF)) << 32 | tvb_get_ntohl (tvb, offset + 2); } else if ((key & 0xF0) == 0x90) { /* bit 7-4: 1001 */ length = 8; bytes = 7; - value = ((guint64)(tvb_get_ntohl (tvb, offset)>>8) & 0x0FFF)<<32 | + value = ((guint64)((tvb_get_ntohl (tvb, offset)>>8) & 0x0FFF))<<32 | tvb_get_ntohl (tvb, offset + 3); } else { /* bit 7-4: 0xxx or 1000 */ length = 5; @@ -2692,7 +2692,7 @@ static gint dissect_mts_identifier (tvbuff_t *tvb, packet_info *pinfo _U_, proto gint offset, gboolean subject) { proto_item *hidden_item; - gchar *mts_id; + const gchar *mts_id; if (dmp.msg_id_type == X400_MSG_ID || dmp_nat_decode == NAT_DECODE_DMP) { mts_id = dissect_7bit_string (tvb, offset, dmp.mts_id_length); @@ -2725,7 +2725,7 @@ static gint dissect_ipm_identifier (tvbuff_t *tvb, packet_info *pinfo _U_, proto { proto_tree *field_tree; proto_item *tf, *hidden_item; - gchar *ipm_id; + const gchar *ipm_id; gint length, modifier, ipm_id_length; length = tvb_get_guint8 (tvb, offset); @@ -3491,7 +3491,8 @@ static gint dissect_dmp_notification (tvbuff_t *tvb, packet_info *pinfo _U_, /* Ref chapter 6.2.1.2.8 SecurityCategories */ static gint dissect_dmp_security_category (tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree, gchar **label_string, + proto_tree *tree, + const gchar **label_string, gint offset, guint8 ext) { proto_tree *field_tree = NULL; @@ -3602,7 +3603,7 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo, proto_tree *field_tree = NULL; proto_item *en = NULL, *ei = NULL, *tf = NULL; proto_item *hidden_item; - gchar *label_string = ep_strdup (""); + const char *label_string = ep_strdup (""); const gchar *class_name = NULL; guint8 message, dmp_sec_pol, dmp_sec_class, dmp_nation = 0, exp_time, dtg; gint32 secs = 0; |