Go to the source code of this file.
◆ __DCL_HASH_FUN_H__
| #define __DCL_HASH_FUN_H__ 20110303 |
◆ __byte_string_hashKey()
| unsigned int __byte_string_hashKey |
( |
const char * | _psz | ) |
|
|
inline |
Definition at line 51 of file HashFun.h.
52{
53 unsigned int h = 0;
54 for( ; *_psz; _psz++) {
55 h = 5 * h + (unsigned char) *_psz;
56 }
57 return h;
58}
◆ __wide_string_hashKey()
| unsigned int __wide_string_hashKey |
( |
const wchar_t * | _psz | ) |
|
|
inline |
Definition at line 15 of file HashFun.h.
16{
17 unsigned int h = 0;
18 for( ; *_psz; _psz++) {
19 h = 5 * h + (unsigned int) *_psz;
20 }
21 return h;
22}
◆ DCLGetNextPrimNumber()
| DCLCAPI size_t DCLGetNextPrimNumber |
( |
size_t | _n | ) |
|
Definition at line 23 of file HashFun.cpp.
24{
25 size_t n =
__countof(__prim_numbers,
size_t);
26 for(size_t i = 0; i < n; i++)
27 {
28 if (_n < __prim_numbers[i])
29 return __prim_numbers[i];
30 }
31 return __prim_numbers[n - 1];
32}
#define __countof(array, type)