diff options
38 files changed, 288 insertions, 286 deletions
diff --git a/Include/bytesobject.h b/Include/bytesobject.h index d7c7ffd..0ee8d36 100644 --- a/Include/bytesobject.h +++ b/Include/bytesobject.h @@ -86,11 +86,11 @@ PyAPI_FUNC(PyObject *) _PyBytes_Join(PyObject *sep, PyObject *x); 0-terminated (passing a string with embedded NULL characters will cause an exception). */ PyAPI_FUNC(int) PyBytes_AsStringAndSize( - register PyObject *obj, /* string or Unicode object */ - register char **s, /* pointer to buffer variable */ - register Py_ssize_t *len /* pointer to length variable or NULL - (only possible for 0-terminated - strings) */ + PyObject *obj, /* string or Unicode object */ + char **s, /* pointer to buffer variable */ + Py_ssize_t *len /* pointer to length variable or NULL + (only possible for 0-terminated + strings) */ ); /* Using the current locale, insert the thousands grouping diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h index 2abc9b4..6d830c0 100644 --- a/Include/unicodeobject.h +++ b/Include/unicodeobject.h @@ -859,7 +859,7 @@ PyAPI_FUNC(int) PyUnicode_Resize( */ PyAPI_FUNC(PyObject*) PyUnicode_FromEncodedObject( - register PyObject *obj, /* Object */ + PyObject *obj, /* Object */ const char *encoding, /* encoding */ const char *errors /* error handling */ ); @@ -878,7 +878,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_FromEncodedObject( */ PyAPI_FUNC(PyObject*) PyUnicode_FromObject( - register PyObject *obj /* Object */ + PyObject *obj /* Object */ ); PyAPI_FUNC(PyObject *) PyUnicode_FromFormatV( @@ -1015,7 +1015,7 @@ PyAPI_FUNC(void) _Py_ReleaseInternedUnicodeStrings(void); The buffer is copied into the new object. */ PyAPI_FUNC(PyObject*) PyUnicode_FromWideChar( - register const wchar_t *w, /* wchar_t buffer */ + const wchar_t *w, /* wchar_t buffer */ Py_ssize_t size /* size of buffer */ ); @@ -1033,7 +1033,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_FromWideChar( PyAPI_FUNC(Py_ssize_t) PyUnicode_AsWideChar( PyObject *unicode, /* Unicode object */ - register wchar_t *w, /* wchar_t buffer */ + wchar_t *w, /* wchar_t buffer */ Py_ssize_t size /* size of buffer */ ); @@ -10,6 +10,8 @@ Projected Release date: 2013-09-08 Core and Builtins ----------------- +- Issue #18722: Remove uses of the "register" keyword in C code. + - Issue #18667: Add missing "HAVE_FCHOWNAT" symbol to posix._have_functions. - Issue #16499: Add command line option for isolated mode. diff --git a/Modules/_codecsmodule.c b/Modules/_codecsmodule.c index 40037b1..0b093ab 100644 --- a/Modules/_codecsmodule.c +++ b/Modules/_codecsmodule.c @@ -189,9 +189,9 @@ escape_encode(PyObject *self, return NULL; } else { - register Py_ssize_t i; - register char c; - register char *p = PyBytes_AS_STRING(v); + Py_ssize_t i; + char c; + char *p = PyBytes_AS_STRING(v); for (i = 0; i < size; i++) { /* There's at least enough room for a hex escape */ diff --git a/Modules/_dbmmodule.c b/Modules/_dbmmodule.c index 1ce85f5..d899480 100644 --- a/Modules/_dbmmodule.c +++ b/Modules/_dbmmodule.c @@ -63,7 +63,7 @@ newdbmobject(char *file, int flags, int mode) /* Methods */ static void -dbm_dealloc(register dbmobject *dp) +dbm_dealloc(dbmobject *dp) { if ( dp->di_dbm ) dbm_close(dp->di_dbm); @@ -91,7 +91,7 @@ dbm_length(dbmobject *dp) } static PyObject * -dbm_subscript(dbmobject *dp, register PyObject *key) +dbm_subscript(dbmobject *dp, PyObject *key) { datum drec, krec; Py_ssize_t tmp_size; @@ -166,7 +166,7 @@ static PyMappingMethods dbm_as_mapping = { }; static PyObject * -dbm__close(register dbmobject *dp, PyObject *unused) +dbm__close(dbmobject *dp, PyObject *unused) { if (dp->di_dbm) dbm_close(dp->di_dbm); @@ -176,9 +176,9 @@ dbm__close(register dbmobject *dp, PyObject *unused) } static PyObject * -dbm_keys(register dbmobject *dp, PyObject *unused) +dbm_keys(dbmobject *dp, PyObject *unused) { - register PyObject *v, *item; + PyObject *v, *item; datum key; int err; @@ -249,7 +249,7 @@ static PySequenceMethods dbm_as_sequence = { }; static PyObject * -dbm_get(register dbmobject *dp, PyObject *args) +dbm_get(dbmobject *dp, PyObject *args) { datum key, val; PyObject *defvalue = Py_None; @@ -272,7 +272,7 @@ dbm_get(register dbmobject *dp, PyObject *args) } static PyObject * -dbm_setdefault(register dbmobject *dp, PyObject *args) +dbm_setdefault(dbmobject *dp, PyObject *args) { datum key, val; PyObject *defvalue = NULL; diff --git a/Modules/_gdbmmodule.c b/Modules/_gdbmmodule.c index 474561b..1db021a 100644 --- a/Modules/_gdbmmodule.c +++ b/Modules/_gdbmmodule.c @@ -79,7 +79,7 @@ newdbmobject(char *file, int flags, int mode) /* Methods */ static void -dbm_dealloc(register dbmobject *dp) +dbm_dealloc(dbmobject *dp) { if (dp->di_dbm) gdbm_close(dp->di_dbm); @@ -112,7 +112,7 @@ dbm_length(dbmobject *dp) } static PyObject * -dbm_subscript(dbmobject *dp, register PyObject *key) +dbm_subscript(dbmobject *dp, PyObject *key) { PyObject *v; datum drec, krec; @@ -232,7 +232,7 @@ PyDoc_STRVAR(dbm_close__doc__, Closes the database."); static PyObject * -dbm_close(register dbmobject *dp, PyObject *unused) +dbm_close(dbmobject *dp, PyObject *unused) { if (dp->di_dbm) gdbm_close(dp->di_dbm); @@ -247,9 +247,9 @@ PyDoc_STRVAR(dbm_keys__doc__, Get a list of all keys in the database."); static PyObject * -dbm_keys(register dbmobject *dp, PyObject *unused) +dbm_keys(dbmobject *dp, PyObject *unused) { - register PyObject *v, *item; + PyObject *v, *item; datum key, nextkey; int err; @@ -328,9 +328,9 @@ hash values, and won't be sorted by the key values. This method\n\ returns the starting key."); static PyObject * -dbm_firstkey(register dbmobject *dp, PyObject *unused) +dbm_firstkey(dbmobject *dp, PyObject *unused) { - register PyObject *v; + PyObject *v; datum key; check_dbmobject_open(dp); @@ -358,9 +358,9 @@ to create a list in memory that contains them all:\n\ k = db.nextkey(k)"); static PyObject * -dbm_nextkey(register dbmobject *dp, PyObject *args) +dbm_nextkey(dbmobject *dp, PyObject *args) { - register PyObject *v; + PyObject *v; datum key, nextkey; if (!PyArg_ParseTuple(args, "s#:nextkey", &key.dptr, &key.dsize)) @@ -387,7 +387,7 @@ by using this reorganization; otherwise, deleted file space will be\n\ kept and reused as new (key,value) pairs are added."); static PyObject * -dbm_reorganize(register dbmobject *dp, PyObject *unused) +dbm_reorganize(dbmobject *dp, PyObject *unused) { check_dbmobject_open(dp); errno = 0; @@ -408,7 +408,7 @@ When the database has been opened in fast mode, this method forces\n\ any unwritten data to be written to the disk."); static PyObject * -dbm_sync(register dbmobject *dp, PyObject *unused) +dbm_sync(dbmobject *dp, PyObject *unused) { check_dbmobject_open(dp); gdbm_sync(dp->di_dbm); diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c index f5706dd..75b31f5 100644 --- a/Modules/arraymodule.c +++ b/Modules/arraymodule.c @@ -513,7 +513,7 @@ newarrayobject(PyTypeObject *type, Py_ssize_t size, struct arraydescr *descr) static PyObject * getarrayitem(PyObject *op, Py_ssize_t i) { - register arrayobject *ap; + arrayobject *ap; assert(array_Check(op)); ap = (arrayobject *)op; assert(i>=0 && i<Py_SIZE(ap)); @@ -1225,8 +1225,8 @@ Byteswap all items of the array. If the items in the array are not 1, 2,\n\ static PyObject * array_reverse(arrayobject *self, PyObject *unused) { - register Py_ssize_t itemsize = self->ob_descr->itemsize; - register char *p, *q; + Py_ssize_t itemsize = self->ob_descr->itemsize; + char *p, *q; /* little buffer to hold items while swapping */ char tmp[256]; /* 8 is probably enough -- but why skimp */ assert((size_t)itemsize <= sizeof(tmp)); diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c index aa38924..6ea654e 100644 --- a/Objects/bytearrayobject.c +++ b/Objects/bytearrayobject.c @@ -862,9 +862,9 @@ bytearray_repr(PyByteArrayObject *self) /* 15 == strlen(quote_prefix) + 2 + strlen(quote_postfix) + 1 */ size_t newsize; PyObject *v; - register Py_ssize_t i; - register char c; - register char *p; + Py_ssize_t i; + char c; + char *p; int quote; char *test, *start; char *buffer; @@ -1431,9 +1431,9 @@ table, which must be a bytes object of length 256."); static PyObject * bytearray_translate(PyByteArrayObject *self, PyObject *args) { - register char *input, *output; - register const char *table; - register Py_ssize_t i, c; + char *input, *output; + const char *table; + Py_ssize_t i, c; PyObject *input_obj = (PyObject*)self; const char *output_start; Py_ssize_t inlen; diff --git a/Objects/bytes_methods.c b/Objects/bytes_methods.c index ef3c2f7..4e8107b 100644 --- a/Objects/bytes_methods.c +++ b/Objects/bytes_methods.c @@ -10,9 +10,9 @@ and there is at least one character in B, False otherwise."); PyObject* _Py_bytes_isspace(const char *cptr, Py_ssize_t len) { - register const unsigned char *p + const unsigned char *p = (unsigned char *) cptr; - register const unsigned char *e; + const unsigned char *e; /* Shortcut for single character strings */ if (len == 1 && Py_ISSPACE(*p)) @@ -40,9 +40,9 @@ and there is at least one character in B, False otherwise."); PyObject* _Py_bytes_isalpha(const char *cptr, Py_ssize_t len) { - register const unsigned char *p + const unsigned char *p = (unsigned char *) cptr; - register const unsigned char *e; + const unsigned char *e; /* Shortcut for single character strings */ if (len == 1 && Py_ISALPHA(*p)) @@ -70,9 +70,9 @@ and there is at least one character in B, False otherwise."); PyObject* _Py_bytes_isalnum(const char *cptr, Py_ssize_t len) { - register const unsigned char *p + const unsigned char *p = (unsigned char *) cptr; - register const unsigned char *e; + const unsigned char *e; /* Shortcut for single character strings */ if (len == 1 && Py_ISALNUM(*p)) @@ -100,9 +100,9 @@ and there is at least one character in B, False otherwise."); PyObject* _Py_bytes_isdigit(const char *cptr, Py_ssize_t len) { - register const unsigned char *p + const unsigned char *p = (unsigned char *) cptr; - register const unsigned char *e; + const unsigned char *e; /* Shortcut for single character strings */ if (len == 1 && Py_ISDIGIT(*p)) @@ -130,9 +130,9 @@ at least one cased character in B, False otherwise."); PyObject* _Py_bytes_islower(const char *cptr, Py_ssize_t len) { - register const unsigned char *p + const unsigned char *p = (unsigned char *) cptr; - register const unsigned char *e; + const unsigned char *e; int cased; /* Shortcut for single character strings */ @@ -164,9 +164,9 @@ at least one cased character in B, False otherwise."); PyObject* _Py_bytes_isupper(const char *cptr, Py_ssize_t len) { - register const unsigned char *p + const unsigned char *p = (unsigned char *) cptr; - register const unsigned char *e; + const unsigned char *e; int cased; /* Shortcut for single character strings */ @@ -200,9 +200,9 @@ otherwise."); PyObject* _Py_bytes_istitle(const char *cptr, Py_ssize_t len) { - register const unsigned char *p + const unsigned char *p = (unsigned char *) cptr; - register const unsigned char *e; + const unsigned char *e; int cased, previous_is_cased; /* Shortcut for single character strings */ @@ -217,7 +217,7 @@ _Py_bytes_istitle(const char *cptr, Py_ssize_t len) cased = 0; previous_is_cased = 0; for (; p < e; p++) { - register const unsigned char ch = *p; + const unsigned char ch = *p; if (Py_ISUPPER(ch)) { if (previous_is_cased) diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index 056ac36..3a2906c 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -74,7 +74,7 @@ static PyBytesObject *nullstring; PyObject * PyBytes_FromStringAndSize(const char *str, Py_ssize_t size) { - register PyBytesObject *op; + PyBytesObject *op; if (size < 0) { PyErr_SetString(PyExc_SystemError, "Negative size passed to PyBytes_FromStringAndSize"); @@ -126,8 +126,8 @@ PyBytes_FromStringAndSize(const char *str, Py_ssize_t size) PyObject * PyBytes_FromString(const char *str) { - register size_t size; - register PyBytesObject *op; + size_t size; + PyBytesObject *op; assert(str != NULL); size = strlen(str); @@ -513,7 +513,7 @@ PyObject *PyBytes_DecodeEscape(const char *s, /* object api */ Py_ssize_t -PyBytes_Size(register PyObject *op) +PyBytes_Size(PyObject *op) { if (!PyBytes_Check(op)) { PyErr_Format(PyExc_TypeError, @@ -524,7 +524,7 @@ PyBytes_Size(register PyObject *op) } char * -PyBytes_AsString(register PyObject *op) +PyBytes_AsString(PyObject *op) { if (!PyBytes_Check(op)) { PyErr_Format(PyExc_TypeError, @@ -535,9 +535,9 @@ PyBytes_AsString(register PyObject *op) } int -PyBytes_AsStringAndSize(register PyObject *obj, - register char **s, - register Py_ssize_t *len) +PyBytes_AsStringAndSize(PyObject *obj, + char **s, + Py_ssize_t *len) { if (s == NULL) { PyErr_BadInternalCall(); @@ -579,7 +579,7 @@ PyBytes_AsStringAndSize(register PyObject *obj, PyObject * PyBytes_Repr(PyObject *obj, int smartquotes) { - register PyBytesObject* op = (PyBytesObject*) obj; + PyBytesObject* op = (PyBytesObject*) obj; Py_ssize_t i, length = Py_SIZE(op); size_t newsize, squotes, dquotes; PyObject *v; @@ -718,12 +718,12 @@ bytes_concat(PyObject *a, PyObject *b) } static PyObject * -bytes_repeat(register PyBytesObject *a, register Py_ssize_t n) +bytes_repeat(PyBytesObject *a, Py_ssize_t n) { - register Py_ssize_t i; - register Py_ssize_t j; - register Py_ssize_t size; - register PyBytesObject *op; + Py_ssize_t i; + Py_ssize_t j; + Py_ssize_t size; + PyBytesObject *op; size_t nbytes; if (n < 0) n = 0; @@ -793,7 +793,7 @@ bytes_contains(PyObject *self, PyObject *arg) } static PyObject * -bytes_item(PyBytesObject *a, register Py_ssize_t i) +bytes_item(PyBytesObject *a, Py_ssize_t i) { if (i < 0 || i >= Py_SIZE(a)) { PyErr_SetString(PyExc_IndexError, "index out of range"); @@ -1461,9 +1461,9 @@ table, which must be a bytes object of length 256."); static PyObject * bytes_translate(PyBytesObject *self, PyObject *args) { - register char *input, *output; + char *input, *output; const char *table; - register Py_ssize_t i, c, changed = 0; + Py_ssize_t i, c, changed = 0; PyObject *input_obj = (PyObject*)self; const char *output_start, *del_table=NULL; Py_ssize_t inlen, tablen, dellen = 0; @@ -2748,9 +2748,9 @@ PyTypeObject PyBytes_Type = { }; void -PyBytes_Concat(register PyObject **pv, register PyObject *w) +PyBytes_Concat(PyObject **pv, PyObject *w) { - register PyObject *v; + PyObject *v; assert(pv != NULL); if (*pv == NULL) return; @@ -2764,7 +2764,7 @@ PyBytes_Concat(register PyObject **pv, register PyObject *w) } void -PyBytes_ConcatAndDel(register PyObject **pv, register PyObject *w) +PyBytes_ConcatAndDel(PyObject **pv, PyObject *w) { PyBytes_Concat(pv, w); Py_XDECREF(w); @@ -2788,8 +2788,8 @@ PyBytes_ConcatAndDel(register PyObject **pv, register PyObject *w) int _PyBytes_Resize(PyObject **pv, Py_ssize_t newsize) { - register PyObject *v; - register PyBytesObject *sv; + PyObject *v; + PyBytesObject *sv; v = *pv; if (!PyBytes_Check(v) || Py_REFCNT(v) != 1 || newsize < 0) { *pv = 0; diff --git a/Objects/classobject.c b/Objects/classobject.c index cdc9b1c..27f7ef4 100644 --- a/Objects/classobject.c +++ b/Objects/classobject.c @@ -44,7 +44,7 @@ PyMethod_Self(PyObject *im) PyObject * PyMethod_New(PyObject *func, PyObject *self) { - register PyMethodObject *im; + PyMethodObject *im; if (self == NULL) { PyErr_BadInternalCall(); return NULL; @@ -164,7 +164,7 @@ method_new(PyTypeObject* type, PyObject* args, PyObject *kw) } static void -method_dealloc(register PyMethodObject *im) +method_dealloc(PyMethodObject *im) { _PyObject_GC_UNTRACK(im); if (im->im_weakreflist != NULL) @@ -509,7 +509,7 @@ instancemethod_call(PyObject *self, PyObject *arg, PyObject *kw) static PyObject * instancemethod_descr_get(PyObject *descr, PyObject *obj, PyObject *type) { - register PyObject *func = PyInstanceMethod_GET_FUNCTION(descr); + PyObject *func = PyInstanceMethod_GET_FUNCTION(descr); if (obj == NULL) { Py_INCREF(func); return func; diff --git a/Objects/complexobject.c b/Objects/complexobject.c index 54838cc..5747450 100644 --- a/Objects/complexobject.c +++ b/Objects/complexobject.c @@ -211,7 +211,7 @@ complex_subtype_from_c_complex(PyTypeObject *type, Py_complex cval) PyObject * PyComplex_FromCComplex(Py_complex cval) { - register PyComplexObject *op; + PyComplexObject *op; /* Inline PyObject_New */ op = (PyComplexObject *) PyObject_MALLOC(sizeof(PyComplexObject)); diff --git a/Objects/dictobject.c b/Objects/dictobject.c index e0cb8ac..b5cbfb1 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -467,13 +467,13 @@ static PyDictKeyEntry * lookdict(PyDictObject *mp, PyObject *key, Py_hash_t hash, PyObject ***value_addr) { - register size_t i; - register size_t perturb; - register PyDictKeyEntry *freeslot; - register size_t mask; + size_t i; + size_t perturb; + PyDictKeyEntry *freeslot; + size_t mask; PyDictKeyEntry *ep0; - register PyDictKeyEntry *ep; - register int cmp; + PyDictKeyEntry *ep; + int cmp; PyObject *startkey; top: @@ -559,12 +559,12 @@ static PyDictKeyEntry * lookdict_unicode(PyDictObject *mp, PyObject *key, Py_hash_t hash, PyObject ***value_addr) { - register size_t i; - register size_t perturb; - register PyDictKeyEntry *freeslot; - register size_t mask = DK_MASK(mp->ma_keys); + size_t i; + size_t perturb; + PyDictKeyEntry *freeslot; + size_t mask = DK_MASK(mp->ma_keys); PyDictKeyEntry *ep0 = &mp->ma_keys->dk_entries[0]; - register PyDictKeyEntry *ep; + PyDictKeyEntry *ep; /* Make sure this function doesn't have to handle non-unicode keys, including subclasses of str; e.g., one reason to subclass @@ -624,11 +624,11 @@ static PyDictKeyEntry * lookdict_unicode_nodummy(PyDictObject *mp, PyObject *key, Py_hash_t hash, PyObject ***value_addr) { - register size_t i; - register size_t perturb; - register size_t mask = DK_MASK(mp->ma_keys); + size_t i; + size_t perturb; + size_t mask = DK_MASK(mp->ma_keys); PyDictKeyEntry *ep0 = &mp->ma_keys->dk_entries[0]; - register PyDictKeyEntry *ep; + PyDictKeyEntry *ep; /* Make sure this function doesn't have to handle non-unicode keys, including subclasses of str; e.g., one reason to subclass @@ -669,11 +669,11 @@ static PyDictKeyEntry * lookdict_split(PyDictObject *mp, PyObject *key, Py_hash_t hash, PyObject ***value_addr) { - register size_t i; - register size_t perturb; - register size_t mask = DK_MASK(mp->ma_keys); + size_t i; + size_t perturb; + size_t mask = DK_MASK(mp->ma_keys); PyDictKeyEntry *ep0 = &mp->ma_keys->dk_entries[0]; - register PyDictKeyEntry *ep; + PyDictKeyEntry *ep; if (!PyUnicode_CheckExact(key)) { ep = lookdict(mp, key, hash, value_addr); @@ -1498,7 +1498,7 @@ dict_length(PyDictObject *mp) } static PyObject * -dict_subscript(PyDictObject *mp, register PyObject *key) +dict_subscript(PyDictObject *mp, PyObject *key) { PyObject *v; Py_hash_t hash; @@ -1554,10 +1554,10 @@ static PyMappingMethods dict_as_mapping = { }; static PyObject * -dict_keys(register PyDictObject *mp) +dict_keys(PyDictObject *mp) { - register PyObject *v; - register Py_ssize_t i, j; + PyObject *v; + Py_ssize_t i, j; PyDictKeyEntry *ep; Py_ssize_t size, n, offset; PyObject **value_ptr; @@ -1598,10 +1598,10 @@ dict_keys(register PyDictObject *mp) } static PyObject * -dict_values(register PyDictObject *mp) +dict_values(PyDictObject *mp) { - register PyObject *v; - register Py_ssize_t i, j; + PyObject *v; + Py_ssize_t i, j; Py_ssize_t size, n, offset; PyObject **value_ptr; @@ -1640,10 +1640,10 @@ dict_values(register PyDictObject *mp) } static PyObject * -dict_items(register PyDictObject *mp) +dict_items(PyDictObject *mp) { - register PyObject *v; - register Py_ssize_t i, j, n; + PyObject *v; + Py_ssize_t i, j, n; Py_ssize_t size, offset; PyObject *item, *key; PyDictKeyEntry *ep; @@ -1915,8 +1915,8 @@ PyDict_Update(PyObject *a, PyObject *b) int PyDict_Merge(PyObject *a, PyObject *b, int override) { - register PyDictObject *mp, *other; - register Py_ssize_t i, n; + PyDictObject *mp, *other; + Py_ssize_t i, n; PyDictKeyEntry *entry; /* We accept for the argument either a concrete dictionary object, @@ -2013,7 +2013,7 @@ PyDict_Merge(PyObject *a, PyObject *b, int override) } static PyObject * -dict_copy(register PyDictObject *mp) +dict_copy(PyDictObject *mp) { return PyDict_Copy((PyObject*)mp); } @@ -2175,7 +2175,7 @@ dict_richcompare(PyObject *v, PyObject *w, int op) } static PyObject * -dict_contains(register PyDictObject *mp, PyObject *key) +dict_contains(PyDictObject *mp, PyObject *key) { Py_hash_t hash; PyDictKeyEntry *ep; @@ -2194,7 +2194,7 @@ dict_contains(register PyDictObject *mp, PyObject *key) } static PyObject * -dict_get(register PyDictObject *mp, PyObject *args) +dict_get(PyDictObject *mp, PyObject *args) { PyObject *key; PyObject *failobj = Py_None; @@ -2280,7 +2280,7 @@ dict_setdefault(PyDictObject *mp, PyObject *args) } static PyObject * -dict_clear(register PyDictObject *mp) +dict_clear(PyDictObject *mp) { PyDict_Clear((PyObject *)mp); Py_RETURN_NONE; @@ -2824,8 +2824,8 @@ static PyMethodDef dictiter_methods[] = { static PyObject *dictiter_iternextkey(dictiterobject *di) { PyObject *key; - register Py_ssize_t i, mask, offset; - register PyDictKeysObject *k; + Py_ssize_t i, mask, offset; + PyDictKeysObject *k; PyDictObject *d = di->di_dict; PyObject **value_ptr; @@ -2907,7 +2907,7 @@ PyTypeObject PyDictIterKey_Type = { static PyObject *dictiter_iternextvalue(dictiterobject *di) { PyObject *value; - register Py_ssize_t i, mask, offset; + Py_ssize_t i, mask, offset; PyDictObject *d = di->di_dict; PyObject **value_ptr; @@ -2988,7 +2988,7 @@ PyTypeObject PyDictIterValue_Type = { static PyObject *dictiter_iternextitem(dictiterobject *di) { PyObject *key, *value, *result = di->di_result; - register Py_ssize_t i, mask, offset; + Py_ssize_t i, mask, offset; PyDictObject *d = di->di_dict; PyObject **value_ptr; diff --git a/Objects/floatobject.c b/Objects/floatobject.c index 7ee2034..fea83fa 100644 --- a/Objects/floatobject.c +++ b/Objects/floatobject.c @@ -109,7 +109,7 @@ PyFloat_GetInfo(void) PyObject * PyFloat_FromDouble(double fval) { - register PyFloatObject *op = free_list; + PyFloatObject *op = free_list; if (op != NULL) { free_list = (PyFloatObject *) Py_TYPE(op); numfree--; @@ -241,7 +241,7 @@ PyFloat_AsDouble(PyObject *op) static int convert_to_double(PyObject **v, double *dbl) { - register PyObject *obj = *v; + PyObject *obj = *v; if (PyLong_Check(obj)) { *dbl = PyLong_AsDouble(obj); diff --git a/Objects/listobject.c b/Objects/listobject.c index 2f203b3..c08c1f6 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -213,11 +213,11 @@ PyList_GetItem(PyObject *op, Py_ssize_t i) } int -PyList_SetItem(register PyObject *op, register Py_ssize_t i, - register PyObject *newitem) +PyList_SetItem(PyObject *op, Py_ssize_t i, + PyObject *newitem) { - register PyObject *olditem; - register PyObject **p; + PyObject *olditem; + PyObject **p; if (!PyList_Check(op)) { Py_XDECREF(newitem); PyErr_BadInternalCall(); @@ -1058,9 +1058,9 @@ sortslice_advance(sortslice *slice, Py_ssize_t n) static int binarysort(sortslice lo, PyObject **hi, PyObject **start) { - register Py_ssize_t k; - register PyObject **l, **p, **r; - register PyObject *pivot; + Py_ssize_t k; + PyObject **l, **p, **r; + PyObject *pivot; assert(lo.keys <= start && start <= hi); /* assert [lo, start) is sorted */ diff --git a/Objects/longobject.c b/Objects/longobject.c index e0d641a0..9784734 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -110,7 +110,7 @@ _PyLong_Negate(PyLongObject **x_p) of the algorithms used, this could save at most be one word anyway. */ static PyLongObject * -long_normalize(register PyLongObject *v) +long_normalize(PyLongObject *v) { Py_ssize_t j = ABS(Py_SIZE(v)); Py_ssize_t i = j; @@ -340,7 +340,7 @@ long PyLong_AsLongAndOverflow(PyObject *vv, int *overflow) { /* This version by Tim Peters */ - register PyLongObject *v; + PyLongObject *v; unsigned long x, prev; long res; Py_ssize_t i; @@ -463,7 +463,7 @@ _PyLong_AsInt(PyObject *obj) Py_ssize_t PyLong_AsSsize_t(PyObject *vv) { - register PyLongObject *v; + PyLongObject *v; size_t x, prev; Py_ssize_t i; int sign; @@ -519,7 +519,7 @@ PyLong_AsSsize_t(PyObject *vv) { unsigned long PyLong_AsUnsignedLong(PyObject *vv) { - register PyLongObject *v; + PyLongObject *v; unsigned long x, prev; Py_ssize_t i; @@ -563,7 +563,7 @@ PyLong_AsUnsignedLong(PyObject *vv) size_t PyLong_AsSize_t(PyObject *vv) { - register PyLongObject *v; + PyLongObject *v; size_t x, prev; Py_ssize_t i; @@ -606,7 +606,7 @@ PyLong_AsSize_t(PyObject *vv) static unsigned long _PyLong_AsUnsignedLongMask(PyObject *vv) { - register PyLongObject *v; + PyLongObject *v; unsigned long x; Py_ssize_t i; int sign; @@ -634,7 +634,7 @@ _PyLong_AsUnsignedLongMask(PyObject *vv) } unsigned long -PyLong_AsUnsignedLongMask(register PyObject *op) +PyLong_AsUnsignedLongMask(PyObject *op) { PyNumberMethods *nb; PyLongObject *lo; @@ -1250,7 +1250,7 @@ PyLong_AsUnsignedLongLong(PyObject *vv) static unsigned PY_LONG_LONG _PyLong_AsUnsignedLongLongMask(PyObject *vv) { - register PyLongObject *v; + PyLongObject *v; unsigned PY_LONG_LONG x; Py_ssize_t i; int sign; @@ -1278,7 +1278,7 @@ _PyLong_AsUnsignedLongLongMask(PyObject *vv) } unsigned PY_LONG_LONG -PyLong_AsUnsignedLongLongMask(register PyObject *op) +PyLong_AsUnsignedLongLongMask(PyObject *op) { PyNumberMethods *nb; PyLongObject *lo; @@ -1326,7 +1326,7 @@ PY_LONG_LONG PyLong_AsLongLongAndOverflow(PyObject *vv, int *overflow) { /* This version by Tim Peters */ - register PyLongObject *v; + PyLongObject *v; unsigned PY_LONG_LONG x, prev; PY_LONG_LONG res; Py_ssize_t i; @@ -1744,7 +1744,7 @@ static int long_format_binary(PyObject *aa, int base, int alternate, PyObject **p_output, _PyUnicodeWriter *writer) { - register PyLongObject *a = (PyLongObject *)aa; + PyLongObject *a = (PyLongObject *)aa; PyObject *v; Py_ssize_t sz; Py_ssize_t size_a; @@ -2141,7 +2141,7 @@ that triggers it(!). Instead the code was tested by artificially allocating just 1 digit at the start, so that the copying code was exercised for every digit beyond the first. ***/ - register twodigits c; /* current input character */ + twodigits c; /* current input character */ Py_ssize_t size_z; int i; int convwidth; diff --git a/Objects/namespaceobject.c b/Objects/namespaceobject.c index 8c51b07..9e95094 100644 --- a/Objects/namespaceobject.c +++ b/Objects/namespaceobject.c @@ -176,7 +176,7 @@ namespace_richcompare(PyObject *self, PyObject *other, int op) PyDoc_STRVAR(namespace_reduce__doc__, "Return state information for pickling"); static PyObject * -namespace_reduce(register _PyNamespaceObject *ns) +namespace_reduce(_PyNamespaceObject *ns) { PyObject *result, *args = PyTuple_New(0); diff --git a/Objects/object.c b/Objects/object.c index c83109d..8d4fe42 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -1834,10 +1834,10 @@ _Py_NewReference(PyObject *op) } void -_Py_ForgetReference(register PyObject *op) +_Py_ForgetReference(PyObject *op) { #ifdef SLOW_UNREF_CHECK - register PyObject *p; + PyObject *p; #endif if (op->ob_refcnt < 0) Py_FatalError("UNREF negative refcnt"); diff --git a/Objects/setobject.c b/Objects/setobject.c index 0cea2a8..eff91c5 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -75,15 +75,15 @@ NULL if the rich comparison returns an error. */ static setentry * -set_lookkey(PySetObject *so, PyObject *key, register Py_hash_t hash) +set_lookkey(PySetObject *so, PyObject *key, Py_hash_t hash) { - register size_t i; /* Unsigned for defined overflow behavior. */ - register size_t perturb; - register setentry *freeslot; - register size_t mask = so->mask; + size_t i; /* Unsigned for defined overflow behavior. */ + size_t perturb; + setentry *freeslot; + size_t mask = so->mask; setentry *table = so->table; - register setentry *entry; - register int cmp; + setentry *entry; + int cmp; PyObject *startkey; i = (size_t)hash & mask; @@ -157,14 +157,14 @@ set_lookkey(PySetObject *so, PyObject *key, register Py_hash_t hash) * see if the comparison altered the table. */ static setentry * -set_lookkey_unicode(PySetObject *so, PyObject *key, register Py_hash_t hash) +set_lookkey_unicode(PySetObject *so, PyObject *key, Py_hash_t hash) { - register size_t i; /* Unsigned for defined overflow behavior. */ - register size_t perturb; - register setentry *freeslot; - register size_t mask = so->mask; + size_t i; /* Unsigned for defined overflow behavior. */ + size_t perturb; + setentry *freeslot; + size_t mask = so->mask; setentry *table = so->table; - register setentry *entry; + setentry *entry; /* Make sure this function doesn't have to handle non-unicode keys, including subclasses of str; e.g., one reason to subclass @@ -211,9 +211,9 @@ Used by the public insert routine. Eats a reference to key. */ static int -set_insert_key(register PySetObject *so, PyObject *key, Py_hash_t hash) +set_insert_key(PySetObject *so, PyObject *key, Py_hash_t hash) { - register setentry *entry; + setentry *entry; assert(so->lookup != NULL); entry = so->lookup(so, key, hash); @@ -247,13 +247,13 @@ Note that no refcounts are changed by this routine; if needed, the caller is responsible for incref'ing `key`. */ static void -set_insert_clean(register PySetObject *so, PyObject *key, Py_hash_t hash) +set_insert_clean(PySetObject *so, PyObject *key, Py_hash_t hash) { - register size_t i; - register size_t perturb; - register size_t mask = (size_t)so->mask; + size_t i; + size_t perturb; + size_t mask = (size_t)so->mask; setentry *table = so->table; - register setentry *entry; + setentry *entry; i = (size_t)hash & mask; entry = &table[i]; @@ -360,9 +360,9 @@ set_table_resize(PySetObject *so, Py_ssize_t minused) /* CAUTION: set_add_key/entry() must guarantee it won't resize the table */ static int -set_add_entry(register PySetObject *so, setentry *entry) +set_add_entry(PySetObject *so, setentry *entry) { - register Py_ssize_t n_used; + Py_ssize_t n_used; PyObject *key = entry->key; Py_hash_t hash = entry->hash; @@ -379,10 +379,10 @@ set_add_entry(register PySetObject *so, setentry *entry) } static int -set_add_key(register PySetObject *so, PyObject *key) +set_add_key(PySetObject *so, PyObject *key) { - register Py_hash_t hash; - register Py_ssize_t n_used; + Py_hash_t hash; + Py_ssize_t n_used; if (!PyUnicode_CheckExact(key) || (hash = ((PyASCIIObject *) key)->hash) == -1) { @@ -407,7 +407,7 @@ set_add_key(register PySetObject *so, PyObject *key) static int set_discard_entry(PySetObject *so, setentry *oldentry) -{ register setentry *entry; +{ setentry *entry; PyObject *old_key; entry = (so->lookup)(so, oldentry->key, oldentry->hash); @@ -426,8 +426,8 @@ set_discard_entry(PySetObject *so, setentry *oldentry) static int set_discard_key(PySetObject *so, PyObject *key) { - register Py_hash_t hash; - register setentry *entry; + Py_hash_t hash; + setentry *entry; PyObject *old_key; assert (PyAnySet_Check(so)); @@ -533,7 +533,7 @@ set_next(PySetObject *so, Py_ssize_t *pos_ptr, setentry **entry_ptr) { Py_ssize_t i; Py_ssize_t mask; - register setentry *table; + setentry *table; assert (PyAnySet_Check(so)); i = *pos_ptr; @@ -553,7 +553,7 @@ set_next(PySetObject *so, Py_ssize_t *pos_ptr, setentry **entry_ptr) static void set_dealloc(PySetObject *so) { - register setentry *entry; + setentry *entry; Py_ssize_t fill = so->fill; PyObject_GC_UnTrack(so); Py_TRASHCAN_SAFE_BEGIN(so) @@ -632,8 +632,8 @@ set_merge(PySetObject *so, PyObject *otherset) PySetObject *other; PyObject *key; Py_hash_t hash; - register Py_ssize_t i; - register setentry *entry; + Py_ssize_t i; + setentry *entry; assert (PyAnySet_Check(so)); assert (PyAnySet_Check(otherset)); @@ -701,8 +701,8 @@ set_contains_entry(PySetObject *so, setentry *entry) static PyObject * set_pop(PySetObject *so) { - register Py_ssize_t i = 0; - register setentry *entry; + Py_ssize_t i = 0; + setentry *entry; PyObject *key; assert (PyAnySet_Check(so)); @@ -869,8 +869,8 @@ static PyMethodDef setiter_methods[] = { static PyObject *setiter_iternext(setiterobject *si) { PyObject *key; - register Py_ssize_t i, mask; - register setentry *entry; + Py_ssize_t i, mask; + setentry *entry; PySetObject *so = si->si_set; if (so == NULL) @@ -1024,7 +1024,7 @@ PyDoc_STRVAR(update_doc, static PyObject * make_new_set(PyTypeObject *type, PyObject *iterable) { - register PySetObject *so = NULL; + PySetObject *so = NULL; if (dummy == NULL) { /* Auto-initialize dummy */ dummy = PyUnicode_FromString("<dummy key>"); 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 @@ STRINGLIB(utf8_decode)(const char **inptr, const char *end, */ 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 @@ STRINGLIB(utf16_decode)(const unsigned char **inptr, const unsigned char *e, 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 @@ STRINGLIB(find_max_char)(const STRINGLIB_CHAR *begin, const STRINGLIB_CHAR *end) 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 @@ STRINGLIB(find_max_char)(const STRINGLIB_CHAR *begin, const STRINGLIB_CHAR *end) #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 @@ STRINGLIB(splitlines)(PyObject* str_obj, 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; diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c index 52896b7..a33d8c0 100644 --- a/Objects/tupleobject.c +++ b/Objects/tupleobject.c @@ -63,9 +63,9 @@ _PyTuple_DebugMallocStats(FILE *out) } PyObject * -PyTuple_New(register Py_ssize_t size) +PyTuple_New(Py_ssize_t size) { - register PyTupleObject *op; + PyTupleObject *op; Py_ssize_t i; if (size < 0) { PyErr_BadInternalCall(); @@ -122,7 +122,7 @@ PyTuple_New(register Py_ssize_t size) } Py_ssize_t -PyTuple_Size(register PyObject *op) +PyTuple_Size(PyObject *op) { if (!PyTuple_Check(op)) { PyErr_BadInternalCall(); @@ -133,7 +133,7 @@ PyTuple_Size(register PyObject *op) } PyObject * -PyTuple_GetItem(register PyObject *op, register Py_ssize_t i) +PyTuple_GetItem(PyObject *op, Py_ssize_t i) { if (!PyTuple_Check(op)) { PyErr_BadInternalCall(); @@ -147,10 +147,10 @@ PyTuple_GetItem(register PyObject *op, register Py_ssize_t i) } int -PyTuple_SetItem(register PyObject *op, register Py_ssize_t i, PyObject *newitem) +PyTuple_SetItem(PyObject *op, Py_ssize_t i, PyObject *newitem) { - register PyObject *olditem; - register PyObject **p; + PyObject *olditem; + PyObject **p; if (!PyTuple_Check(op) || op->ob_refcnt != 1) { Py_XDECREF(newitem); PyErr_BadInternalCall(); @@ -224,10 +224,10 @@ PyTuple_Pack(Py_ssize_t n, ...) /* Methods */ static void -tupledealloc(register PyTupleObject *op) +tupledealloc(PyTupleObject *op) { - register Py_ssize_t i; - register Py_ssize_t len = Py_SIZE(op); + Py_ssize_t i; + Py_ssize_t len = Py_SIZE(op); PyObject_GC_UnTrack(op); Py_TRASHCAN_SAFE_BEGIN(op) if (len > 0) { @@ -330,10 +330,10 @@ error: static Py_hash_t tuplehash(PyTupleObject *v) { - register Py_uhash_t x; /* Unsigned for defined overflow behavior. */ - register Py_hash_t y; - register Py_ssize_t len = Py_SIZE(v); - register PyObject **p; + Py_uhash_t x; /* Unsigned for defined overflow behavior. */ + Py_hash_t y; + Py_ssize_t len = Py_SIZE(v); + PyObject **p; Py_uhash_t mult = _PyHASH_MULTIPLIER; x = 0x345678UL; p = v->ob_item; @@ -370,7 +370,7 @@ tuplecontains(PyTupleObject *a, PyObject *el) } static PyObject * -tupleitem(register PyTupleObject *a, register Py_ssize_t i) +tupleitem(PyTupleObject *a, Py_ssize_t i) { if (i < 0 || i >= Py_SIZE(a)) { PyErr_SetString(PyExc_IndexError, "tuple index out of range"); @@ -381,12 +381,12 @@ tupleitem(register PyTupleObject *a, register Py_ssize_t i) } static PyObject * -tupleslice(register PyTupleObject *a, register Py_ssize_t ilow, - register Py_ssize_t ihigh) +tupleslice(PyTupleObject *a, Py_ssize_t ilow, + Py_ssize_t ihigh) { - register PyTupleObject *np; + PyTupleObject *np; PyObject **src, **dest; - register Py_ssize_t i; + Py_ssize_t i; Py_ssize_t len; if (ilow < 0) ilow = 0; @@ -423,10 +423,10 @@ PyTuple_GetSlice(PyObject *op, Py_ssize_t i, Py_ssize_t j) } static PyObject * -tupleconcat(register PyTupleObject *a, register PyObject *bb) +tupleconcat(PyTupleObject *a, PyObject *bb) { - register Py_ssize_t size; - register Py_ssize_t i; + Py_ssize_t size; + Py_ssize_t i; PyObject **src, **dest; PyTupleObject *np; if (!PyTuple_Check(bb)) { @@ -836,8 +836,8 @@ PyTypeObject PyTuple_Type = { int _PyTuple_Resize(PyObject **pv, Py_ssize_t newsize) { - register PyTupleObject *v; - register PyTupleObject *sv; + PyTupleObject *v; + PyTupleObject *sv; Py_ssize_t i; Py_ssize_t oldsize; diff --git a/Objects/unicodectype.c b/Objects/unicodectype.c index a572c12..ea540d6 100644 --- a/Objects/unicodectype.c +++ b/Objects/unicodectype.c @@ -61,7 +61,7 @@ gettyperecord(Py_UCS4 code) /* Returns the titlecase Unicode characters corresponding to ch or just ch if no titlecase mapping is known. */ -Py_UCS4 _PyUnicode_ToTitlecase(register Py_UCS4 ch) +Py_UCS4 _PyUnicode_ToTitlecase(Py_UCS4 ch) { const _PyUnicode_TypeRecord *ctype = gettyperecord(ch); diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 2f437f6..f1d687a 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -873,7 +873,7 @@ resize_copy(PyObject *unicode, Py_ssize_t length) static PyUnicodeObject * _PyUnicode_New(Py_ssize_t length) { - register PyUnicodeObject *unicode; + PyUnicodeObject *unicode; size_t new_size; /* Optimization for empty strings */ @@ -1557,7 +1557,7 @@ _PyUnicode_Ready(PyObject *unicode) } static void -unicode_dealloc(register PyObject *unicode) +unicode_dealloc(PyObject *unicode) { switch (PyUnicode_CHECK_INTERNED(unicode)) { case SSTATE_NOT_INTERNED: @@ -2287,7 +2287,7 @@ PyUnicode_AsUCS4Copy(PyObject *string) #ifdef HAVE_WCHAR_H PyObject * -PyUnicode_FromWideChar(register const wchar_t *w, Py_ssize_t size) +PyUnicode_FromWideChar(const wchar_t *w, Py_ssize_t size) { if (w == NULL) { if (size == 0) @@ -2898,7 +2898,7 @@ PyUnicode_FromOrdinal(int ordinal) } PyObject * -PyUnicode_FromObject(register PyObject *obj) +PyUnicode_FromObject(PyObject *obj) { /* XXX Perhaps we should make this API an alias of PyObject_Str() instead ?! */ @@ -2920,7 +2920,7 @@ PyUnicode_FromObject(register PyObject *obj) } PyObject * -PyUnicode_FromEncodedObject(register PyObject *obj, +PyUnicode_FromEncodedObject(PyObject *obj, const char *encoding, const char *errors) { @@ -4653,9 +4653,9 @@ ascii_decode(const char *start, const char *end, Py_UCS1 *dest) if (_Py_IS_ALIGNED(p, SIZEOF_LONG)) { /* Fast path, see in STRINGLIB(utf8_decode) for an explanation. */ - /* Help register allocation */ - register const char *_p = p; - register Py_UCS1 * q = dest; + /* Help allocation */ + const char *_p = p; + Py_UCS1 * q = dest; while (_p < aligned_end) { unsigned long value = *(const unsigned long *) _p; if (value & ASCII_CHAR_MASK) @@ -4678,8 +4678,8 @@ ascii_decode(const char *start, const char *end, Py_UCS1 *dest) /* Fast path, see in STRINGLIB(utf8_decode) in stringlib/codecs.h for an explanation. */ if (_Py_IS_ALIGNED(p, SIZEOF_LONG)) { - /* Help register allocation */ - register const char *_p = p; + /* Help allocation */ + const char *_p = p; while (_p < aligned_end) { unsigned long value = *(unsigned long *) _p; if (value & ASCII_CHAR_MASK) @@ -6513,7 +6513,7 @@ PyUnicode_DecodeASCII(const char *s, s += writer.pos; kind = writer.kind; while (s < e) { - register unsigned char c = (unsigned char)*s; + unsigned char c = (unsigned char)*s; if (c < 128) { PyUnicode_WRITE(kind, data, writer.pos, c); writer.pos++; @@ -14621,7 +14621,7 @@ _PyUnicode_Fini(void) void PyUnicode_InternInPlace(PyObject **p) { - register PyObject *s = *p; + PyObject *s = *p; PyObject *t; #ifdef Py_DEBUG assert(s != NULL); @@ -14954,7 +14954,7 @@ Py_UNICODE_strcmp(const Py_UNICODE *s1, const Py_UNICODE *s2) int Py_UNICODE_strncmp(const Py_UNICODE *s1, const Py_UNICODE *s2, size_t n) { - register Py_UNICODE u1, u2; + Py_UNICODE u1, u2; for (; n != 0; n--) { u1 = *s1; u2 = *s2; diff --git a/Objects/unicodetype_db.h b/Objects/unicodetype_db.h index 1009bb3..57add8f 100644 --- a/Objects/unicodetype_db.h +++ b/Objects/unicodetype_db.h @@ -4278,7 +4278,7 @@ double _PyUnicode_ToNumeric(Py_UCS4 ch) /* Returns 1 for Unicode characters having the bidirectional * type 'WS', 'B' or 'S' or the category 'Zs', 0 otherwise. */ -int _PyUnicode_IsWhitespace(register const Py_UCS4 ch) +int _PyUnicode_IsWhitespace(const Py_UCS4 ch) { switch (ch) { case 0x0009: @@ -4320,7 +4320,7 @@ int _PyUnicode_IsWhitespace(register const Py_UCS4 ch) * property 'BK', 'CR', 'LF' or 'NL' or having bidirectional * type 'B', 0 otherwise. */ -int _PyUnicode_IsLinebreak(register const Py_UCS4 ch) +int _PyUnicode_IsLinebreak(const Py_UCS4 ch) { switch (ch) { case 0x000A: diff --git a/Parser/grammar1.c b/Parser/grammar1.c index 7136463..30a6f07 100644 --- a/Parser/grammar1.c +++ b/Parser/grammar1.c @@ -9,9 +9,9 @@ /* Return the DFA for the given type */ dfa * -PyGrammar_FindDFA(grammar *g, register int type) +PyGrammar_FindDFA(grammar *g, int type) { - register dfa *d; + dfa *d; #if 1 /* Massive speed-up */ d = &g->g_dfa[type - NT_OFFSET]; @@ -19,7 +19,7 @@ PyGrammar_FindDFA(grammar *g, register int type) return d; #else /* Old, slow version */ - register int i; + int i; for (i = g->g_ndfas, d = g->g_dfa; --i >= 0; d++) { if (d->d_type == type) diff --git a/Parser/node.c b/Parser/node.c index 1e4f0da..b26ce61 100644 --- a/Parser/node.c +++ b/Parser/node.c @@ -76,7 +76,7 @@ fancy_roundup(int n) int -PyNode_AddChild(register node *n1, int type, char *str, int lineno, int col_offset) +PyNode_AddChild(node *n1, int type, char *str, int lineno, int col_offset) { const int nch = n1->n_nchildren; int current_capacity; diff --git a/Parser/parser.c b/Parser/parser.c index b505fe0..fc102f2 100644 --- a/Parser/parser.c +++ b/Parser/parser.c @@ -35,9 +35,9 @@ s_reset(stack *s) #define s_empty(s) ((s)->s_top == &(s)->s_base[MAXSTACK]) static int -s_push(register stack *s, dfa *d, node *parent) +s_push(stack *s, dfa *d, node *parent) { - register stackentry *top; + stackentry *top; if (s->s_top == s->s_base) { fprintf(stderr, "s_push: parser stack overflow\n"); return E_NOMEM; @@ -52,7 +52,7 @@ s_push(register stack *s, dfa *d, node *parent) #ifdef Py_DEBUG static void -s_pop(register stack *s) +s_pop(stack *s) { if (s_empty(s)) Py_FatalError("s_pop: parser stack underflow -- FATAL"); @@ -105,7 +105,7 @@ PyParser_Delete(parser_state *ps) /* PARSER STACK OPERATIONS */ static int -shift(register stack *s, int type, char *str, int newstate, int lineno, int col_offset) +shift(stack *s, int type, char *str, int newstate, int lineno, int col_offset) { int err; assert(!s_empty(s)); @@ -117,10 +117,10 @@ shift(register stack *s, int type, char *str, int newstate, int lineno, int col_ } static int -push(register stack *s, int type, dfa *d, int newstate, int lineno, int col_offset) +push(stack *s, int type, dfa *d, int newstate, int lineno, int col_offset) { int err; - register node *n; + node *n; n = s->s_top->s_parent; assert(!s_empty(s)); err = PyNode_AddChild(n, type, (char *)NULL, lineno, col_offset); @@ -137,12 +137,12 @@ static int classify(parser_state *ps, int type, char *str) { grammar *g = ps->p_grammar; - register int n = g->g_ll.ll_nlabels; + int n = g->g_ll.ll_nlabels; if (type == NAME) { - register char *s = str; - register label *l = g->g_ll.ll_label; - register int i; + char *s = str; + label *l = g->g_ll.ll_label; + int i; for (i = n; i > 0; i--, l++) { if (l->lb_type != NAME || l->lb_str == NULL || l->lb_str[0] != s[0] || @@ -165,8 +165,8 @@ classify(parser_state *ps, int type, char *str) } { - register label *l = g->g_ll.ll_label; - register int i; + label *l = g->g_ll.ll_label; + int i; for (i = n; i > 0; i--, l++) { if (l->lb_type == type && l->lb_str == NULL) { D(printf("It's a token we know\n")); @@ -225,10 +225,10 @@ future_hack(parser_state *ps) #endif /* future keyword */ int -PyParser_AddToken(register parser_state *ps, register int type, char *str, +PyParser_AddToken(parser_state *ps, int type, char *str, int lineno, int col_offset, int *expected_ret) { - register int ilabel; + int ilabel; int err; D(printf("Token %s/'%s' ... ", _PyParser_TokenNames[type], str)); @@ -241,15 +241,15 @@ PyParser_AddToken(register parser_state *ps, register int type, char *str, /* Loop until the token is shifted or an error occurred */ for (;;) { /* Fetch the current dfa and state */ - register dfa *d = ps->p_stack.s_top->s_dfa; - register state *s = &d->d_state[ps->p_stack.s_top->s_state]; + dfa *d = ps->p_stack.s_top->s_dfa; + state *s = &d->d_state[ps->p_stack.s_top->s_state]; D(printf(" DFA '%s', state %d:", d->d_name, ps->p_stack.s_top->s_state)); /* Check accelerator */ if (s->s_lower <= ilabel && ilabel < s->s_upper) { - register int x = s->s_accel[ilabel - s->s_lower]; + int x = s->s_accel[ilabel - s->s_lower]; if (x != -1) { if (x & (1<<7)) { /* Push non-terminal */ diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c index c4160fc..97990e9 100644 --- a/Parser/tokenizer.c +++ b/Parser/tokenizer.c @@ -874,7 +874,7 @@ PyTokenizer_Free(struct tok_state *tok) /* Get next char, updating state; error code goes into tok->done */ static int -tok_nextc(register struct tok_state *tok) +tok_nextc(struct tok_state *tok) { for (;;) { if (tok->cur != tok->inp) { @@ -1071,7 +1071,7 @@ tok_nextc(register struct tok_state *tok) /* Back-up one character */ static void -tok_backup(register struct tok_state *tok, register int c) +tok_backup(struct tok_state *tok, int c) { if (c != EOF) { if (--tok->cur < tok->buf) @@ -1301,9 +1301,9 @@ verify_identifier(struct tok_state *tok) /* Get next token, after space stripping etc. */ static int -tok_get(register struct tok_state *tok, char **p_start, char **p_end) +tok_get(struct tok_state *tok, char **p_start, char **p_end) { - register int c; + int c; int blankline, nonascii; *p_start = *p_end = NULL; @@ -1313,8 +1313,8 @@ tok_get(register struct tok_state *tok, char **p_start, char **p_end) /* Get indentation level */ if (tok->atbol) { - register int col = 0; - register int altcol = 0; + int col = 0; + int altcol = 0; tok->atbol = 0; for (;;) { c = tok_nextc(tok); diff --git a/Python/ceval.c b/Python/ceval.c index 465876b..fcc1c24 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -37,7 +37,7 @@ typedef unsigned long long uint64; static void ppc_getcounter(uint64 *v) { - register unsigned long tbu, tb, tbu2; + unsigned long tbu, tb, tbu2; loop: asm volatile ("mftbu %0" : "=r" (tbu) ); @@ -792,12 +792,12 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag) #ifdef DXPAIRS int lastopcode = 0; #endif - register PyObject **stack_pointer; /* Next free slot in value stack */ - register unsigned char *next_instr; - register int opcode; /* Current opcode */ - register int oparg; /* Current opcode argument, if any */ - register enum why_code why; /* Reason for block stack unwind */ - register PyObject **fastlocals, **freevars; + PyObject **stack_pointer; /* Next free slot in value stack */ + unsigned char *next_instr; + int opcode; /* Current opcode */ + int oparg; /* Current opcode argument, if any */ + enum why_code why; /* Reason for block stack unwind */ + PyObject **fastlocals, **freevars; PyObject *retval = NULL; /* Return value */ PyThreadState *tstate = PyThreadState_GET(); PyCodeObject *co; @@ -3373,9 +3373,9 @@ PyEval_EvalCodeEx(PyObject *_co, PyObject *globals, PyObject *locals, PyObject **defs, int defcount, PyObject *kwdefs, PyObject *closure) { PyCodeObject* co = (PyCodeObject*)_co; - register PyFrameObject *f; - register PyObject *retval = NULL; - register PyObject **fastlocals, **freevars; + PyFrameObject *f; + PyObject *retval = NULL; + PyObject **fastlocals, **freevars; PyThreadState *tstate = PyThreadState_GET(); PyObject *x, *u; int total_args = co->co_argcount + co->co_kwonlyargcount; @@ -3895,7 +3895,7 @@ static int call_trace(Py_tracefunc func, PyObject *obj, PyFrameObject *frame, int what, PyObject *arg) { - register PyThreadState *tstate = frame->f_tstate; + PyThreadState *tstate = frame->f_tstate; int result; if (tstate->tracing) return 0; @@ -4581,7 +4581,7 @@ _PyEval_SliceIndex(PyObject *v, Py_ssize_t *pi) "BaseException is not allowed" static PyObject * -cmp_outcome(int op, register PyObject *v, register PyObject *w) +cmp_outcome(int op, PyObject *v, PyObject *w) { int res = 0; switch (op) { diff --git a/Python/codecs.c b/Python/codecs.c index 899f0aa..cb9f0d8 100644 --- a/Python/codecs.c +++ b/Python/codecs.c @@ -53,7 +53,7 @@ int PyCodec_Register(PyObject *search_function) static PyObject *normalizestring(const char *string) { - register size_t i; + size_t i; size_t len = strlen(string); char *p; PyObject *v; @@ -67,7 +67,7 @@ PyObject *normalizestring(const char *string) if (p == NULL) return PyErr_NoMemory(); for (i = 0; i < len; i++) { - register char ch = string[i]; + char ch = string[i]; if (ch == ' ') ch = '-'; else diff --git a/Python/dynload_aix.c b/Python/dynload_aix.c index f40a0be..5ac30ed 100644 --- a/Python/dynload_aix.c +++ b/Python/dynload_aix.c @@ -30,11 +30,11 @@ const char *_PyImport_DynLoadFiletab[] = {".so", NULL}; static int aix_getoldmodules(void **modlistptr) { - register ModulePtr modptr, prevmodptr; - register struct ld_info *ldiptr; - register char *ldibuf; - register int errflag, bufsize = 1024; - register unsigned int offset; + ModulePtr modptr, prevmodptr; + struct ld_info *ldiptr; + char *ldibuf; + int errflag, bufsize = 1024; + unsigned int offset; char *progname = Py_GetProgramName(); /* @@ -106,7 +106,7 @@ aix_loaderror(const char *pathname) char *message[1024], errbuf[1024]; PyObject *pathname_ob = NULL; PyObject *errbuf_ob = NULL; - register int i,j; + int i,j; struct errtab { int errNo; diff --git a/Python/marshal.c b/Python/marshal.c index 1997e19..ec2d51f 100644 --- a/Python/marshal.c +++ b/Python/marshal.c @@ -613,7 +613,7 @@ r_byte(RFILE *p) static int r_short(RFILE *p) { - register short x; + short x; unsigned char buffer[2]; r_string((char *) buffer, 2, p); @@ -627,7 +627,7 @@ r_short(RFILE *p) static long r_long(RFILE *p) { - register long x; + long x; unsigned char buffer[4]; r_string((char *) buffer, 4, p); diff --git a/Python/mystrtoul.c b/Python/mystrtoul.c index 8a54cbf..725f07c 100644 --- a/Python/mystrtoul.c +++ b/Python/mystrtoul.c @@ -92,11 +92,11 @@ static int digitlimit[] = { ** exceptions - we don't check for them. */ unsigned long -PyOS_strtoul(register char *str, char **ptr, int base) +PyOS_strtoul(char *str, char **ptr, int base) { - register unsigned long result = 0; /* return value of the function */ - register int c; /* current input character */ - register int ovlimit; /* required digits to overflow */ + unsigned long result = 0; /* return value of the function */ + int c; /* current input character */ + int ovlimit; /* required digits to overflow */ /* skip leading white space */ while (*str && Py_ISSPACE(Py_CHARMASK(*str))) @@ -213,7 +213,7 @@ PyOS_strtoul(register char *str, char **ptr, int base) if (ovlimit > 0) /* no overflow check required */ result = result * base + c; else { /* requires overflow check */ - register unsigned long temp_result; + unsigned long temp_result; if (ovlimit < 0) /* guaranteed overflow */ goto overflowed; diff --git a/Python/strdup.c b/Python/strdup.c index 20187e0..769d3db 100644 --- a/Python/strdup.c +++ b/Python/strdup.c @@ -6,7 +6,7 @@ char * strdup(const char *str) { if (str != NULL) { - register char *copy = malloc(strlen(str) + 1); + char *copy = malloc(strlen(str) + 1); if (copy != NULL) return strcpy(copy, str); } diff --git a/Tools/unicode/makeunicodedata.py b/Tools/unicode/makeunicodedata.py index 2f8e620..01021c8 100644 --- a/Tools/unicode/makeunicodedata.py +++ b/Tools/unicode/makeunicodedata.py @@ -552,7 +552,7 @@ def makeunicodetype(unicode, trace): print("/* Returns 1 for Unicode characters having the bidirectional", file=fp) print(" * type 'WS', 'B' or 'S' or the category 'Zs', 0 otherwise.", file=fp) print(" */", file=fp) - print('int _PyUnicode_IsWhitespace(register const Py_UCS4 ch)', file=fp) + print('int _PyUnicode_IsWhitespace(const Py_UCS4 ch)', file=fp) print('{', file=fp) print(' switch (ch) {', file=fp) @@ -570,7 +570,7 @@ def makeunicodetype(unicode, trace): print(" * property 'BK', 'CR', 'LF' or 'NL' or having bidirectional", file=fp) print(" * type 'B', 0 otherwise.", file=fp) print(" */", file=fp) - print('int _PyUnicode_IsLinebreak(register const Py_UCS4 ch)', file=fp) + print('int _PyUnicode_IsLinebreak(const Py_UCS4 ch)', file=fp) print('{', file=fp) print(' switch (ch) {', file=fp) for codepoint in sorted(linebreaks): |