diff options
| author | Tyge Løvset <[email protected]> | 2020-03-14 01:12:06 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-03-14 01:12:06 +0100 |
| commit | d878f6fb9bb3f700778202b437ab34e68a364440 (patch) | |
| tree | 7c497ed16fe2c101878781778f8df56857c74c15 | |
| parent | 8640dcd64d1eb20efb9a4bb04070f3850bd487cf (diff) | |
| download | STC-modified-d878f6fb9bb3f700778202b437ab34e68a364440.tar.gz STC-modified-d878f6fb9bb3f700778202b437ab34e68a364440.zip | |
bug fix
| -rw-r--r-- | clib/cmap.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clib/cmap.h b/clib/cmap.h index 442f714b..33f0469d 100644 --- a/clib/cmap.h +++ b/clib/cmap.h @@ -57,10 +57,10 @@ typedef struct CMapEntry_##tag CMapEntry_##tag declare_CMap_4(tag, Key, Value, c_defaultDestroy)
#define declare_CMap_4(tag, Key, Value, valueDestroy) \
- declare_CMap_6(tag, Key, Value, valueDestroy, memcmp, c_murmurHash)
+ declare_CMap_7(tag, Key, Value, valueDestroy, memcmp, c_murmurHash, c_defaultDestroy)
-#define declare_CMap_6(tag, Key, Value, valueDestroy, keyCompare, keyHash) \
- declare_CMap_10(tag, Key, Value, valueDestroy, keyCompare, keyHash, c_defaultDestroy, Key, c_defaultGetRaw, c_defaultInitRaw)
+#define declare_CMap_7(tag, Key, Value, valueDestroy, keyCompare, keyHash, keyDestroy) \
+ declare_CMap_10(tag, Key, Value, valueDestroy, keyCompare, keyHash, keyDestroy, Key, c_defaultGetRaw, c_defaultInitRaw)
// CMap<CString, Value>:
@@ -71,12 +71,12 @@ typedef struct CMapEntry_##tag CMapEntry_##tag #define declare_CMap_stringkey_3(tag, Value, valueDestroy) \
declare_CMap_10(tag, CString, Value, valueDestroy, cstring_compareRaw, cstring_hashRaw, cstring_destroy, \
- const char*, cstring_getRaw, cstring_make)
+ const char*, cstring_getRaw, cstring_make)
// CMap full:
#define declare_CMap_10(tag, Key, Value, valueDestroy, keyCompareRaw, keyHashRaw, keyDestroy, \
- KeyRaw, keyGetRaw, keyInitRaw) \
+ KeyRaw, keyGetRaw, keyInitRaw) \
declare_CMapEntry(tag, Key, Value, valueDestroy, keyDestroy); \
declare_CVector_3(map_##tag, CMapEntry_##tag, cmapentry_##tag##_destroy); \
\
@@ -143,7 +143,7 @@ static inline size_t cmap_##tag##_bucket(CMap_##tag* self, KeyRaw rawKey) { \ break; \
} \
/*++m; if ((idx = first + m*m) >= cap) idx %= cap;*/ \
- if (++idx > cap) idx = 0; \
+ if (++idx == cap) idx = 0; \
} while (1); \
} \
\
|
