File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,7 @@ typedef struct _object {
110
110
111
111
/* Cast argument to PyObject* type. */
112
112
#define _PyObject_CAST (op ) ((PyObject*)(op))
113
+ #define _PyObject_CAST_CONST (op ) ((const PyObject*)(op))
113
114
114
115
typedef struct {
115
116
PyObject ob_base ;
@@ -123,10 +124,10 @@ typedef struct {
123
124
#define Py_TYPE (ob ) (_PyObject_CAST(ob)->ob_type)
124
125
#define Py_SIZE (ob ) (_PyVarObject_CAST(ob)->ob_size)
125
126
126
- static inline int _Py_IS_TYPE (PyObject * ob , PyTypeObject * type ) {
127
+ static inline int _Py_IS_TYPE (const PyObject * ob , const PyTypeObject * type ) {
127
128
return ob -> ob_type == type ;
128
129
}
129
- #define Py_IS_TYPE (ob , type ) _Py_IS_TYPE(_PyObject_CAST (ob), type)
130
+ #define Py_IS_TYPE (ob , type ) _Py_IS_TYPE(_PyObject_CAST_CONST (ob), type)
130
131
131
132
static inline void _Py_SET_REFCNT (PyObject * ob , Py_ssize_t refcnt ) {
132
133
ob -> ob_refcnt = refcnt ;
You can’t perform that action at this time.
0 commit comments