@@ -272,7 +272,7 @@ multibytecodec_encerror(const MultibyteCodec *codec,
272
272
for (;;) {
273
273
Py_ssize_t outleft = (Py_ssize_t )(buf -> outbuf_end - buf -> outbuf );
274
274
275
- r = codec -> encode (state , codec -> config ,
275
+ r = codec -> encode (state , codec ,
276
276
kind , data , & inpos , 1 ,
277
277
& buf -> outbuf , outleft , 0 );
278
278
if (r == MBERR_TOOSMALL ) {
@@ -521,7 +521,7 @@ multibytecodec_encode(const MultibyteCodec *codec,
521
521
* error callbacks can relocate the cursor anywhere on buffer*/
522
522
Py_ssize_t outleft = (Py_ssize_t )(buf .outbuf_end - buf .outbuf );
523
523
524
- r = codec -> encode (state , codec -> config ,
524
+ r = codec -> encode (state , codec ,
525
525
kind , data ,
526
526
& buf .inpos , buf .inlen ,
527
527
& buf .outbuf , outleft , flags );
@@ -538,7 +538,7 @@ multibytecodec_encode(const MultibyteCodec *codec,
538
538
Py_ssize_t outleft ;
539
539
540
540
outleft = (Py_ssize_t )(buf .outbuf_end - buf .outbuf );
541
- r = codec -> encreset (state , codec -> config , & buf .outbuf ,
541
+ r = codec -> encreset (state , codec , & buf .outbuf ,
542
542
outleft );
543
543
if (r == 0 )
544
544
break ;
@@ -616,7 +616,7 @@ _multibytecodec_MultibyteCodec_encode_impl(MultibyteCodecObject *self,
616
616
}
617
617
618
618
if (self -> codec -> encinit != NULL &&
619
- self -> codec -> encinit (& state , self -> codec -> config ) != 0 )
619
+ self -> codec -> encinit (& state , self -> codec ) != 0 )
620
620
goto errorexit ;
621
621
r = multibytecodec_encode (self -> codec , & state ,
622
622
input , NULL , errorcb ,
@@ -680,15 +680,15 @@ _multibytecodec_MultibyteCodec_decode_impl(MultibyteCodecObject *self,
680
680
buf .inbuf_end = buf .inbuf_top + datalen ;
681
681
682
682
if (self -> codec -> decinit != NULL &&
683
- self -> codec -> decinit (& state , self -> codec -> config ) != 0 )
683
+ self -> codec -> decinit (& state , self -> codec ) != 0 )
684
684
goto errorexit ;
685
685
686
686
while (buf .inbuf < buf .inbuf_end ) {
687
687
Py_ssize_t inleft , r ;
688
688
689
689
inleft = (Py_ssize_t )(buf .inbuf_end - buf .inbuf );
690
690
691
- r = self -> codec -> decode (& state , self -> codec -> config ,
691
+ r = self -> codec -> decode (& state , self -> codec ,
692
692
& buf .inbuf , inleft , & buf .writer );
693
693
if (r == 0 )
694
694
break ;
@@ -888,7 +888,7 @@ decoder_feed_buffer(MultibyteStatefulDecoderContext *ctx,
888
888
889
889
inleft = (Py_ssize_t )(buf -> inbuf_end - buf -> inbuf );
890
890
891
- r = ctx -> codec -> decode (& ctx -> state , ctx -> codec -> config ,
891
+ r = ctx -> codec -> decode (& ctx -> state , ctx -> codec ,
892
892
& buf -> inbuf , inleft , & buf -> writer );
893
893
if (r == 0 || r == MBERR_TOOFEW )
894
894
break ;
@@ -1015,7 +1015,7 @@ _multibytecodec_MultibyteIncrementalEncoder_reset_impl(MultibyteIncrementalEncod
1015
1015
Py_ssize_t r ;
1016
1016
if (self -> codec -> encreset != NULL ) {
1017
1017
outbuf = buffer ;
1018
- r = self -> codec -> encreset (& self -> state , self -> codec -> config ,
1018
+ r = self -> codec -> encreset (& self -> state , self -> codec ,
1019
1019
& outbuf , sizeof (buffer ));
1020
1020
if (r != 0 )
1021
1021
return NULL ;
@@ -1063,7 +1063,7 @@ mbiencoder_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
1063
1063
if (self -> errors == NULL )
1064
1064
goto errorexit ;
1065
1065
if (self -> codec -> encinit != NULL &&
1066
- self -> codec -> encinit (& self -> state , self -> codec -> config ) != 0 )
1066
+ self -> codec -> encinit (& self -> state , self -> codec ) != 0 )
1067
1067
goto errorexit ;
1068
1068
1069
1069
Py_DECREF (codec );
@@ -1292,7 +1292,7 @@ _multibytecodec_MultibyteIncrementalDecoder_reset_impl(MultibyteIncrementalDecod
1292
1292
/*[clinic end generated code: output=da423b1782c23ed1 input=3b63b3be85b2fb45]*/
1293
1293
{
1294
1294
if (self -> codec -> decreset != NULL &&
1295
- self -> codec -> decreset (& self -> state , self -> codec -> config ) != 0 )
1295
+ self -> codec -> decreset (& self -> state , self -> codec ) != 0 )
1296
1296
return NULL ;
1297
1297
self -> pendingsize = 0 ;
1298
1298
@@ -1338,7 +1338,7 @@ mbidecoder_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
1338
1338
if (self -> errors == NULL )
1339
1339
goto errorexit ;
1340
1340
if (self -> codec -> decinit != NULL &&
1341
- self -> codec -> decinit (& self -> state , self -> codec -> config ) != 0 )
1341
+ self -> codec -> decinit (& self -> state , self -> codec ) != 0 )
1342
1342
goto errorexit ;
1343
1343
1344
1344
Py_DECREF (codec );
@@ -1600,7 +1600,7 @@ _multibytecodec_MultibyteStreamReader_reset_impl(MultibyteStreamReaderObject *se
1600
1600
/*[clinic end generated code: output=138490370a680abc input=5d4140db84b5e1e2]*/
1601
1601
{
1602
1602
if (self -> codec -> decreset != NULL &&
1603
- self -> codec -> decreset (& self -> state , self -> codec -> config ) != 0 )
1603
+ self -> codec -> decreset (& self -> state , self -> codec ) != 0 )
1604
1604
return NULL ;
1605
1605
self -> pendingsize = 0 ;
1606
1606
@@ -1654,7 +1654,7 @@ mbstreamreader_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
1654
1654
if (self -> errors == NULL )
1655
1655
goto errorexit ;
1656
1656
if (self -> codec -> decinit != NULL &&
1657
- self -> codec -> decinit (& self -> state , self -> codec -> config ) != 0 )
1657
+ self -> codec -> decinit (& self -> state , self -> codec ) != 0 )
1658
1658
goto errorexit ;
1659
1659
1660
1660
Py_DECREF (codec );
@@ -1877,7 +1877,7 @@ mbstreamwriter_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
1877
1877
if (self -> errors == NULL )
1878
1878
goto errorexit ;
1879
1879
if (self -> codec -> encinit != NULL &&
1880
- self -> codec -> encinit (& self -> state , self -> codec -> config ) != 0 )
1880
+ self -> codec -> encinit (& self -> state , self -> codec ) != 0 )
1881
1881
goto errorexit ;
1882
1882
1883
1883
Py_DECREF (codec );
@@ -1971,7 +1971,7 @@ _multibytecodec___create_codec(PyObject *module, PyObject *arg)
1971
1971
1972
1972
codec_capsule * data = PyCapsule_GetPointer (arg , CODEC_CAPSULE );
1973
1973
const MultibyteCodec * codec = data -> codec ;
1974
- if (codec -> codecinit != NULL && codec -> codecinit (codec -> config ) != 0 )
1974
+ if (codec -> codecinit != NULL && codec -> codecinit (codec ) != 0 )
1975
1975
return NULL ;
1976
1976
1977
1977
module_state * state = get_module_state (module );
0 commit comments