Issue #18722: Remove uses of the "register" keyword in C code.

This commit is contained in:
Antoine Pitrou 2013-08-13 20:18:52 +02:00
parent 9eaa3e6732
commit 9ed5f27266
38 changed files with 288 additions and 286 deletions

View file

@ -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 */