From 3c4bb57c1333bb3daa2e72579b9857430741657b Mon Sep 17 00:00:00 2001 From: Vincent Torri Date: Wed, 27 Mar 2019 10:59:31 -0400 Subject: [PATCH] eina benchmark: fix warnings on Windows 64 bits Summary: long is always a 32 bits type on Windows Test Plan: compilation Reviewers: raster, zmike, cedric Reviewed By: zmike Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8482 --- src/benchmarks/eina/ecore_hash.c | 12 ++++++------ src/benchmarks/eina/ecore_sheap.c | 7 ++++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/benchmarks/eina/ecore_hash.c b/src/benchmarks/eina/ecore_hash.c index 4d40588..374a0e0 100644 --- a/src/benchmarks/eina/ecore_hash.c +++ b/src/benchmarks/eina/ecore_hash.c @@ -460,7 +460,7 @@ _ecore_hash_bucket_destroy(Ecore_Hash_Node *list, static int _ecore_hash_node_add(Ecore_Hash *hash, Ecore_Hash_Node *node) { - unsigned long hash_val; + size_t hash_val; CHECK_PARAM_POINTER_RETURN("hash", hash, FALSE); CHECK_PARAM_POINTER_RETURN("node", node, FALSE); @@ -471,7 +471,7 @@ _ecore_hash_node_add(Ecore_Hash *hash, Ecore_Hash_Node *node) /* Compute the position in the table */ if (!hash->hash_func) - hash_val = (unsigned long)node->key % ecore_prime_table[hash->size]; + hash_val = (size_t)node->key % ecore_prime_table[hash->size]; else hash_val = ECORE_COMPUTE_HASH(hash, node->key); @@ -522,14 +522,14 @@ ecore_hash_remove(Ecore_Hash *hash, const void *key) { Ecore_Hash_Node *node = NULL; Ecore_Hash_Node *list; - unsigned long hash_val; + size_t hash_val; void *ret = NULL; CHECK_PARAM_POINTER_RETURN("hash", hash, NULL); /* Compute the position in the table */ if (!hash->hash_func) - hash_val = (unsigned long )key % ecore_prime_table[hash->size]; + hash_val = (size_t)key % ecore_prime_table[hash->size]; else hash_val = ECORE_COMPUTE_HASH(hash, key); @@ -626,7 +626,7 @@ ecore_hash_find(Ecore_Hash *hash, Ecore_Compare_Cb compare, const void *value) static Ecore_Hash_Node * _ecore_hash_node_get(Ecore_Hash *hash, const void *key) { - unsigned long hash_val; + size_t hash_val; Ecore_Hash_Node *node = NULL; CHECK_PARAM_POINTER_RETURN("hash", hash, NULL); @@ -636,7 +636,7 @@ _ecore_hash_node_get(Ecore_Hash *hash, const void *key) /* Compute the position in the table */ if (!hash->hash_func) - hash_val = (unsigned long)key % ecore_prime_table[hash->size]; + hash_val = (size_t)key % ecore_prime_table[hash->size]; else hash_val = ECORE_COMPUTE_HASH(hash, key); diff --git a/src/benchmarks/eina/ecore_sheap.c b/src/benchmarks/eina/ecore_sheap.c index 448be97..e86c10b 100644 --- a/src/benchmarks/eina/ecore_sheap.c +++ b/src/benchmarks/eina/ecore_sheap.c @@ -4,6 +4,7 @@ #include #include +#include #include "Ecore_Data.h" @@ -452,10 +453,10 @@ _ecore_sheap_update_data(Ecore_Sheap *heap) int ecore_direct_compare(const void *key1, const void *key2) { - unsigned long k1, k2; + uintptr_t k1, k2; - k1 = (unsigned long)key1; - k2 = (unsigned long)key2; + k1 = (uintptr_t)key1; + k2 = (uintptr_t)key2; if (k1 > k2) return 1; -- 2.7.4