aboutsummaryrefslogtreecommitdiffstats
path: root/asn1/ranap/packet-ranap-template.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-04-30 20:03:39 -0700
committerGuy Harris <guy@alum.mit.edu>2015-05-01 06:50:36 +0000
commitb84972635117aa5cac7f8e6296d07ceb51bfe5e2 (patch)
tree89f3c0baff68f63dcadb737de9e4da3c2b97bdfc /asn1/ranap/packet-ranap-template.c
parent91515a008143901473e018033a76933abfec3c1f (diff)
Fix some cases where we're shifting a signed 1 left.
Shift 1U instead, to make sure it's unsigned; the result of, for example, the result of shifting a signed value left is undefined if the value times 2^{shift count} doesn't fit in the *signed* type of the shifted value. That means, in particular, that the result of shifting 1 left by {number of bits in an int - 1} is undefined. (In *practice*, it'll probably be -2^32, with the bit you want set, but that's not guaranteed, and GCC 5.1 seems not to like it.) Make some other left-hand operands of <<, and some variables holding results from shifts of that sort, unsigned, while we're at it. Change-Id: Ie72a9d0d518f59b35948267d10c80735d162e8bb Reviewed-on: https://code.wireshark.org/review/8264 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'asn1/ranap/packet-ranap-template.c')
-rw-r--r--asn1/ranap/packet-ranap-template.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/asn1/ranap/packet-ranap-template.c b/asn1/ranap/packet-ranap-template.c
index e20cc7b967..446fd8374c 100644
--- a/asn1/ranap/packet-ranap-template.c
+++ b/asn1/ranap/packet-ranap-template.c
@@ -104,9 +104,9 @@ static gboolean glbl_dissect_container = FALSE;
*
* Only these two needed currently
*/
-#define IMSG (1<<16)
-#define SOUT (2<<16)
-#define SPECIAL (4<<16)
+#define IMSG (1U<<16)
+#define SOUT (2U<<16)
+#define SPECIAL (4U<<16)
int pdu_type = 0; /* 0 means wildcard */