[Python-checkins] bpo-39127: Make _Py_HashPointer's argument be const (GH-17690)

Andy Lester webhook-mailer at python.org
Wed Feb 5 16:10:05 EST 2020


https://github.com/python/cpython/commit/3d06953c34fd6421dd1dfdb615578cde676ee0eb
commit: 3d06953c34fd6421dd1dfdb615578cde676ee0eb
branch: master
author: Andy Lester <andy at petdance.com>
committer: GitHub <noreply at github.com>
date: 2020-02-05T23:09:57+02:00
summary:

bpo-39127: Make _Py_HashPointer's argument be const (GH-17690)

files:
M Include/pyhash.h
M Python/pyhash.c

diff --git a/Include/pyhash.h b/Include/pyhash.h
index dbcc9744be35a..2f398589cee7e 100644
--- a/Include/pyhash.h
+++ b/Include/pyhash.h
@@ -8,7 +8,7 @@ extern "C" {
 /* Helpers for hash functions */
 #ifndef Py_LIMITED_API
 PyAPI_FUNC(Py_hash_t) _Py_HashDouble(double);
-PyAPI_FUNC(Py_hash_t) _Py_HashPointer(void*);
+PyAPI_FUNC(Py_hash_t) _Py_HashPointer(const void*);
 PyAPI_FUNC(Py_hash_t) _Py_HashBytes(const void*, Py_ssize_t);
 #endif
 
diff --git a/Python/pyhash.c b/Python/pyhash.c
index 4c0b929586fc1..d381dc0230c5b 100644
--- a/Python/pyhash.c
+++ b/Python/pyhash.c
@@ -129,7 +129,7 @@ _Py_HashDouble(double v)
 }
 
 Py_hash_t
-_Py_HashPointer(void *p)
+_Py_HashPointer(const void *p)
 {
     Py_hash_t x;
     size_t y = (size_t)p;



More information about the Python-checkins mailing list