eina benchmark: fix warnings on Windows 64 bits
authorVincent Torri <vincent.torri@gmail.com>
Wed, 27 Mar 2019 14:59:31 +0000 (10:59 -0400)
committerJunsuChoi <jsuya.choi@samsung.com>
Tue, 2 Apr 2019 04:04:00 +0000 (13:04 +0900)
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
src/benchmarks/eina/ecore_sheap.c

index 4d40588..374a0e0 100644 (file)
@@ -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);
 
index 448be97..e86c10b 100644 (file)
@@ -4,6 +4,7 @@
 
 #include <stdlib.h>
 #include <string.h>
+#include <stdint.h>
 
 #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;