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>
This commit is contained in:
parent
e00312360e
commit
f80205e32f
|
@ -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));
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue