diff options
author | Angelo Mantellini <manangel@cisco.com> | 2019-02-05 08:50:26 +0100 |
---|---|---|
committer | Angelo Mantellini <manangel@cisco.com> | 2019-02-06 16:23:04 +0100 |
commit | 9f68541e0f55495d61dd9e583bec38740a247597 (patch) | |
tree | 55519e34159ac1eb691e080e4c1eab5b0e4847bd /libparc/parc/algol/parc_HashMap.c | |
parent | b77148ddc3def71e6c412c3afb5f1c20be2d77cd (diff) |
[HICN-26] Windows compatibilty for libparc
Change-Id: I6ebff82a81a2bf42fa3bf210ff0e6e530ce21915
Signed-off-by: Angelo Mantellini <manangel@cisco.com>
Diffstat (limited to 'libparc/parc/algol/parc_HashMap.c')
-rw-r--r-- | libparc/parc/algol/parc_HashMap.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libparc/parc/algol/parc_HashMap.c b/libparc/parc/algol/parc_HashMap.c index 5e73a4c3..58137b20 100644 --- a/libparc/parc/algol/parc_HashMap.c +++ b/libparc/parc/algol/parc_HashMap.c @@ -91,7 +91,7 @@ _parcHashMap_GetEntry(const PARCHashMap *hashMap, const PARCObject *key) { PARCHashCode keyHash = parcObject_HashCode(key); - int bucket = keyHash % hashMap->capacity; + int bucket = (int)(keyHash % hashMap->capacity); _PARCHashMapEntry *result = NULL; @@ -399,7 +399,7 @@ _parcHashMap_Resize(PARCHashMap *hashMap, size_t newCapacity) while (parcIterator_HasNext(elementIt)) { _PARCHashMapEntry *entry = parcIterator_Next(elementIt); PARCHashCode keyHash = parcObject_HashCode(entry->key); - int newBucket = keyHash % newCapacity; + int newBucket = (int)(keyHash % newCapacity); if (newBuckets[newBucket] == NULL) { newBuckets[newBucket] = parcLinkedList_Create(); } @@ -422,7 +422,7 @@ parcHashMap_Remove(PARCHashMap *hashMap, const PARCObject *key) { PARCHashCode keyHash = parcObject_HashCode(key); - int bucket = keyHash % hashMap->capacity; + int bucket = (int)(keyHash % hashMap->capacity); bool result = false; @@ -476,7 +476,7 @@ parcHashMap_Put(PARCHashMap *hashMap, const PARCObject *key, const PARCObject *v entry = _parcHashMapEntry_Create(key, value); PARCHashCode keyHash = parcObject_HashCode(key); - int bucket = keyHash % hashMap->capacity; + int bucket = (int)(keyHash % hashMap->capacity); if (hashMap->buckets[bucket] == NULL) { hashMap->buckets[bucket] = parcLinkedList_Create(); @@ -560,7 +560,7 @@ _parcHashMap_Init(PARCHashMap *map __attribute__((unused))) state->listIterator = NULL; for (size_t i = 0; i < map->capacity; ++i) { if (map->buckets[i] != NULL) { - state->bucket = i; + state->bucket = (int)i; state->listIterator = parcLinkedList_CreateIterator(map->buckets[i]); break; } |