src/map.c

changeset 328
2bf1da3c411e
parent 327
fbc33813265b
child 374
be77fb2da242
     1.1 --- a/src/map.c	Thu Jun 21 16:00:37 2018 +0200
     1.2 +++ b/src/map.c	Thu Jun 21 16:10:19 2018 +0200
     1.3 @@ -154,7 +154,7 @@
     1.4      UcxAllocator *allocator = map->allocator;
     1.5      
     1.6      if (key.hash == 0) {
     1.7 -        key.hash = ucx_hash(key.data, key.len);
     1.8 +        key.hash = ucx_hash((const char*)key.data, key.len);
     1.9      }
    1.10      
    1.11      struct UcxMapKey mapkey;
    1.12 @@ -203,7 +203,7 @@
    1.13  
    1.14  static void* ucx_map_get_and_remove(UcxMap *map, UcxKey key, int remove) {
    1.15      if(key.hash == 0) {
    1.16 -        key.hash = ucx_hash((char*)key.data, key.len);
    1.17 +        key.hash = ucx_hash((const char*)key.data, key.len);
    1.18      }
    1.19      
    1.20      size_t slot = key.hash%map->size;
    1.21 @@ -247,7 +247,7 @@
    1.22      UcxKey key;
    1.23      key.data = data;
    1.24      key.len = len;
    1.25 -    key.hash = ucx_hash(data, len);
    1.26 +    key.hash = ucx_hash((const char*)data, len);
    1.27      return key;
    1.28  }
    1.29  

mercurial