summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorThomas Wouters <thomas@python.org>2000-07-25 12:56:38 (GMT)
committerThomas Wouters <thomas@python.org>2000-07-25 12:56:38 (GMT)
commit334fb8985bc126f62af65669150c30787eabddd9 (patch)
tree114a52660cda84eb69f1fe8c24d0df7458dbe875 /Include
parentbf680266da23b0b95a03d2b7ea5da493d341a562 (diff)
downloadcpython-334fb8985bc126f62af65669150c30787eabddd9.zip
cpython-334fb8985bc126f62af65669150c30787eabddd9.tar.gz
cpython-334fb8985bc126f62af65669150c30787eabddd9.tar.bz2
Use 'void' directly instead of the ANY #define, now that all code is ANSI C.
Leave the actual #define in for API compatibility.
Diffstat (limited to 'Include')
-rw-r--r--Include/ceval.h2
-rw-r--r--Include/mymalloc.h40
-rw-r--r--Include/objimpl.h14
3 files changed, 19 insertions, 37 deletions
diff --git a/Include/ceval.h b/Include/ceval.h
index 9468451..0831173 100644
--- a/Include/ceval.h
+++ b/Include/ceval.h
@@ -40,7 +40,7 @@ DL_IMPORT(int) PyEval_GetRestricted(void);
DL_IMPORT(int) Py_FlushLine(void);
-DL_IMPORT(int) Py_AddPendingCall(int (*func)(ANY *), ANY *arg);
+DL_IMPORT(int) Py_AddPendingCall(int (*func)(void *), void *arg);
DL_IMPORT(int) Py_MakePendingCalls(void);
diff --git a/Include/mymalloc.h b/Include/mymalloc.h
index 88faf90..5bbd1e5 100644
--- a/Include/mymalloc.h
+++ b/Include/mymalloc.h
@@ -12,25 +12,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
/* Lowest-level memory allocation interface */
-#ifdef macintosh
-#define ANY void
-#endif
-
-#ifdef __STDC__
-#define ANY void
-#endif
-
-#ifdef __TURBOC__
-#define ANY void
-#endif
-
-#ifdef __GNUC__
-#define ANY void
-#endif
-
-#ifndef ANY
-#define ANY char
-#endif
+#define ANY void /* For API compatibility only. Obsolete, do not use. */
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
@@ -49,7 +31,7 @@ extern "C" {
#endif
#ifndef NULL
-#define NULL ((ANY *)0)
+#define NULL ((void *)0)
#endif
#ifdef MALLOC_ZERO_RETURNS_NULL
@@ -87,13 +69,13 @@ extern "C" {
#undef PyCore_REALLOC_PROTO
#undef PyCore_FREE_PROTO
#define PyCore_MALLOC_PROTO (size_t)
-#define PyCore_REALLOC_PROTO (ANY *, size_t)
-#define PyCore_FREE_PROTO (ANY *)
+#define PyCore_REALLOC_PROTO (void *, size_t)
+#define PyCore_FREE_PROTO (void *)
#endif
#ifdef NEED_TO_DECLARE_MALLOC_AND_FRIEND
-extern ANY *PyCore_MALLOC_FUNC PyCore_MALLOC_PROTO;
-extern ANY *PyCore_REALLOC_FUNC PyCore_REALLOC_PROTO;
+extern void *PyCore_MALLOC_FUNC PyCore_MALLOC_PROTO;
+extern void *PyCore_REALLOC_FUNC PyCore_REALLOC_PROTO;
extern void PyCore_FREE_FUNC PyCore_FREE_PROTO;
#endif
@@ -134,17 +116,17 @@ extern void PyCore_FREE_FUNC PyCore_FREE_PROTO;
returns a non-NULL pointer, even if the underlying malloc
doesn't. Returned pointers must be checked for NULL explicitly.
No action is performed on failure. */
-extern DL_IMPORT(ANY *) PyMem_Malloc(size_t);
-extern DL_IMPORT(ANY *) PyMem_Realloc(ANY *, size_t);
-extern DL_IMPORT(void) PyMem_Free(ANY *);
+extern DL_IMPORT(void *) PyMem_Malloc(size_t);
+extern DL_IMPORT(void *) PyMem_Realloc(void *, size_t);
+extern DL_IMPORT(void) PyMem_Free(void *);
/* Starting from Python 1.6, the wrappers Py_{Malloc,Realloc,Free} are
no longer supported. They used to call PyErr_NoMemory() on failure. */
/* Macros */
#define PyMem_MALLOC(n) PyCore_MALLOC(n)
-#define PyMem_REALLOC(p, n) PyCore_REALLOC((ANY *)(p), (n))
-#define PyMem_FREE(p) PyCore_FREE((ANY *)(p))
+#define PyMem_REALLOC(p, n) PyCore_REALLOC((void *)(p), (n))
+#define PyMem_FREE(p) PyCore_FREE((void *)(p))
/*
* Type-oriented memory interface
diff --git a/Include/objimpl.h b/Include/objimpl.h
index 76fab92..dfdbca0 100644
--- a/Include/objimpl.h
+++ b/Include/objimpl.h
@@ -101,8 +101,8 @@ recommended to use PyObject_{New, NewVar, Del}. */
#endif
#ifdef NEED_TO_DECLARE_OBJECT_MALLOC_AND_FRIEND
-extern ANY *PyCore_OBJECT_MALLOC_FUNC PyCore_OBJECT_MALLOC_PROTO;
-extern ANY *PyCore_OBJECT_REALLOC_FUNC PyCore_OBJECT_REALLOC_PROTO;
+extern void *PyCore_OBJECT_MALLOC_FUNC PyCore_OBJECT_MALLOC_PROTO;
+extern void *PyCore_OBJECT_REALLOC_FUNC PyCore_OBJECT_REALLOC_PROTO;
extern void PyCore_OBJECT_FREE_FUNC PyCore_OBJECT_FREE_PROTO;
#endif
@@ -137,14 +137,14 @@ extern void PyCore_OBJECT_FREE_FUNC PyCore_OBJECT_FREE_PROTO;
as Python. These wrappers *do not* make sure that allocating 0
bytes returns a non-NULL pointer. Returned pointers must be checked
for NULL explicitly; no action is performed on failure. */
-extern DL_IMPORT(ANY *) PyObject_Malloc(size_t);
-extern DL_IMPORT(ANY *) PyObject_Realloc(ANY *, size_t);
-extern DL_IMPORT(void) PyObject_Free(ANY *);
+extern DL_IMPORT(void *) PyObject_Malloc(size_t);
+extern DL_IMPORT(void *) PyObject_Realloc(void *, size_t);
+extern DL_IMPORT(void) PyObject_Free(void *);
/* Macros */
#define PyObject_MALLOC(n) PyCore_OBJECT_MALLOC(n)
-#define PyObject_REALLOC(op, n) PyCore_OBJECT_REALLOC((ANY *)(op), (n))
-#define PyObject_FREE(op) PyCore_OBJECT_FREE((ANY *)(op))
+#define PyObject_REALLOC(op, n) PyCore_OBJECT_REALLOC((void *)(op), (n))
+#define PyObject_FREE(op) PyCore_OBJECT_FREE((void *)(op))
/*
* Generic object allocator interface