diff options
author | Victor Stinner <vstinner@python.org> | 2022-02-07 00:26:58 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-07 00:26:58 (GMT) |
commit | 097f74a5a37e2a8a26d529cede456ede7011b66f (patch) | |
tree | 9fcb89d8fe4944fea4da359e94d3b8ce16f263aa /Objects/stringlib/split.h | |
parent | 16f96a4cf9ab1e91e6e8e18232378bc4b42bb796 (diff) | |
download | cpython-097f74a5a37e2a8a26d529cede456ede7011b66f.zip cpython-097f74a5a37e2a8a26d529cede456ede7011b66f.tar.gz cpython-097f74a5a37e2a8a26d529cede456ede7011b66f.tar.bz2 |
bpo-46670: Define all macros for stringlib (GH-31176)
bytesobject.c, bytearrayobject.c and unicodeobject.c now define all
macros used by stringlib, to avoid using undefined macros.
Fix "gcc -Wundef" warnings.
Diffstat (limited to 'Objects/stringlib/split.h')
-rw-r--r-- | Objects/stringlib/split.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Objects/stringlib/split.h b/Objects/stringlib/split.h index 068047f..0c11b72 100644 --- a/Objects/stringlib/split.h +++ b/Objects/stringlib/split.h @@ -70,7 +70,7 @@ STRINGLIB(split_whitespace)(PyObject* str_obj, j = i; i++; while (i < str_len && !STRINGLIB_ISSPACE(str[i])) i++; -#ifndef STRINGLIB_MUTABLE +#if !STRINGLIB_MUTABLE if (j == 0 && i == str_len && STRINGLIB_CHECK_EXACT(str_obj)) { /* No whitespace in str_obj, so just use it as list[0] */ Py_INCREF(str_obj); @@ -122,7 +122,7 @@ STRINGLIB(split_char)(PyObject* str_obj, } } } -#ifndef STRINGLIB_MUTABLE +#if !STRINGLIB_MUTABLE if (count == 0 && STRINGLIB_CHECK_EXACT(str_obj)) { /* ch not in str_obj, so just use str_obj as list[0] */ Py_INCREF(str_obj); @@ -170,7 +170,7 @@ STRINGLIB(split)(PyObject* str_obj, SPLIT_ADD(str, i, j); i = j + sep_len; } -#ifndef STRINGLIB_MUTABLE +#if !STRINGLIB_MUTABLE if (count == 0 && STRINGLIB_CHECK_EXACT(str_obj)) { /* No match in str_obj, so just use it as list[0] */ Py_INCREF(str_obj); @@ -209,7 +209,7 @@ STRINGLIB(rsplit_whitespace)(PyObject* str_obj, j = i; i--; while (i >= 0 && !STRINGLIB_ISSPACE(str[i])) i--; -#ifndef STRINGLIB_MUTABLE +#if !STRINGLIB_MUTABLE if (j == str_len - 1 && i < 0 && STRINGLIB_CHECK_EXACT(str_obj)) { /* No whitespace in str_obj, so just use it as list[0] */ Py_INCREF(str_obj); @@ -262,7 +262,7 @@ STRINGLIB(rsplit_char)(PyObject* str_obj, } } } -#ifndef STRINGLIB_MUTABLE +#if !STRINGLIB_MUTABLE if (count == 0 && STRINGLIB_CHECK_EXACT(str_obj)) { /* ch not in str_obj, so just use str_obj as list[0] */ Py_INCREF(str_obj); @@ -311,7 +311,7 @@ STRINGLIB(rsplit)(PyObject* str_obj, SPLIT_ADD(str, pos + sep_len, j); j = pos; } -#ifndef STRINGLIB_MUTABLE +#if !STRINGLIB_MUTABLE if (count == 0 && STRINGLIB_CHECK_EXACT(str_obj)) { /* No match in str_obj, so just use it as list[0] */ Py_INCREF(str_obj); @@ -370,7 +370,7 @@ STRINGLIB(splitlines)(PyObject* str_obj, if (keepends) eol = i; } -#ifndef STRINGLIB_MUTABLE +#if !STRINGLIB_MUTABLE if (j == 0 && eol == str_len && STRINGLIB_CHECK_EXACT(str_obj)) { /* No linebreak in str_obj, so just use it as list[0] */ if (PyList_Append(list, str_obj)) |