| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -48,7 +48,7 @@ main(int argc, char **argv) | |||
| 48 | 48 | static PyObject * | |
| 49 | 49 | xyzzy_foo(PyObject *self, PyObject* args) | |
| 50 | 50 | { | |
| 51 | - return PyInt_FromLong(42L); | ||
| 51 | + return PyLong_FromLong(42L); | ||
| 52 | 52 | } | |
| 53 | 53 | ||
| 54 | 54 | static PyMethodDef xyzzy_methods[] = { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,7 +26,7 @@ main(int argc, char *argv[]) | |||
| 26 | 26 | if (pFunc && PyCallable_Check(pFunc)) { | |
| 27 | 27 | pArgs = PyTuple_New(argc - 3); | |
| 28 | 28 | for (i = 0; i < argc - 3; ++i) { | |
| 29 | - pValue = PyInt_FromLong(atoi(argv[i + 3])); | ||
| 29 | + pValue = PyLong_FromLong(atoi(argv[i + 3])); | ||
| 30 | 30 | if (!pValue) { | |
| 31 | 31 | Py_DECREF(pArgs); | |
| 32 | 32 | Py_DECREF(pModule); | |
@@ -39,7 +39,7 @@ main(int argc, char *argv[]) | |||
| 39 | 39 | pValue = PyObject_CallObject(pFunc, pArgs); | |
| 40 | 40 | Py_DECREF(pArgs); | |
| 41 | 41 | if (pValue != NULL) { | |
| 42 | - printf("Result of call: %ld\n", PyInt_AsLong(pValue)); | ||
| 42 | + printf("Result of call: %ld\n", PyLong_AsLong(pValue)); | ||
| 43 | 43 | Py_DECREF(pValue); | |
| 44 | 44 | } | |
| 45 | 45 | else { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10,7 +10,7 @@ static PyObject * | |||
| 10 | 10 | Shoddy_increment(Shoddy *self, PyObject *unused) | |
| 11 | 11 | { | |
| 12 | 12 | self->state++; | |
| 13 | - return PyInt_FromLong(self->state); | ||
| 13 | + return PyLong_FromLong(self->state); | ||
| 14 | 14 | } | |
| 15 | 15 | ||
| 16 | 16 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,23 +29,24 @@ typedef struct { | |||
| 29 | 29 | PyAPI_DATA(PyTypeObject) PyInt_Type; | |
| 30 | 30 | */ | |
| 31 | 31 | ||
| 32 | - #define PyInt_Check(op) PyLong_Check(op) | ||
| 33 | 32 | #define PyInt_CheckExact(op) (PyLong_CheckExact(op) && _PyLong_FitsInLong(op)) | |
| 34 | 33 | ||
| 35 | - #define PyInt_FromString PyLong_FromString | ||
| 36 | - #define PyInt_FromUnicode PyLong_FromUnicode | ||
| 37 | - #define PyInt_FromLong PyLong_FromLong | ||
| 38 | - #define PyInt_FromSize_t PyLong_FromSize_t | ||
| 39 | - #define PyInt_FromSsize_t PyLong_FromSsize_t | ||
| 40 | - #define PyInt_AsLong PyLong_AsLong | ||
| 41 | - #define PyInt_AsSsize_t PyLong_AsSsize_t | ||
| 42 | - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask | ||
| 43 | - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask | ||
| 34 | + #ifdef 0 | ||
| 35 | + # define PyInt_Check(op) PyLong_Check(op) | ||
| 36 | + # define PyInt_FromString PyLong_FromString | ||
| 37 | + # define PyInt_FromUnicode PyLong_FromUnicode | ||
| 38 | + # define PyInt_FromLong PyLong_FromLong | ||
| 39 | + # define PyInt_FromSize_t PyLong_FromSize_t | ||
| 40 | + # define PyInt_FromSsize_t PyLong_FromSsize_t | ||
| 41 | + # define PyInt_AsLong PyLong_AsLong | ||
| 42 | + # define PyInt_AsSsize_t PyLong_AsSsize_t | ||
| 43 | + # define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask | ||
| 44 | + # define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask | ||
| 45 | + # define PyInt_AS_LONG PyLong_AS_LONG | ||
| 46 | + #endif | ||
| 44 | 47 | ||
| 45 | 48 | PyAPI_FUNC(long) PyInt_GetMax(void); | |
| 46 | 49 | ||
| 47 | - #define PyInt_AS_LONG(op) PyLong_AsLong(op) | ||
| 48 | - | ||
| 49 | 50 | /* These aren't really part of the Int object, but they're handy; the protos | |
| 50 | 51 | * are necessary for systems that need the magic of PyAPI_FUNC. | |
| 51 | 52 | */ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,6 +26,10 @@ PyAPI_FUNC(size_t) PyLong_AsSize_t(PyObject *); | |||
| 26 | 26 | PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLong(PyObject *); | |
| 27 | 27 | PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLongMask(PyObject *); | |
| 28 | 28 | ||
| 29 | + /* It may be useful in the future. I've added it in the PyInt -> PyLong | ||
| 30 | + cleanup to keep the extra information. [CH] */ | ||
| 31 | + #define PyLong_AS_LONG(op) PyLong_AsLong(op) | ||
| 32 | + | ||
| 29 | 33 | /* Used by socketmodule.c */ | |
| 30 | 34 | #if SIZEOF_SOCKET_T <= SIZEOF_LONG | |
| 31 | 35 | #define PyLong_FromSocket_t(fd) PyLong_FromLong((SOCKET_T)(fd)) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -139,7 +139,7 @@ static PyObject *PyCurses_ ## X (PyObject *self, PyObject *args) \ | |||
| 139 | 139 | static PyObject *PyCurses_ ## X (PyObject *self) \ | |
| 140 | 140 | { \ | |
| 141 | 141 | PyCursesInitialised \ | |
| 142 | - return PyInt_FromLong((long) X()); } | ||
| 142 | + return PyLong_FromLong((long) X()); } | ||
| 143 | 143 | ||
| 144 | 144 | ||
| 145 | 145 | #define NoArgReturnStringFunction(X) \ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -125,7 +125,6 @@ PyAPI_FUNC(void) _PyImport_Init(void); | |||
| 125 | 125 | PyAPI_FUNC(void) _PyExc_Init(void); | |
| 126 | 126 | PyAPI_FUNC(void) _PyImportHooks_Init(void); | |
| 127 | 127 | PyAPI_FUNC(int) _PyFrame_Init(void); | |
| 128 | - PyAPI_FUNC(int) _PyInt_Init(void); | ||
| 129 | 128 | PyAPI_FUNC(void) _PyFloat_Init(void); | |
| 130 | 129 | PyAPI_FUNC(int) PyBytes_Init(void); | |
| 131 | 130 | ||
@@ -140,7 +139,6 @@ PyAPI_FUNC(void) PyList_Fini(void); | |||
| 140 | 139 | PyAPI_FUNC(void) PySet_Fini(void); | |
| 141 | 140 | PyAPI_FUNC(void) PyString_Fini(void); | |
| 142 | 141 | PyAPI_FUNC(void) PyBytes_Fini(void); | |
| 143 | - PyAPI_FUNC(void) PyInt_Fini(void); | ||
| 144 | 142 | PyAPI_FUNC(void) PyFloat_Fini(void); | |
| 145 | 143 | PyAPI_FUNC(void) PyOS_FiniInterrupts(void); | |
| 146 | 144 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -195,7 +195,7 @@ rf_tell(rfobject *self, PyObject *args) | |||
| 195 | 195 | PyMac_Error(err); | |
| 196 | 196 | return NULL; | |
| 197 | 197 | } | |
| 198 | - return PyInt_FromLong(where); | ||
| 198 | + return PyLong_FromLong(where); | ||
| 199 | 199 | } | |
| 200 | 200 | ||
| 201 | 201 | static char rf_close__doc__[] = | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -102,8 +102,8 @@ myEventHandler(EventHandlerCallRef handlerRef, EventRef event, void *outPyObject | |||
| 102 | 102 | } else { | |
| 103 | 103 | if (retValue == Py_None) | |
| 104 | 104 | status = noErr; | |
| 105 | - else if (PyInt_Check(retValue)) { | ||
| 106 | - status = PyInt_AsLong(retValue); | ||
| 105 | + else if (PyLong_Check(retValue)) { | ||
| 106 | + status = PyLong_AsLong(retValue); | ||
| 107 | 107 | } else | |
| 108 | 108 | status = noErr; /* wrong object type, complain? */ | |
| 109 | 109 | Py_DECREF(retValue); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -114,7 +114,7 @@ PyCF_CF2Python_simple(CFTypeRef src) { | |||
| 114 | 114 | long l; | |
| 115 | 115 | if (!CFNumberGetValue(src, kCFNumberLongType, &l)) | |
| 116 | 116 | /* XXXX Out of range! */; | |
| 117 | - return PyInt_FromLong(l); | ||
| 117 | + return PyLong_FromLong(l); | ||
| 118 | 118 | } | |
| 119 | 119 | } | |
| 120 | 120 | /* XXXX Should return as CFTypeRef, really... */ | |
@@ -258,8 +258,8 @@ PyCF_Python2CF_simple(PyObject *src, CFTypeRef *dst) { | |||
| 258 | 258 | *dst = kCFBooleanFalse; | |
| 259 | 259 | return 1; | |
| 260 | 260 | } | |
| 261 | - if (PyInt_Check(src)) { | ||
| 262 | - long v = PyInt_AsLong(src); | ||
| 261 | + if (PyLong_Check(src)) { | ||
| 262 | + long v = PyLong_AsLong(src); | ||
| 263 | 263 | *dst = CFNumberCreate(NULL, kCFNumberLongType, &v); | |
| 264 | 264 | return 1; | |
| 265 | 265 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments