Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7d45d34

Browse files
committed
ANY becomes void, to reflect the requirement for ANSI C.
1 parent 091ec2c commit 7d45d34

1 file changed

Lines changed: 11 additions & 18 deletions

File tree

Doc/api/api.tex

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3037,10 +3037,8 @@ \subsection{Dictionary Objects \label{dictObjects}}
30373037
\samp{len(\var{p})} on a dictionary.\bifuncindex{len}
30383038
\end{cfuncdesc}
30393039

3040-
\begin{cfuncdesc}{int}{PyDict_Next}{PyDictObject *p,
3041-
int ppos,
3042-
PyObject **pkey,
3043-
PyObject **pvalue}
3040+
\begin{cfuncdesc}{int}{PyDict_Next}{PyDictObject *p, int *ppos,
3041+
PyObject **pkey, PyObject **pvalue}
30443042

30453043
\end{cfuncdesc}
30463044

@@ -4216,18 +4214,13 @@ \section{Memory Interface \label{memoryInterface}}
42164214
available for allocating and releasing memory from the Python heap:
42174215

42184216

4219-
\begin{ctypedesc}{ANY*}
4220-
The type used to represent arbitrary blocks of memory. Values of this
4221-
type should be cast to the specific type that is needed.
4222-
\end{ctypedesc}
4223-
4224-
\begin{cfuncdesc}{ANY*}{PyMem_Malloc}{size_t n}
4225-
Allocates \var{n} bytes and returns a pointer of type \ctype{ANY*} to
4217+
\begin{cfuncdesc}{void*}{PyMem_Malloc}{size_t n}
4218+
Allocates \var{n} bytes and returns a pointer of type \ctype{void*} to
42264219
the allocated memory, or \NULL{} if the request fails. Requesting zero
42274220
bytes returns a non-\NULL{} pointer.
42284221
\end{cfuncdesc}
42294222

4230-
\begin{cfuncdesc}{ANY*}{PyMem_Realloc}{ANY *p, size_t n}
4223+
\begin{cfuncdesc}{void*}{PyMem_Realloc}{void *p, size_t n}
42314224
Resizes the memory block pointed to by \var{p} to \var{n} bytes. The
42324225
contents will be unchanged to the minimum of the old and the new
42334226
sizes. If \var{p} is \NULL{}, the call is equivalent to
@@ -4237,25 +4230,25 @@ \section{Memory Interface \label{memoryInterface}}
42374230
call to \cfunction{PyMem_Malloc()} or \cfunction{PyMem_Realloc()}.
42384231
\end{cfuncdesc}
42394232

4240-
\begin{cfuncdesc}{void}{PyMem_Free}{ANY *p}
4233+
\begin{cfuncdesc}{void}{PyMem_Free}{void *p}
42414234
Frees the memory block pointed to by \var{p}, which must have been
42424235
returned by a previous call to \cfunction{PyMem_Malloc()} or
42434236
\cfunction{PyMem_Realloc()}. Otherwise, or if
42444237
\cfunction{PyMem_Free(p)} has been called before, undefined behaviour
42454238
occurs. If \var{p} is \NULL{}, no operation is performed.
42464239
\end{cfuncdesc}
42474240

4248-
\begin{cfuncdesc}{ANY*}{Py_Malloc}{size_t n}
4241+
\begin{cfuncdesc}{void*}{Py_Malloc}{size_t n}
42494242
Same as \cfunction{PyMem_Malloc()}, but calls
42504243
\cfunction{PyErr_NoMemory()} on failure.
42514244
\end{cfuncdesc}
42524245

4253-
\begin{cfuncdesc}{ANY*}{Py_Realloc}{ANY *p, size_t n}
4246+
\begin{cfuncdesc}{void*}{Py_Realloc}{void *p, size_t n}
42544247
Same as \cfunction{PyMem_Realloc()}, but calls
42554248
\cfunction{PyErr_NoMemory()} on failure.
42564249
\end{cfuncdesc}
42574250

4258-
\begin{cfuncdesc}{void}{Py_Free}{ANY *p}
4251+
\begin{cfuncdesc}{void}{Py_Free}{void *p}
42594252
Same as \cfunction{PyMem_Free()}.
42604253
\end{cfuncdesc}
42614254

@@ -4268,13 +4261,13 @@ \section{Memory Interface \label{memoryInterface}}
42684261
\ctype{\var{TYPE}*}.
42694262
\end{cfuncdesc}
42704263

4271-
\begin{cfuncdesc}{\var{TYPE}*}{PyMem_RESIZE}{ANY *p, TYPE, size_t n}
4264+
\begin{cfuncdesc}{\var{TYPE}*}{PyMem_RESIZE}{void *p, TYPE, size_t n}
42724265
Same as \cfunction{PyMem_Realloc()}, but the memory block is resized
42734266
to \code{(\var{n} * sizeof(\var{TYPE}))} bytes. Returns a pointer
42744267
cast to \ctype{\var{TYPE}*}.
42754268
\end{cfuncdesc}
42764269

4277-
\begin{cfuncdesc}{void}{PyMem_DEL}{ANY *p}
4270+
\begin{cfuncdesc}{void}{PyMem_DEL}{void *p}
42784271
Same as \cfunction{PyMem_Free()}.
42794272
\end{cfuncdesc}
42804273

0 commit comments

Comments
 (0)