diff options
| author | Tyge Løvset <[email protected]> | 2021-10-22 08:05:10 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2021-10-22 08:05:10 +0200 |
| commit | 4b5c7250b59401a8888b68f4b12f3ddd69f83741 (patch) | |
| tree | 0941403e1be0eb61cf428d96d2de4cccbaf83a86 /benchmarks/shootout2_cmap.cpp | |
| parent | f72f2ed6ccaf5c960e5b6f3a3e8a3e9702119c73 (diff) | |
| download | STC-modified-4b5c7250b59401a8888b68f4b12f3ddd69f83741.tar.gz STC-modified-4b5c7250b59401a8888b68f4b12f3ddd69f83741.zip | |
Some more fixes on shootout2_cmap.cpp: Removed warnings.
Diffstat (limited to 'benchmarks/shootout2_cmap.cpp')
| -rw-r--r-- | benchmarks/shootout2_cmap.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/benchmarks/shootout2_cmap.cpp b/benchmarks/shootout2_cmap.cpp index 10c66d89..6ad6b293 100644 --- a/benchmarks/shootout2_cmap.cpp +++ b/benchmarks/shootout2_cmap.cpp @@ -19,7 +19,7 @@ template<typename C> inline void destroy_me(C& c) { C().swap(c); } // cmap and khash template expansion
#define i_key int64_t
#define i_val int64_t
-#define i_hash c_default_hash32
+#define i_hash c_default_hash64
#define i_tag ii
#include <stc/cmap.h>
@@ -48,8 +48,8 @@ stc64_t rng; #define CMAP_DTOR(X) cmap_##X##_del(&map)
#define KMAP_SETUP(X, Key, Value) khash_t(ii)* map = kh_init(ii); khiter_t ki; int ret
-#define KMAP_PUT(X, key, val) (*(ki = kh_put(ii, map, key, &ret), map->vals[ki] = val, &map->vals[ki]))
-#define KMAP_EMPLACE(X, key, val) (ki = kh_put(ii, map, key, &ret), ret ? (map->vals[ki] = val, 0) : 0, map->vals[ki])
+#define KMAP_PUT(X, key, val) (*(ki = kh_put(ii, map, key, &ret), map->vals[ki] = val, map->vals+ki))
+#define KMAP_EMPLACE(X, key, val) (*(ki = kh_put(ii, map, key, &ret), ret ? (map->vals[ki] = val, 0) : 1, map->vals+ki))
#define KMAP_ERASE(X, key) ((ki = kh_get(ii, map, key)) != kh_end(map) ? kh_del(ii, map, ki), 1 : 0)
#define KMAP_FIND(X, key) (kh_get(ii, map, key) != kh_end(map))
#define KMAP_SIZE(X) kh_size(map)
|
