@@ -136,9 +136,10 @@ call_error_callback(PyObject *errors, PyObject *exc)
136
136
}
137
137
138
138
static PyObject *
139
- codecctx_errors_get (MultibyteStatefulCodecContext * self , void * Py_UNUSED (ignored ))
139
+ codecctx_errors_get (PyObject * op , void * Py_UNUSED (closure ))
140
140
{
141
141
const char * errors ;
142
+ MultibyteStatefulCodecContext * self = _MultibyteStatefulCodecContext_CAST (op );
142
143
143
144
if (self -> errors == ERROR_STRICT )
144
145
errors = "strict" ;
@@ -154,11 +155,11 @@ codecctx_errors_get(MultibyteStatefulCodecContext *self, void *Py_UNUSED(ignored
154
155
}
155
156
156
157
static int
157
<
10000
span class="diff-text-marker">-codecctx_errors_set (MultibyteStatefulCodecContext * self , PyObject * value ,
158
- void * closure )
158
+ codecctx_errors_set (PyObject * op , PyObject * value , void * Py_UNUSED (closure ))
159
159
{
160
160
PyObject * cb ;
161
161
const char * str ;
162
+ MultibyteStatefulCodecContext * self = _MultibyteStatefulCodecContext_CAST (op );
162
163
163
164
if (value == NULL ) {
164
165
PyErr_SetString (PyExc_AttributeError , "cannot delete attribute" );
@@ -184,9 +185,8 @@ codecctx_errors_set(MultibyteStatefulCodecContext *self, PyObject *value,
184
185
185
186
/* This getset handlers list is used by all the stateful codec objects */
186
187
static PyGetSetDef codecctx_getsets [] = {
187
- {"errors" , (getter )codecctx_errors_get ,
188
- (setter )codecctx_errors_set ,
189
- PyDoc_STR ("how to treat errors" )},
188
+ {"errors" , codecctx_errors_get , codecctx_errors_set ,
189
+ PyDoc_STR ("how to treat errors" )},
190
190
{NULL ,}
191
191
};
192
192
@@ -719,22 +719,24 @@ static struct PyMethodDef multibytecodec_methods[] = {
719
719
};
720
720
721
721
static int
722
- multibytecodec_clear (MultibyteCodecObject * self )
722
+ multibytecodec_clear (PyObject * op )
723
723
{
724
+ MultibyteCodecObject * self = _MultibyteCodecObject_CAST (op );
724
725
Py_CLEAR (self -> cjk_module );
725
726
return 0 ;
726
727
}
727
728
728
729
static int
729
- multibytecodec_traverse (MultibyteCodecObject * self , visitproc visit , void * arg )
730
+ multibytecodec_traverse (PyObject * op , visitproc visit , void * arg )
730
731
{
732
+ MultibyteCodecObject * self = _MultibyteCodecObject_CAST (op );
731
733
Py_VISIT (Py_TYPE (self ));
732
734
Py_VISIT (self -> cjk_module );
733
735
return 0 ;
734
736
}
735
737
736
738
static void
737
- multibytecodec_dealloc (MultibyteCodecObject * self )
739
+ multibytecodec_dealloc (PyObject * self )
738
740
{
739
741
PyObject_GC_UnTrack (self );
740
742
PyTypeObject * tp = Py_TYPE (self );
0 commit comments