summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2007-12-02 14:31:20 (GMT)
committerChristian Heimes <christian@cheimes.de>2007-12-02 14:31:20 (GMT)
commit217cfd1c86c59ed8a55ce6d6b88bbe37309e7ba2 (patch)
tree4737b4a91359c94953623ab9ee297e9a90f319e4 /Include
parent1a3284ed69d545e4ef59869998cb8c29233a45fa (diff)
downloadcpython-217cfd1c86c59ed8a55ce6d6b88bbe37309e7ba2.zip
cpython-217cfd1c86c59ed8a55ce6d6b88bbe37309e7ba2.tar.gz
cpython-217cfd1c86c59ed8a55ce6d6b88bbe37309e7ba2.tar.bz2
Cleanup: Replaced most PyInt_ aliases with PyLong_ and disabled the aliases in intobject.h
Diffstat (limited to 'Include')
-rw-r--r--Include/intobject.h25
-rw-r--r--Include/longobject.h4
-rw-r--r--Include/py_curses.h2
-rw-r--r--Include/pythonrun.h2
4 files changed, 18 insertions, 15 deletions
diff --git a/Include/intobject.h b/Include/intobject.h
index 2778df1..b23afae 100644
--- a/Include/intobject.h
+++ b/Include/intobject.h
@@ -29,23 +29,24 @@ typedef struct {
PyAPI_DATA(PyTypeObject) PyInt_Type;
*/
-#define PyInt_Check(op) PyLong_Check(op)
#define PyInt_CheckExact(op) (PyLong_CheckExact(op) && _PyLong_FitsInLong(op))
-#define PyInt_FromString PyLong_FromString
-#define PyInt_FromUnicode PyLong_FromUnicode
-#define PyInt_FromLong PyLong_FromLong
-#define PyInt_FromSize_t PyLong_FromSize_t
-#define PyInt_FromSsize_t PyLong_FromSsize_t
-#define PyInt_AsLong PyLong_AsLong
-#define PyInt_AsSsize_t PyLong_AsSsize_t
-#define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
-#define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
+#ifdef 0
+# define PyInt_Check(op) PyLong_Check(op)
+# define PyInt_FromString PyLong_FromString
+# define PyInt_FromUnicode PyLong_FromUnicode
+# define PyInt_FromLong PyLong_FromLong
+# define PyInt_FromSize_t PyLong_FromSize_t
+# define PyInt_FromSsize_t PyLong_FromSsize_t
+# define PyInt_AsLong PyLong_AsLong
+# define PyInt_AsSsize_t PyLong_AsSsize_t
+# define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
+# define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
+# define PyInt_AS_LONG PyLong_AS_LONG
+#endif
PyAPI_FUNC(long) PyInt_GetMax(void);
-#define PyInt_AS_LONG(op) PyLong_AsLong(op)
-
/* These aren't really part of the Int object, but they're handy; the protos
* are necessary for systems that need the magic of PyAPI_FUNC.
*/
diff --git a/Include/longobject.h b/Include/longobject.h
index 16abd0e..688b4e4 100644
--- a/Include/longobject.h
+++ b/Include/longobject.h
@@ -26,6 +26,10 @@ PyAPI_FUNC(size_t) PyLong_AsSize_t(PyObject *);
PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLong(PyObject *);
PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLongMask(PyObject *);
+/* It may be useful in the future. I've added it in the PyInt -> PyLong
+ cleanup to keep the extra information. [CH] */
+#define PyLong_AS_LONG(op) PyLong_AsLong(op)
+
/* Used by socketmodule.c */
#if SIZEOF_SOCKET_T <= SIZEOF_LONG
#define PyLong_FromSocket_t(fd) PyLong_FromLong((SOCKET_T)(fd))
diff --git a/Include/py_curses.h b/Include/py_curses.h
index 62d00d8..23d9d16 100644
--- a/Include/py_curses.h
+++ b/Include/py_curses.h
@@ -139,7 +139,7 @@ static PyObject *PyCurses_ ## X (PyObject *self, PyObject *args) \
static PyObject *PyCurses_ ## X (PyObject *self) \
{ \
PyCursesInitialised \
- return PyInt_FromLong((long) X()); }
+ return PyLong_FromLong((long) X()); }
#define NoArgReturnStringFunction(X) \
diff --git a/Include/pythonrun.h b/Include/pythonrun.h
index 607826a..9d5b3a6 100644
--- a/Include/pythonrun.h
+++ b/Include/pythonrun.h
@@ -125,7 +125,6 @@ PyAPI_FUNC(void) _PyImport_Init(void);
PyAPI_FUNC(void) _PyExc_Init(void);
PyAPI_FUNC(void) _PyImportHooks_Init(void);
PyAPI_FUNC(int) _PyFrame_Init(void);
-PyAPI_FUNC(int) _PyInt_Init(void);
PyAPI_FUNC(void) _PyFloat_Init(void);
PyAPI_FUNC(int) PyBytes_Init(void);
@@ -140,7 +139,6 @@ PyAPI_FUNC(void) PyList_Fini(void);
PyAPI_FUNC(void) PySet_Fini(void);
PyAPI_FUNC(void) PyString_Fini(void);
PyAPI_FUNC(void) PyBytes_Fini(void);
-PyAPI_FUNC(void) PyInt_Fini(void);
PyAPI_FUNC(void) PyFloat_Fini(void);
PyAPI_FUNC(void) PyOS_FiniInterrupts(void);