@@ -176,27 +176,27 @@ static PyObject *
176176escape_encode (PyObject * self ,
177177 PyObject * args )
178178{
179- PyObject * str ;
180- const char * errors = NULL ;
181- char * buf ;
182- Py_ssize_t len ;
183-
184- if (!PyArg_ParseTuple (args , "O!|z:escape_encode" ,
185- & PyString_Type , & str , & errors ))
186- return NULL ;
187-
188- str = PyString_Repr (str , 0 );
189- if (!str )
190- return NULL ;
191-
192- /* The string will be quoted. Unquote, similar to unicode-escape. */
193- buf = PyString_AS_STRING (str );
194- len = PyString_GET_SIZE (str );
195- memmove (buf , buf + 1 , len - 2 );
196- if (_PyString_Resize (& str , len - 2 ) < 0 )
197- return NULL ;
198-
199- return codec_tuple (str , PyString_Size (str ));
179+ PyObject * str ;
180+ const char * errors = NULL ;
181+ char * buf ;
182+ Py_ssize_t len ;
183+
184+ if (!PyArg_ParseTuple (args , "O!|z:escape_encode" ,
185+ & PyString_Type , & str , & errors ))
186+ return NULL ;
187+
188+ str = PyString_Repr (str , 0 );
189+ if (!str )
190+ return NULL ;
191+
192+ /* The string will be quoted. Unquote, similar to unicode-escape. */
193+ buf = PyString_AS_STRING (str );
194+ len = PyString_GET_SIZE (str );
195+ memmove (buf , buf + 1 , len - 2 );
196+ if (_PyString_Resize (& str , len - 2 ) < 0 )
197+ return NULL ;
198+
199+ return codec_tuple (str , PyString_Size (str ));
200200}
201201
202202#ifdef Py_USING_UNICODE
@@ -232,7 +232,7 @@ static PyObject *
232232utf_7_decode (PyObject * self ,
233233 PyObject * args )
234234{
235- Py_buffer pbuf ;
235+ Py_buffer pbuf ;
236236 const char * errors = NULL ;
237237 int final = 0 ;
238238 Py_ssize_t consumed ;
@@ -245,7 +245,7 @@ utf_7_decode(PyObject *self,
245245
246246 decoded = PyUnicode_DecodeUTF7Stateful (pbuf .buf , pbuf .len , errors ,
247247 final ? NULL : & consumed );
248- PyBuffer_Release (& pbuf );
248+ PyBuffer_Release (& pbuf );
249249 if (decoded == NULL )
250250 return NULL ;
251251 return codec_tuple (decoded , consumed );
@@ -255,7 +255,7 @@ static PyObject *
255255utf_8_decode (PyObject * self ,
256256 PyObject * args )
257257{
258- Py_buffer pbuf ;
258+ Py_buffer pbuf ;
259259 const char * errors = NULL ;
260260 int final = 0 ;
261261 Py_ssize_t consumed ;
@@ -268,7 +268,7 @@ utf_8_decode(PyObject *self,
268268
269269 decoded = PyUnicode_DecodeUTF8Stateful (pbuf .buf , pbuf .len , errors ,
270270 final ? NULL : & consumed );
271- PyBuffer_Release (& pbuf );
271+ PyBuffer_Release (& pbuf );
272272 if (decoded == NULL )
273273 return NULL ;
274274 return codec_tuple (decoded , consumed );
@@ -278,7 +278,7 @@ static PyObject *
278278utf_16_decode (PyObject * self ,
279279 PyObject * args )
280280{
281- Py_buffer pbuf ;
281+ Py_buffer pbuf ;
282282 const char * errors = NULL ;
283283 int byteorder = 0 ;
284284 int final = 0 ;
@@ -291,7 +291,7 @@ utf_16_decode(PyObject *self,
291291 consumed = pbuf .len ; /* This is overwritten unless final is true. */
292292 decoded = PyUnicode_DecodeUTF16Stateful (pbuf .buf , pbuf .len , errors ,
293293 & byteorder , final ? NULL : & consumed );
294- PyBuffer_Release (& pbuf );
294+ PyBuffer_Release (& pbuf );
295295 if (decoded == NULL )
296296 return NULL ;
297297 return codec_tuple (decoded , consumed );
@@ -301,7 +301,7 @@ static PyObject *
301301utf_16_le_decode (PyObject * self ,
302302 PyObject * args )
303303{
304- Py_buffer pbuf ;
304+ Py_buffer pbuf ;
305305 const char * errors = NULL ;
306306 int byteorder = -1 ;
307307 int final = 0 ;
@@ -315,7 +315,7 @@ utf_16_le_decode(PyObject *self,
315315 consumed = pbuf .len ; /* This is overwritten unless final is true. */
316316 decoded = PyUnicode_DecodeUTF16Stateful (pbuf .buf , pbuf .len , errors ,
317317 & byteorder , final ? NULL : & consumed );
318- PyBuffer_Release (& pbuf );
318+ PyBuffer_Release (& pbuf );
319319 if (decoded == NULL )
320320 return NULL ;
321321 return codec_tuple (decoded , consumed );
@@ -325,7 +325,7 @@ static PyObject *
325325utf_16_be_decode (PyObject * self ,
326326 PyObject * args )
327327{
328- Py_buffer pbuf ;
328+ Py_buffer pbuf ;
329329 const char * errors = NULL ;
330330 int byteorder = 1 ;
331331 int final = 0 ;
@@ -339,7 +339,7 @@ utf_16_be_decode(PyObject *self,
339339 consumed = pbuf .len ; /* This is overwritten unless final is true. */
340340 decoded = PyUnicode_DecodeUTF16Stateful (pbuf .buf , pbuf .len , errors ,
341341 & byteorder , final ? NULL : & consumed );
342- PyBuffer_Release (& pbuf );
342+ PyBuffer_Release (& pbuf );
343343 if (decoded == NULL )
344344 return NULL ;
345345 return codec_tuple (decoded , consumed );
@@ -357,7 +357,7 @@ static PyObject *
357357utf_16_ex_decode (PyObject * self ,
358358 PyObject * args )
359359{
360- Py_buffer pbuf ;
360+ Py_buffer pbuf ;
361361 const char * errors = NULL ;
362362 int byteorder = 0 ;
363363 PyObject * unicode , * tuple ;
@@ -370,7 +370,7 @@ utf_16_ex_decode(PyObject *self,
370370 consumed = pbuf .len ; /* This is overwritten unless final is true. */
371371 unicode = PyUnicode_DecodeUTF16Stateful (pbuf .buf , pbuf .len , errors ,
372372 & byteorder , final ? NULL : & consumed );
373- PyBuffer_Release (& pbuf );
373+ PyBuffer_Release (& pbuf );
374374 if (unicode == NULL )
375375 return NULL ;
376376 tuple = Py_BuildValue ("Oni" , unicode , consumed , byteorder );
@@ -382,7 +382,7 @@ static PyObject *
382382utf_32_decode (PyObject * self ,
383383 PyObject * args )
384384{
385- Py_buffer pbuf ;
385+ Py_buffer pbuf ;
386386 const char * errors = NULL ;
387387 int byteorder = 0 ;
388388 int final = 0 ;
@@ -395,7 +395,7 @@ utf_32_decode(PyObject *self,
395395 consumed = pbuf .len ; /* This is overwritten unless final is true. */
396396 decoded = PyUnicode_DecodeUTF32Stateful (pbuf .buf , pbuf .len , errors ,
397397 & byteorder , final ? NULL : & consumed );
398- PyBuffer_Release (& pbuf );
398+ PyBuffer_Release (& pbuf );
399399 if (decoded == NULL )
400400 return NULL ;
401401 return codec_tuple (decoded , consumed );
@@ -405,7 +405,7 @@ static PyObject *
405405utf_32_le_decode (PyObject * self ,
406406 PyObject * args )
407407{
408- Py_buffer pbuf ;
408+ Py_buffer pbuf ;
409409 const char * errors = NULL ;
410410 int byteorder = -1 ;
411411 int final = 0 ;
@@ -418,7 +418,7 @@ utf_32_le_decode(PyObject *self,
418418 consumed = pbuf .len ; /* This is overwritten unless final is true. */
419419 decoded = PyUnicode_DecodeUTF32Stateful (pbuf .buf , pbuf .len , errors ,
420420 & byteorder , final ? NULL : & consumed );
421- PyBuffer_Release (& pbuf );
421+ PyBuffer_Release (& pbuf );
422422 if (decoded == NULL )
423423 return NULL ;
424424 return codec_tuple (decoded , consumed );
@@ -428,7 +428,7 @@ static PyObject *
428428utf_32_be_decode (PyObject * self ,
429429 PyObject * args )
430430{
431- Py_buffer pbuf ;
431+ Py_buffer pbuf ;
432432 const char * errors = NULL ;
433433 int byteorder = 1 ;
434434 int final = 0 ;
@@ -441,7 +441,7 @@ utf_32_be_decode(PyObject *self,
441441 consumed = pbuf .len ; /* This is overwritten unless final is true. */
442442 decoded = PyUnicode_DecodeUTF32Stateful (pbuf .buf , pbuf .len , errors ,
443443 & byteorder , final ? NULL : & consumed );
444- PyBuffer_Release (& pbuf );
444+ PyBuffer_Release (& pbuf );
445445 if (decoded == NULL )
446446 return NULL ;
447447 return codec_tuple (decoded , consumed );
@@ -459,7 +459,7 @@ static PyObject *
459459utf_32_ex_decode (PyObject * self ,
460460 PyObject * args )
461461{
462- Py_buffer pbuf ;
462+ Py_buffer pbuf ;
463463 const char * errors = NULL ;
464464 int byteorder = 0 ;
465465 PyObject * unicode , * tuple ;
@@ -472,7 +472,7 @@ utf_32_ex_decode(PyObject *self,
472472 consumed = pbuf .len ; /* This is overwritten unless final is true. */
473473 unicode = PyUnicode_DecodeUTF32Stateful (pbuf .buf , pbuf .len , errors ,
474474 & byteorder , final ? NULL : & consumed );
475- PyBuffer_Release (& pbuf );
475+ PyBuffer_Release (& pbuf );
476476 if (unicode == NULL )
477477 return NULL ;
478478 tuple = Py_BuildValue ("Oni" , unicode , consumed , byteorder );
@@ -484,76 +484,76 @@ static PyObject *
484484unicode_escape_decode (PyObject * self ,
485485 PyObject * args )
486486{
487- Py_buffer pbuf ;
487+ Py_buffer pbuf ;
488488 const char * errors = NULL ;
489489 PyObject * unicode ;
490490
491491 if (!PyArg_ParseTuple (args , "s*|z:unicode_escape_decode" ,
492492 & pbuf , & errors ))
493493 return NULL ;
494494
495- unicode = PyUnicode_DecodeUnicodeEscape (pbuf .buf , pbuf .len , errors );
496- PyBuffer_Release (& pbuf );
497- return codec_tuple (unicode , pbuf .len );
495+ unicode = PyUnicode_DecodeUnicodeEscape (pbuf .buf , pbuf .len , errors );
496+ PyBuffer_Release (& pbuf );
497+ return codec_tuple (unicode , pbuf .len );
498498}
499499
500500static PyObject *
501501raw_unicode_escape_decode (PyObject * self ,
502502 PyObject * args )
503503{
504- Py_buffer pbuf ;
504+ Py_buffer pbuf ;
505505 const char * errors = NULL ;
506- PyObject * unicode ;
506+ PyObject * unicode ;
507507
508508 if (!PyArg_ParseTuple (args , "s*|z:raw_unicode_escape_decode" ,
509509 & pbuf , & errors ))
510510 return NULL ;
511511
512- unicode = PyUnicode_DecodeRawUnicodeEscape (pbuf .buf , pbuf .len , errors );
513- PyBuffer_Release (& pbuf );
514- return codec_tuple (unicode , pbuf .len );
512+ unicode = PyUnicode_DecodeRawUnicodeEscape (pbuf .buf , pbuf .len , errors );
513+ PyBuffer_Release (& pbuf );
514+ return codec_tuple (unicode , pbuf .len );
515515}
516516
517517static PyObject *
518518latin_1_decode (PyObject * self ,
519519 PyObject * args )
520520{
521- Py_buffer pbuf ;
522- PyObject * unicode ;
521+ Py_buffer pbuf ;
522+ PyObject * unicode ;
523523 const char * errors = NULL ;
524524
525525 if (!PyArg_ParseTuple (args , "s*|z:latin_1_decode" ,
526526 & pbuf , & errors ))
527527 return NULL ;
528528
529- unicode = PyUnicode_DecodeLatin1 (pbuf .buf , pbuf .len , errors );
530- PyBuffer_Release (& pbuf );
531- return codec_tuple (unicode , pbuf .len );
529+ unicode = PyUnicode_DecodeLatin1 (pbuf .buf , pbuf .len , errors );
530+ PyBuffer_Release (& pbuf );
531+ return codec_tuple (unicode , pbuf .len );
532532}
533533
534534static PyObject *
535535ascii_decode (PyObject * self ,
536536 PyObject * args )
537537{
538- Py_buffer pbuf ;
539- PyObject * unicode ;
538+ Py_buffer pbuf ;
539+ PyObject * unicode ;
540540 const char * errors = NULL ;
541541
542542 if (!PyArg_ParseTuple (args , "s*|z:ascii_decode" ,
543543 & pbuf , & errors ))
544544 return NULL ;
545545
546- unicode = PyUnicode_DecodeASCII (pbuf .buf , pbuf .len , errors );
547- PyBuffer_Release (& pbuf );
548- return codec_tuple (unicode , pbuf .len );
546+ unicode = PyUnicode_DecodeASCII (pbuf .buf , pbuf .len , errors );
547+ PyBuffer_Release (& pbuf );
548+ return codec_tuple (unicode , pbuf .len );
549549}
550550
551551static PyObject *
552552charmap_decode (PyObject * self ,
553553 PyObject * args )
554554{
555- Py_buffer pbuf ;
556- PyObject * unicode ;
555+ Py_buffer pbuf ;
556+ PyObject * unicode ;
557557 const char * errors = NULL ;
558558 PyObject * mapping = NULL ;
559559
@@ -563,9 +563,9 @@ charmap_decode(PyObject *self,
563563 if (mapping == Py_None )
564564 mapping = NULL ;
565565
566- unicode = PyUnicode_DecodeCharmap (pbuf .buf , pbuf .len , mapping , errors );
567- PyBuffer_Release (& pbuf );
568- return codec_tuple (unicode , pbuf .len );
566+ unicode = PyUnicode_DecodeCharmap (pbuf .buf , pbuf .len , mapping , errors );
567+ PyBuffer_Release (& pbuf );
568+ return codec_tuple (unicode , pbuf .len );
569569}
570570
571571#if defined(MS_WINDOWS ) && defined(HAVE_USABLE_WCHAR_T )
@@ -574,7 +574,7 @@ static PyObject *
574574mbcs_decode (PyObject * self ,
575575 PyObject * args )
576576{
577- Py_buffer pbuf ;
577+ Py_buffer pbuf ;
578578 const char * errors = NULL ;
579579 int final = 0 ;
580580 Py_ssize_t consumed ;
@@ -587,7 +587,7 @@ mbcs_decode(PyObject *self,
587587
588588 decoded = PyUnicode_DecodeMBCSStateful (pbuf .buf , pbuf .len , errors ,
589589 final ? NULL : & consumed );
590- PyBuffer_Release (& pbuf );
590+ PyBuffer_Release (& pbuf );
591591 if (decoded == NULL )
592592 return NULL ;
593593 return codec_tuple (decoded , consumed );
0 commit comments