mirror of
https://github.com/python/cpython
synced 2026-09-28 07:38:20 +03:00
Issue 16280: Drop questionable special-casing of null pointer in PyLong_FromVoidPtr.
This commit is contained in:
parent
74375fc06a
commit
e453e4c007
1 changed files with 0 additions and 6 deletions
|
|
@ -936,9 +936,6 @@ PyObject *
|
||||||
PyLong_FromVoidPtr(void *p)
|
PyLong_FromVoidPtr(void *p)
|
||||||
{
|
{
|
||||||
#if SIZEOF_VOID_P <= SIZEOF_LONG
|
#if SIZEOF_VOID_P <= SIZEOF_LONG
|
||||||
/* special-case null pointer */
|
|
||||||
if (!p)
|
|
||||||
return PyLong_FromLong(0);
|
|
||||||
return PyLong_FromUnsignedLong((unsigned long)(Py_uintptr_t)p);
|
return PyLong_FromUnsignedLong((unsigned long)(Py_uintptr_t)p);
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
|
@ -948,9 +945,6 @@ PyLong_FromVoidPtr(void *p)
|
||||||
#if SIZEOF_LONG_LONG < SIZEOF_VOID_P
|
#if SIZEOF_LONG_LONG < SIZEOF_VOID_P
|
||||||
# error "PyLong_FromVoidPtr: sizeof(PY_LONG_LONG) < sizeof(void*)"
|
# error "PyLong_FromVoidPtr: sizeof(PY_LONG_LONG) < sizeof(void*)"
|
||||||
#endif
|
#endif
|
||||||
/* special-case null pointer */
|
|
||||||
if (!p)
|
|
||||||
return PyLong_FromLong(0);
|
|
||||||
return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)(Py_uintptr_t)p);
|
return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)(Py_uintptr_t)p);
|
||||||
#endif /* SIZEOF_VOID_P <= SIZEOF_LONG */
|
#endif /* SIZEOF_VOID_P <= SIZEOF_LONG */
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue