Skip to content

Commit 0caf0ce

Browse files
committed
indent
1 parent 2fa4c3a commit 0caf0ce

4 files changed

Lines changed: 19 additions & 23 deletions

File tree

‎Modules/_testinternalcapi.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,8 +1072,8 @@ encode_locale(PyObject *self, PyObject *args)
10721072
const size_t output_length_canary = (size_t)-456;
10731073
size_t output_length = output_length_canary;
10741074
int ret = _Py_EncodeLocale(wstr,
1075-
&str, &output_length, &error_pos,
1076-
current_locale, error_handler);
1075+
&str, &output_length, &error_pos,
1076+
current_locale, error_handler);
10771077
PyMem_Free(wstr);
10781078

10791079
switch(ret) {
@@ -1132,7 +1132,7 @@ decode_locale(PyObject *self, PyObject *args)
11321132
const size_t wlen_canary = (size_t)-123;
11331133
size_t wlen = wlen_canary;
11341134
int ret = _Py_DecodeLocale(str, &wstr, &wlen,
1135-
current_locale, error_handler);
1135+
current_locale, error_handler);
11361136

11371137
switch(ret) {
11381138
case 0:

‎Objects/unicodeobject.c‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3767,7 +3767,7 @@ unicode_encode_locale(PyObject *unicode, _Py_error_handler error_handler,
37673767
size_t str_len;
37683768
size_t error_pos;
37693769
int res = _Py_EncodeLocale(wstr, &str, &str_len, &error_pos,
3770-
current_locale, error_handler);
3770+
current_locale, error_handler);
37713771
PyMem_Free(wstr);
37723772

37733773
if (res != 0) {
@@ -3985,8 +3985,7 @@ unicode_decode_locale(const char *str, Py_ssize_t len,
39853985

39863986
wchar_t *wstr;
39873987
size_t wlen;
3988-
int res = _Py_DecodeLocale(str, &wstr, &wlen,
3989-
current_locale, errors);
3988+
int res = _Py_DecodeLocale(str, &wstr, &wlen, current_locale, errors);
39903989
if (res != 0) {
39913990
if (res == _Py_CODEC_DECODE_ERROR) {
39923991
PyObject *exc;
@@ -5504,7 +5503,7 @@ PyUnicode_DecodeUTF8Stateful(const char *s,
55045503
// supported.
55055504
int
55065505
_Py_DecodeUTF8(const char *s, Py_ssize_t size, wchar_t **wstr, size_t *wlen,
5507-
_Py_error_handler errors)
5506+
_Py_error_handler errors)
55085507
{
55095508
assert(s != NULL);
55105509
assert(wstr != NULL);
@@ -5610,7 +5609,7 @@ _Py_DecodeUTF8_surrogateescape(const char *arg, Py_ssize_t arglen,
56105609
{
56115610
wchar_t *wstr;
56125611
int res = _Py_DecodeUTF8(arg, arglen, &wstr, wlen,
5613-
_Py_ERROR_SURROGATEESCAPE);
5612+
_Py_ERROR_SURROGATEESCAPE);
56145613
if (res != 0) {
56155614
/* _Py_DecodeUTF8() must support _Py_ERROR_SURROGATEESCAPE */
56165615
assert(res != _Py_CODEC_UNSUPPORTED_ERROR_HANDLER);
@@ -5638,7 +5637,7 @@ _Py_DecodeUTF8_surrogateescape(const char *arg, Py_ssize_t arglen,
56385637
*/
56395638
int
56405639
_Py_EncodeUTF8(const wchar_t *text, char **str, size_t *output_length,
5641-
size_t *error_pos, int raw_malloc, _Py_error_handler errors)
5640+
size_t *error_pos, int raw_malloc, _Py_error_handler errors)
56425641
{
56435642
assert(str != NULL);
56445643
assert(output_length != NULL);
@@ -15234,7 +15233,7 @@ encode_wstr_utf8(wchar_t *wstr, char **str, const char *name)
1523415233

1523515234
size_t output_length;
1523615235
int res = _Py_EncodeUTF8(wstr, str, &output_length,
15237-
NULL, 1, _Py_ERROR_STRICT);
15236+
NULL, 1, _Py_ERROR_STRICT);
1523815237
if (res == -2) {
1523915238
PyErr_Format(PyExc_RuntimeError, "cannot encode %s", name);
1524015239
return -1;

‎Python/fileutils.c‎

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -627,8 +627,7 @@ decode_locale_impl(const char* arg, wchar_t **wstr, size_t *wlen,
627627
{
628628
if (current_locale) {
629629
#ifdef _Py_FORCE_UTF8_LOCALE
630-
return _Py_DecodeUTF8(arg, strlen(arg), wstr, wlen,
631-
errors);
630+
return _Py_DecodeUTF8(arg, strlen(arg), wstr, wlen, errors);
632631
#else
633632
return decode_current_locale(arg, wstr, wlen, errors);
634633
#endif
@@ -690,7 +689,7 @@ decode_locale_impl(const char* arg, wchar_t **wstr, size_t *wlen,
690689
// arg and wstr must not be NULL.
691690
int
692691
_Py_DecodeLocale(const char* arg, wchar_t **wstr, size_t *wlen,
693-
int current_locale, _Py_error_handler errors)
692+
int current_locale, _Py_error_handler errors)
694693
{
695694
assert(arg != NULL);
696695
assert(wstr != NULL);
@@ -751,7 +750,7 @@ Py_DecodeLocale(const char* arg, size_t *wlen)
751750
{
752751
wchar_t *wstr;
753752
int res = _Py_DecodeLocale(arg, &wstr, wlen, 0,
754-
_Py_ERROR_SURROGATEESCAPE);
753+
_Py_ERROR_SURROGATEESCAPE);
755754
if (res != 0) {
756755
assert(res == _Py_CODEC_MEMORY_ERROR || res == _Py_CODEC_DECODE_ERROR);
757756
if (wlen != NULL) {
@@ -901,7 +900,7 @@ encode_locale_inner(const wchar_t *text, char **str, size_t *output_length,
901900
if (current_locale) {
902901
#ifdef _Py_FORCE_UTF8_LOCALE
903902
return _Py_EncodeUTF8(text, str, output_length,
904-
error_pos, raw_malloc, errors);
903+
error_pos, raw_malloc, errors);
905904
#else
906905
return encode_current_locale(text, str, output_length,
907906
error_pos, raw_malloc, errors);
@@ -910,16 +909,15 @@ encode_locale_inner(const wchar_t *text, char **str, size_t *output_length,
910909

911910
#ifdef _Py_FORCE_UTF8_FS_ENCODING
912911
return _Py_EncodeUTF8(text, str, output_length,
913-
error_pos,
914-
raw_malloc, errors);
912+
error_pos, raw_malloc, errors);
915913
#else
916914
int use_utf8 = (_PyRuntime.preconfig.utf8_mode >= 1);
917915
#ifdef MS_WINDOWS
918916
use_utf8 |= (_PyRuntime.preconfig.legacy_windows_fs_encoding == 0);
919917
#endif
920918
if (use_utf8) {
921919
return _Py_EncodeUTF8(text, str, output_length,
922-
error_pos, raw_malloc, errors);
920+
error_pos, raw_malloc, errors);
923921
}
924922

925923
#ifdef USE_FORCE_ASCII
@@ -1044,8 +1042,8 @@ _Py_EncodeLocaleRaw(const wchar_t *text, size_t *error_pos)
10441042

10451043
int
10461044
_Py_EncodeLocale(const wchar_t *text, char **str, size_t *output_length,
1047-
size_t *error_pos, int current_locale,
1048-
_Py_error_handler errors)
1045+
size_t *error_pos, int current_locale,
1046+
_Py_error_handler errors)
10491047
{
10501048
return encode_locale_impl(text, str, output_length,
10511049
error_pos, 1, current_locale, errors);

‎Python/initconfig.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4155,7 +4155,7 @@ wstr_to_utf8(PyInitConfig *config, wchar_t *wstr)
41554155
char *utf8;
41564156
size_t utf8_len;
41574157
int res = _Py_EncodeUTF8(wstr, &utf8, &utf8_len,
4158-
NULL, 1, _Py_ERROR_STRICT);
4158+
NULL, 1, _Py_ERROR_STRICT);
41594159
if (res == -2) {
41604160
initconfig_set_error(config, "encoding error");
41614161
return NULL;
@@ -4325,8 +4325,7 @@ utf8_to_wstr(PyInitConfig *config, const char *str)
43254325
{
43264326
wchar_t *wstr;
43274327
size_t wlen;
4328-
int res = _Py_DecodeUTF8(str, strlen(str), &wstr, &wlen,
4329-
_Py_ERROR_STRICT);
4328+
int res = _Py_DecodeUTF8(str, strlen(str), &wstr, &wlen, _Py_ERROR_STRICT);
43304329
if (res == _Py_CODEC_DECODE_ERROR) {
43314330
initconfig_set_error(config, "decoding error");
43324331
return NULL;

0 commit comments

Comments
 (0)