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