mirror of
https://github.com/python/cpython
synced 2026-09-29 10:35:30 +03:00
Use 'void' directly instead of the ANY #define, now that all code is ANSI C.
Leave the actual #define in for API compatibility.
This commit is contained in:
parent
bf680266da
commit
334fb8985b
11 changed files with 44 additions and 63 deletions
|
|
@ -1258,8 +1258,8 @@ PyList_AsTuple(PyObject *v)
|
|||
if (w == NULL)
|
||||
return NULL;
|
||||
p = ((PyTupleObject *)w)->ob_item;
|
||||
memcpy((ANY *)p,
|
||||
(ANY *)((PyListObject *)v)->ob_item,
|
||||
memcpy((void *)p,
|
||||
(void *)((PyListObject *)v)->ob_item,
|
||||
n*sizeof(PyObject *));
|
||||
while (--n >= 0) {
|
||||
Py_INCREF(*p);
|
||||
|
|
|
|||
|
|
@ -962,7 +962,7 @@ int (*_Py_abstract_hack)(PyObject *) = &PyObject_Size;
|
|||
|
||||
/* Python's malloc wrappers (see mymalloc.h) */
|
||||
|
||||
ANY *
|
||||
void *
|
||||
PyMem_Malloc(size_t nbytes)
|
||||
{
|
||||
#if _PyMem_EXTRA > 0
|
||||
|
|
@ -972,8 +972,8 @@ PyMem_Malloc(size_t nbytes)
|
|||
return PyMem_MALLOC(nbytes);
|
||||
}
|
||||
|
||||
ANY *
|
||||
PyMem_Realloc(ANY *p, size_t nbytes)
|
||||
void *
|
||||
PyMem_Realloc(void *p, size_t nbytes)
|
||||
{
|
||||
#if _PyMem_EXTRA > 0
|
||||
if (nbytes == 0)
|
||||
|
|
@ -983,7 +983,7 @@ PyMem_Realloc(ANY *p, size_t nbytes)
|
|||
}
|
||||
|
||||
void
|
||||
PyMem_Free(ANY *p)
|
||||
PyMem_Free(void *p)
|
||||
{
|
||||
PyMem_FREE(p);
|
||||
}
|
||||
|
|
@ -991,20 +991,20 @@ PyMem_Free(ANY *p)
|
|||
|
||||
/* Python's object malloc wrappers (see objimpl.h) */
|
||||
|
||||
ANY *
|
||||
void *
|
||||
PyObject_Malloc(size_t nbytes)
|
||||
{
|
||||
return PyObject_MALLOC(nbytes);
|
||||
}
|
||||
|
||||
ANY *
|
||||
PyObject_Realloc(ANY *p, size_t nbytes)
|
||||
void *
|
||||
PyObject_Realloc(void *p, size_t nbytes)
|
||||
{
|
||||
return PyObject_REALLOC(p, nbytes);
|
||||
}
|
||||
|
||||
void
|
||||
PyObject_Free(ANY *p)
|
||||
PyObject_Free(void *p)
|
||||
{
|
||||
PyObject_FREE(p);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue