]> granicus.if.org Git - python/commitdiff
Issue 16280: Drop questionable special-casing of null pointer in PyLong_FromVoidPtr.
authorMark Dickinson <mdickinson@enthought.com>
Thu, 18 Oct 2012 21:18:42 +0000 (22:18 +0100)
committerMark Dickinson <mdickinson@enthought.com>
Thu, 18 Oct 2012 21:18:42 +0000 (22:18 +0100)
Objects/longobject.c

index 95bd83625c0f989038b31cfbd7db72ccf543da27..4024491f133736ab9a0993941d7f3af982bfed84 100644 (file)
@@ -936,9 +936,6 @@ PyObject *
 PyLong_FromVoidPtr(void *p)
 {
 #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);
 #else
 
@@ -948,9 +945,6 @@ PyLong_FromVoidPtr(void *p)
 #if SIZEOF_LONG_LONG < SIZEOF_VOID_P
 #   error "PyLong_FromVoidPtr: sizeof(PY_LONG_LONG) < sizeof(void*)"
 #endif
-    /* special-case null pointer */
-    if (!p)
-        return PyLong_FromLong(0);
     return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)(Py_uintptr_t)p);
 #endif /* SIZEOF_VOID_P <= SIZEOF_LONG */