diff options
author | 2010-10-23 16:20:50 +0000 | |
---|---|---|
committer | 2010-10-23 16:20:50 +0000 | |
commit | 8035bc5c048ff08f652649754eb8ea769337afa0 (patch) | |
tree | 82778e9f0242d5a26e4ceba5d5b85babde6c12cf /Include | |
parent | Try to fix test_tarfile on AMD64 debian parallel 3.x (diff) | |
download | cpython-8035bc5c048ff08f652649754eb8ea769337afa0.tar.gz cpython-8035bc5c048ff08f652649754eb8ea769337afa0.tar.bz2 cpython-8035bc5c048ff08f652649754eb8ea769337afa0.zip |
follow up to #9778: define and use an unsigned hash type
Diffstat (limited to 'Include')
-rw-r--r-- | Include/pyport.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Include/pyport.h b/Include/pyport.h index 4331bf98445..568199b85dd 100644 --- a/Include/pyport.h +++ b/Include/pyport.h @@ -135,7 +135,7 @@ Used in: PY_LONG_LONG #else #define _PyHASH_BITS 31 #endif -#define _PyHASH_MODULUS ((1UL << _PyHASH_BITS) - 1) +#define _PyHASH_MODULUS (((size_t)1 << _PyHASH_BITS) - 1) #define _PyHASH_INF 314159 #define _PyHASH_NAN 0 #define _PyHASH_IMAG 1000003UL @@ -179,6 +179,8 @@ typedef Py_intptr_t Py_ssize_t; /* Py_hash_t is the same size as a pointer. */ typedef Py_ssize_t Py_hash_t; +/* Py_uhash_t is the unsigned equivalent needed to calculate numeric hash. */ +typedef size_t Py_uhash_t; /* Largest possible value of size_t. SIZE_MAX is part of C99, so it might be defined on some |