Skip to content

Commit 621b430

Browse files
committed
remove all usage of Py_LOCAL
1 parent 50fd898 commit 621b430

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

Diff for: Objects/bytes_methods.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ _Py_bytes_contains(const char *str, Py_ssize_t len, PyObject *arg)
670670
* against substr, using the start and end arguments. Returns
671671
* -1 on error, 0 if not found and 1 if found.
672672
*/
673-
Py_LOCAL(int)
673+
static int
674674
tailmatch(const char *str, Py_ssize_t len, PyObject *substr,
675675
Py_ssize_t start, Py_ssize_t end, int direction)
676676
{
@@ -716,7 +716,7 @@ tailmatch(const char *str, Py_ssize_t len, PyObject *substr,
716716
return 0;
717717
}
718718

719-
Py_LOCAL(PyObject *)
719+
static PyObject *
720720
_Py_bytes_tailmatch(const char *str, Py_ssize_t len,
721721
const char *function_name, PyObject *args,
722722
int direction)

Diff for: Objects/bytesobject.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1500,7 +1500,7 @@ bytes_item(PyBytesObject *a, Py_ssize_t i)
15001500
return PyLong_FromLong((unsigned char)a->ob_sval[i]);
15011501
}
15021502

1503-
Py_LOCAL(int)
1503+
static int
15041504
bytes_compare_eq(PyBytesObject *a, PyBytesObject *b)
15051505
{
15061506
int cmp;

Diff for: Objects/stringlib/transmogrify.h

+11-11
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* the more complicated methods. parts of these should be pulled out into the
66
shared code in bytes_methods.c to cut down on duplicate code bloat. */
77

8-
Py_LOCAL_INLINE(PyObject *)
8+
static inline PyObject *
99
return_self(PyObject *self)
1010
{
1111
#if !STRINGLIB_MUTABLE
@@ -90,7 +90,7 @@ stringlib_expandtabs(PyObject *self, PyObject *args, PyObject *kwds)
9090
return NULL;
9191
}
9292

93-
Py_LOCAL_INLINE(PyObject *)
93+
static inline PyObject *
9494
pad(PyObject *self, Py_ssize_t left, Py_ssize_t right, char fill)
9595
{
9696
PyObject *u;
@@ -212,7 +212,7 @@ stringlib_zfill(PyObject *self, PyObject *args)
212212
((char *)memchr((const void *)(target), c, target_len))
213213

214214

215-
Py_LOCAL_INLINE(Py_ssize_t)
215+
static Py_ssize_t
216216
countchar(const char *target, Py_ssize_t target_len, char c,
217217
Py_ssize_t maxcount)
218218
{
@@ -233,7 +233,7 @@ countchar(const char *target, Py_ssize_t target_len, char c,
233233
/* Algorithms for different cases of string replacement */
234234

235235
/* len(self)>=1, from="", len(to)>=1, maxcount>=1 */
236-
Py_LOCAL(PyObject *)
236+
static PyObject *
237237
stringlib_replace_interleave(PyObject *self,
238238
const char *to_s, Py_ssize_t to_len,
239239
Py_ssize_t maxcount)
@@ -304,7 +304,7 @@ stringlib_replace_interleave(PyObject *self,
304304

305305
/* Special case for deleting a single character */
306306
/* len(self)>=1, len(from)==1, to="", maxcount>=1 */
307-
Py_LOCAL(PyObject *)
307+
static PyObject *
308308
stringlib_replace_delete_single_character(PyObject *self,
309309
char from_c, Py_ssize_t maxcount)
310310
{
@@ -348,7 +348,7 @@ stringlib_replace_delete_single_character(PyObject *self,
348348

349349
/* len(self)>=1, len(from)>=2, to="", maxcount>=1 */
350350

351-
Py_LOCAL(PyObject *)
351+
static PyObject *
352352
stringlib_replace_delete_substring(PyObject *self,
353353
const char *from_s, Py_ssize_t from_len,
354354
Py_ssize_t maxcount)
@@ -400,7 +400,7 @@ stringlib_replace_delete_substring(PyObject *self,
400400
}
401401

402402
/* len(self)>=1, len(from)==len(to)==1, maxcount>=1 */
403-
Py_LOCAL(PyObject *)
403+
static PyObject *
404404
stringlib_replace_single_character_in_place(PyObject *self,
405405
char from_c, char to_c,
406406
Py_ssize_t maxcount)
@@ -447,7 +447,7 @@ stringlib_replace_single_character_in_place(PyObject *self,
447447
}
448448

449449
/* len(self)>=1, len(from)==len(to)>=2, maxcount>=1 */
450-
Py_LOCAL(PyObject *)
450+
static PyObject *
451451
stringlib_replace_substring_in_place(PyObject *self,
452452
const char *from_s, Py_ssize_t from_len,
453453
const char *to_s, Py_ssize_t to_len,
@@ -499,7 +499,7 @@ stringlib_replace_substring_in_place(PyObject *self,
499499
}
500500

501501
/* len(self)>=1, len(from)==1, len(to)>=2, maxcount>=1 */
502-
Py_LOCAL(PyObject *)
502+
static PyObject *
503503
stringlib_replace_single_character(PyObject *self,
504504
char from_c,
505505
const char *to_s, Py_ssize_t to_len,
@@ -563,7 +563,7 @@ stringlib_replace_single_character(PyObject *self,
563563
}
564564

565565
/* len(self)>=1, len(from)>=2, len(to)>=2, maxcount>=1 */
566-
Py_LOCAL(PyObject *)
566+
static PyObject *
567567
stringlib_replace_substring(PyObject *self,
568568
const char *from_s, Py_ssize_t from_len,
569569
const char *to_s, Py_ssize_t to_len,
@@ -632,7 +632,7 @@ stringlib_replace_substring(PyObject *self,
632632
}
633633

634634

635-
Py_LOCAL(PyObject *)
635+
static PyObject *
636636
stringlib_replace(PyObject *self,
637637
const char *from_s, Py_ssize_t from_len,
638638
const char *to_s, Py_ssize_t to_len,

Diff for: Objects/unicodeobject.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -10936,7 +10936,7 @@ unicode_compare(PyObject *str1, PyObject *str2)
1093610936
#undef COMPARE
1093710937
}
1093810938

10939-
Py_LOCAL(int)
10939+
static int
1094010940
unicode_compare_eq(PyObject *str1, PyObject *str2)
1094110941
{
1094210942
int kind;

0 commit comments

Comments
 (0)