From 6d8ea38773a127fe68d967a3b724738e6c725dea Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Sat, 16 Jul 2016 12:44:47 -0400 Subject: 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 Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris --- epan/wmem/wmem_map.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'epan/wmem') 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; -- cgit v1.2.1