diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-04-30 11:13:50 -0700 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2015-08-27 12:30:38 +0000 |
commit | f1c7cad16985ccb24ccf0510e47826bdea21c8e4 (patch) | |
tree | ac4dbff33beb646be355135ca1625ec2d4429522 | |
parent | b19b729ff4a65c6ad90dc7dbc57c0f2b5be55908 (diff) | |
download | wireshark-f1c7cad16985ccb24ccf0510e47826bdea21c8e4.tar.gz |
Make bit masks unsigned.
To quote a run-time error reported in
https://www.wireshark.org/lists/wireshark-dev/201504/msg00084.html
"left shift of 1 by 31 places cannot be represented in type 'int'", so
use type "unsigned int" instead, by shifting 1U rather than 1 left.
Change-Id: I95cf5ce53aa3b94ccb9f246d31863715bb682409
Reviewed-on: https://code.wireshark.org/review/8252
Reviewed-by: Guy Harris <guy@alum.mit.edu>
(cherry picked from commit f80205e32fd0d6b0f1003cdebcbcddbac9cfb9b7)
Reviewed-on: https://code.wireshark.org/review/10277
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
-rw-r--r-- | epan/proto.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/epan/proto.c b/epan/proto.c index 788d6a59ce..c2ca5c6775 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -5709,7 +5709,7 @@ proto_register_subtree_array(gint *const *indices, const int num_indices) /* set new items to 0 */ /* XXX, slow!!! optimize when needed (align 'i' to 32, and set rest of guint32 to 0) */ for (i = num_tree_types; i < num_tree_types + num_indices; i++) - tree_is_expanded[i >> 5] &= ~(1 << (i & 31)); + tree_is_expanded[i >> 5] &= ~(1U << (i & 31)); } /* @@ -8235,7 +8235,7 @@ gboolean tree_expanded(int tree_type) { g_assert(tree_type >= 0 && tree_type < num_tree_types); - return tree_is_expanded[tree_type >> 5] & (1 << (tree_type & 31)); + return tree_is_expanded[tree_type >> 5] & (1U << (tree_type & 31)); } void @@ -8244,9 +8244,9 @@ tree_expanded_set(int tree_type, gboolean value) g_assert(tree_type >= 0 && tree_type < num_tree_types); if (value) - tree_is_expanded[tree_type >> 5] |= (1 << (tree_type & 31)); + tree_is_expanded[tree_type >> 5] |= (1U << (tree_type & 31)); else - tree_is_expanded[tree_type >> 5] &= ~(1 << (tree_type & 31)); + tree_is_expanded[tree_type >> 5] &= ~(1U << (tree_type & 31)); } /* |