| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b972a78 commit 9f2e346
134 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -67,8 +67,9 @@ | |||
| 67 | 67 | #include "bytesobject.h" | |
| 68 | 68 | #include "unicodeobject.h" | |
| 69 | 69 | #include "intobject.h" | |
| 70 | - #include "boolobject.h" | ||
| 71 | 70 | #include "longobject.h" | |
| 71 | + #include "longintrepr.h" | ||
| 72 | + #include "boolobject.h" | ||
| 72 | 73 | #include "floatobject.h" | |
| 73 | 74 | #ifndef WITHOUT_COMPLEX | |
| 74 | 75 | #include "complexobject.h" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -986,7 +986,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ | |||
| 986 | 986 | */ | |
| 987 | 987 | ||
| 988 | 988 | #define PySequence_ITEM(o, i)\ | |
| 989 | - ( o->ob_type->tp_as_sequence->sq_item(o, i) ) | ||
| 989 | + ( Py_Type(o)->tp_as_sequence->sq_item(o, i) ) | ||
| 990 | 990 | /* Assume tp_as_sequence and sq_item exist and that i does not | |
| 991 | 991 | need to be corrected for a negative index | |
| 992 | 992 | */ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,7 +9,7 @@ extern "C" { | |||
| 9 | 9 | ||
| 10 | 10 | PyAPI_DATA(PyTypeObject) PyBool_Type; | |
| 11 | 11 | ||
| 12 | - #define PyBool_Check(x) ((x)->ob_type == &PyBool_Type) | ||
| 12 | + #define PyBool_Check(x) (Py_Type(x) == &PyBool_Type) | ||
| 13 | 13 | ||
| 14 | 14 | /* Py_False and Py_True are the only two bools in existence. | |
| 15 | 15 | Don't forget to apply Py_INCREF() when returning either!!! */ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,7 +12,7 @@ extern "C" { | |||
| 12 | 12 | ||
| 13 | 13 | PyAPI_DATA(PyTypeObject) PyBuffer_Type; | |
| 14 | 14 | ||
| 15 | - #define PyBuffer_Check(op) ((op)->ob_type == &PyBuffer_Type) | ||
| 15 | + #define PyBuffer_Check(op) (Py_Type(op) == &PyBuffer_Type) | ||
| 16 | 16 | ||
| 17 | 17 | #define Py_END_OF_BUFFER (-1) | |
| 18 | 18 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,7 +30,7 @@ PyAPI_DATA(PyTypeObject) PyBytes_Type; | |||
| 30 | 30 | ||
| 31 | 31 | /* Type check macros */ | |
| 32 | 32 | #define PyBytes_Check(self) PyObject_TypeCheck(self, &PyBytes_Type) | |
| 33 | - #define PyBytes_CheckExact(self) ((self)->ob_type == &PyBytes_Type) | ||
| 33 | + #define PyBytes_CheckExact(self) (Py_Type(self) == &PyBytes_Type) | ||
| 34 | 34 | ||
| 35 | 35 | /* Direct API functions */ | |
| 36 | 36 | PyAPI_FUNC(PyObject *) PyBytes_FromObject(PyObject *); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -60,9 +60,9 @@ static struct PycStringIO_CAPI { | |||
| 60 | 60 | ||
| 61 | 61 | /* These can be used to test if you have one */ | |
| 62 | 62 | #define PycStringIO_InputCheck(O) \ | |
| 63 | - ((O)->ob_type==PycStringIO->InputType) | ||
| 63 | + (Py_Type(O)==PycStringIO->InputType) | ||
| 64 | 64 | #define PycStringIO_OutputCheck(O) \ | |
| 65 | - ((O)->ob_type==PycStringIO->OutputType) | ||
| 65 | + (Py_Type(O)==PycStringIO->OutputType) | ||
| 66 | 66 | ||
| 67 | 67 | #ifdef __cplusplus | |
| 68 | 68 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,7 +13,7 @@ typedef struct { | |||
| 13 | 13 | ||
| 14 | 14 | PyAPI_DATA(PyTypeObject) PyCell_Type; | |
| 15 | 15 | ||
| 16 | - #define PyCell_Check(op) ((op)->ob_type == &PyCell_Type) | ||
| 16 | + #define PyCell_Check(op) (Py_Type(op) == &PyCell_Type) | ||
| 17 | 17 | ||
| 18 | 18 | PyAPI_FUNC(PyObject *) PyCell_New(PyObject *); | |
| 19 | 19 | PyAPI_FUNC(PyObject *) PyCell_Get(PyObject *); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,7 +16,7 @@ extern "C" { | |||
| 16 | 16 | ||
| 17 | 17 | PyAPI_DATA(PyTypeObject) PyCObject_Type; | |
| 18 | 18 | ||
| 19 | - #define PyCObject_Check(op) ((op)->ob_type == &PyCObject_Type) | ||
| 19 | + #define PyCObject_Check(op) (Py_Type(op) == &PyCObject_Type) | ||
| 20 | 20 | ||
| 21 | 21 | /* Create a PyCObject from a pointer to a C object and an optional | |
| 22 | 22 | destructor function. If the second argument is non-null, then it | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -59,7 +59,7 @@ typedef struct { | |||
| 59 | 59 | ||
| 60 | 60 | PyAPI_DATA(PyTypeObject) PyCode_Type; | |
| 61 | 61 | ||
| 62 | - #define PyCode_Check(op) ((op)->ob_type == &PyCode_Type) | ||
| 62 | + #define PyCode_Check(op) (Py_Type(op) == &PyCode_Type) | ||
| 63 | 63 | #define PyCode_GetNumFree(op) (PyTuple_GET_SIZE((op)->co_freevars)) | |
| 64 | 64 | ||
| 65 | 65 | /* Public interface */ | |
@@ -72,7 +72,7 @@ PyAPI_FUNC(int) PyCode_Addr2Line(PyCodeObject *, int); | |||
| 72 | 72 | ||
| 73 | 73 | /* for internal use only */ | |
| 74 | 74 | #define _PyCode_GETCODEPTR(co, pp) \ | |
| 75 | - ((*(co)->co_code->ob_type->tp_as_buffer->bf_getreadbuffer) \ | ||
| 75 | + ((*Py_Type((co)->co_code)->tp_as_buffer->bf_getreadbuffer) \ | ||
| 76 | 76 | ((co)->co_code, 0, (void **)(pp))) | |
| 77 | 77 | ||
| 78 | 78 | typedef struct _addr_pair { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -43,7 +43,7 @@ typedef struct { | |||
| 43 | 43 | PyAPI_DATA(PyTypeObject) PyComplex_Type; | |
| 44 | 44 | ||
| 45 | 45 | #define PyComplex_Check(op) PyObject_TypeCheck(op, &PyComplex_Type) | |
| 46 | - #define PyComplex_CheckExact(op) ((op)->ob_type == &PyComplex_Type) | ||
| 46 | + #define PyComplex_CheckExact(op) (Py_Type(op) == &PyComplex_Type) | ||
| 47 | 47 | ||
| 48 | 48 | PyAPI_FUNC(PyObject *) PyComplex_FromCComplex(Py_complex); | |
| 49 | 49 | PyAPI_FUNC(PyObject *) PyComplex_FromDoubles(double real, double imag); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments