diff options
author | Michael Mann <mmann78@netscape.net> | 2016-07-16 12:44:47 -0400 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2016-07-16 19:46:05 +0000 |
commit | 6d8ea38773a127fe68d967a3b724738e6c725dea (patch) | |
tree | 6c62f37a217e1396a565a2b237651cef372f77bf | |
parent | ed307484a74fdd0ef7fb66daa2b48c69b2929076 (diff) |
wmem_map.c: Address some VS Code Analysis warnings.
size_t can vary on size, so you can't always mix it with guint.
Change-Id: I7e2ea3a990dd4df99422f6113aa3ae53dbf2bc4f
Reviewed-on: https://code.wireshark.org/review/16501
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r-- | epan/wmem/wmem_map.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/epan/wmem/wmem_map.c b/epan/wmem/wmem_map.c index fc81c79fa0..4355ce5c50 100644 --- a/epan/wmem/wmem_map.c +++ b/epan/wmem/wmem_map.c @@ -57,7 +57,7 @@ struct _wmem_map_t { * value for efficiency in hashing, since finding the actual capacity * becomes just a left-shift (see the CAPACITY macro) whereas taking * logarithms is expensive. */ - guint capacity; + size_t capacity; wmem_map_item_t **table; @@ -73,7 +73,7 @@ struct _wmem_map_t { /* Macro for calculating the real capacity of the map by using a left-shift to * do the 2^x operation. */ -#define CAPACITY(MAP) ((guint)(1 << (MAP)->capacity)) +#define CAPACITY(MAP) ((size_t)(1 << (MAP)->capacity)) /* Efficient universal integer hashing: * https://en.wikipedia.org/wiki/Universal_hashing#Avoiding_modular_arithmetic @@ -103,7 +103,8 @@ static inline void wmem_map_grow(wmem_map_t *map) { wmem_map_item_t **old_table, *cur, *nxt; - guint old_cap, i, slot; + size_t old_cap, i; + guint slot; /* store the old table and capacity */ old_table = map->table; |