diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-04-30 11:13:50 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-04-30 18:14:38 +0000 |
commit | f80205e32fd0d6b0f1003cdebcbcddbac9cfb9b7 (patch) | |
tree | b710d6dc981957092643c3f1805fb4ce08ac2239 /epan/proto.c | |
parent | e00312360e437853cbd06fa75075e530a792901e (diff) |
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>
Diffstat (limited to 'epan/proto.c')
-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 d7e98bc89e..a5a6f32455 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -6151,7 +6151,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)); } /* @@ -9151,7 +9151,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 @@ -9160,9 +9160,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)); } /* |