mirror of
https://github.com/python/cpython.git
synced 2025-08-28 20:56:54 +00:00
Issue #18722: Remove uses of the "register" keyword in C code.
This commit is contained in:
parent
9eaa3e6732
commit
9ed5f27266
38 changed files with 288 additions and 286 deletions
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue