Issue #18722: Remove uses of the "register" keyword in C code.
diff --git a/Objects/stringlib/codecs.h b/Objects/stringlib/codecs.h
index f855003..57319c6 100644
--- a/Objects/stringlib/codecs.h
+++ b/Objects/stringlib/codecs.h
@@ -38,8 +38,8 @@
*/
if (_Py_IS_ALIGNED(s, SIZEOF_LONG)) {
/* Help register allocation */
- register const char *_s = s;
- register STRINGLIB_CHAR *_p = p;
+ const char *_s = s;
+ STRINGLIB_CHAR *_p = p;
while (_s < aligned_end) {
/* Read a whole long at a time (either 4 or 8 bytes),
and do a fast unrolled copy if it only contains ASCII
@@ -499,7 +499,7 @@
reads are more expensive, better to defer to another iteration. */
if (_Py_IS_ALIGNED(q, SIZEOF_LONG)) {
/* Fast path for runs of in-range non-surrogate chars. */
- register const unsigned char *_q = q;
+ const unsigned char *_q = q;
while (_q < aligned_end) {
unsigned long block = * (unsigned long *) _q;
if (native_ordering) {
diff --git a/Objects/stringlib/eq.h b/Objects/stringlib/eq.h
index 8e79a43..4ad6dc0 100644
--- a/Objects/stringlib/eq.h
+++ b/Objects/stringlib/eq.h
@@ -6,8 +6,8 @@
Py_LOCAL_INLINE(int)
unicode_eq(PyObject *aa, PyObject *bb)
{
- register PyUnicodeObject *a = (PyUnicodeObject *)aa;
- register PyUnicodeObject *b = (PyUnicodeObject *)bb;
+ PyUnicodeObject *a = (PyUnicodeObject *)aa;
+ PyUnicodeObject *b = (PyUnicodeObject *)bb;
if (PyUnicode_READY(a) == -1 || PyUnicode_READY(b) == -1) {
assert(0 && "unicode_eq ready fail");
diff --git a/Objects/stringlib/find_max_char.h b/Objects/stringlib/find_max_char.h
index 06559c8..eb3fe88 100644
--- a/Objects/stringlib/find_max_char.h
+++ b/Objects/stringlib/find_max_char.h
@@ -24,7 +24,7 @@
while (p < end) {
if (_Py_IS_ALIGNED(p, SIZEOF_LONG)) {
/* Help register allocation */
- register const unsigned char *_p = p;
+ const unsigned char *_p = p;
while (_p < aligned_end) {
unsigned long value = *(unsigned long *) _p;
if (value & UCS1_ASCII_CHAR_MASK)
@@ -66,7 +66,7 @@
#else
#error Invalid STRINGLIB_SIZEOF_CHAR (must be 1, 2 or 4)
#endif
- register Py_UCS4 mask;
+ Py_UCS4 mask;
Py_ssize_t n = end - begin;
const STRINGLIB_CHAR *p = begin;
const STRINGLIB_CHAR *unrolled_end = begin + _Py_SIZE_ROUND_DOWN(n, 4);
diff --git a/Objects/stringlib/split.h b/Objects/stringlib/split.h
index 947dd28..31f77a7 100644
--- a/Objects/stringlib/split.h
+++ b/Objects/stringlib/split.h
@@ -345,8 +345,8 @@
and the appends only done when the prealloc buffer is full.
That's too much work for little gain.*/
- register Py_ssize_t i;
- register Py_ssize_t j;
+ Py_ssize_t i;
+ Py_ssize_t j;
PyObject *list = PyList_New(0);
PyObject *sub;