Use 'short int' rather than 'short', and similarly for 'long', 'unsigned', etc.

This commit is contained in:
Paul Eggert
2004-03-31 00:37:21 +00:00
parent 2ae64eed27
commit 779e7ceb93
25 changed files with 171 additions and 126 deletions

View File

@@ -1,7 +1,7 @@
/* Generate the nondeterministic finite state machine for Bison.
Copyright (C) 1984, 1986, 1989, 2000, 2001, 2002 Free Software
Foundation, Inc.
Copyright (C) 1984, 1986, 1989, 2000, 2001, 2002, 2004 Free
Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -106,7 +106,8 @@ allocate_itemsets (void)
browsed too, hence we need to allocate room for _all_ the
symbols. */
int count = 0;
short *symbol_count = CALLOC (symbol_count, nsyms + nuseless_nonterminals);
short int *symbol_count = CALLOC (symbol_count,
nsyms + nuseless_nonterminals);
for (r = 0; r < nrules; ++r)
for (rhsp = rules[r].rhs; *rhsp >= 0; ++rhsp)

View File

@@ -1,6 +1,6 @@
/* Data definitions for internal representation of Bison's input.
Copyright (C) 1984, 1986, 1989, 1992, 2001, 2002, 2003
Copyright (C) 1984, 1986, 1989, 1992, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -139,7 +139,7 @@ item_number_as_symbol_number (item_number i)
}
/* Rule numbers. */
typedef short rule_number;
typedef short int rule_number;
extern rule_number nrules;
static inline item_number
@@ -175,8 +175,8 @@ typedef struct
/* This symbol provides both the associativity, and the precedence. */
symbol *prec;
short dprec;
short merger;
short int dprec;
short int merger;
/* This symbol was attached to the rule via %prec. */
symbol *precsym;

View File

@@ -1,5 +1,7 @@
/* Compute look-ahead criteria for bison,
Copyright (C) 1984, 1986, 1989, 2000, 2002 Free Software Foundation, Inc.
Copyright (C) 1984, 1986, 1989, 2000, 2002, 2004 Free Software
Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -54,7 +56,7 @@ void lalr_free (void);
together and GOTO_MAP[I - NTOKENS] is the index in FROM_STATE and
TO_STATE of the first of them. */
typedef short goto_number;
typedef short int goto_number;
# define GOTO_NUMBER_MAXIMUM SHRT_MAX
extern goto_number *goto_map;

View File

@@ -1,7 +1,7 @@
/* Calculate which nonterminals can expand into the null string for Bison.
Copyright (C) 1984, 1989, 2000, 2001, 2002, 2003 Free Software
Foundation, Inc.
Copyright (C) 1984, 1989, 2000, 2001, 2002, 2003, 2004 Free
Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -62,7 +62,7 @@ nullable_compute (void)
rule_list *p;
symbol_number *squeue = CALLOC (squeue, nvars);
short *rcount = CALLOC (rcount, nrules);
short int *rcount = CALLOC (rcount, nrules);
/* RITEM contains all the rules, including useless productions.
Hence we must allocate room for useless nonterminals too. */
rule_list **rsets = CALLOC (rsets, nvars);

View File

@@ -1,6 +1,6 @@
/* Output the generated parsing program for Bison.
Copyright (C) 1984, 1986, 1989, 1992, 2000, 2001, 2002, 2003
Copyright (C) 1984, 1986, 1989, 1992, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -106,7 +106,7 @@ Name (const char *name, \
GENERATE_MUSCLE_INSERT_TABLE(muscle_insert_unsigned_int_table, unsigned int)
GENERATE_MUSCLE_INSERT_TABLE(muscle_insert_int_table, int)
GENERATE_MUSCLE_INSERT_TABLE(muscle_insert_short_table, short)
GENERATE_MUSCLE_INSERT_TABLE(muscle_insert_short_int_table, short int)
GENERATE_MUSCLE_INSERT_TABLE(muscle_insert_base_table, base_number)
GENERATE_MUSCLE_INSERT_TABLE(muscle_insert_rule_number_table, rule_number)
GENERATE_MUSCLE_INSERT_TABLE(muscle_insert_symbol_number_table, symbol_number)
@@ -217,8 +217,8 @@ prepare_rules (void)
unsigned int *rline = MALLOC (rline, nrules);
symbol_number *r1 = MALLOC (r1, nrules);
unsigned int *r2 = MALLOC (r2, nrules);
short *dprec = MALLOC (dprec, nrules);
short *merger = MALLOC (merger, nrules);
short int *dprec = MALLOC (dprec, nrules);
short int *merger = MALLOC (merger, nrules);
for (r = 0; r < nrules; ++r)
{
@@ -249,8 +249,8 @@ prepare_rules (void)
muscle_insert_unsigned_int_table ("rline", rline, 0, 0, nrules);
muscle_insert_symbol_number_table ("r1", r1, 0, 0, nrules);
muscle_insert_unsigned_int_table ("r2", r2, 0, 0, nrules);
muscle_insert_short_table ("dprec", dprec, 0, 0, nrules);
muscle_insert_short_table ("merger", merger, 0, 0, nrules);
muscle_insert_short_int_table ("dprec", dprec, 0, 0, nrules);
muscle_insert_short_int_table ("merger", merger, 0, 0, nrules);
MUSCLE_INSERT_INT ("rules_number", nrules);
MUSCLE_INSERT_INT ("max_left_semantic_context", max_left_semantic_context);

View File

@@ -1,5 +1,5 @@
/* Binary relations.
Copyright (C) 2002 Free Software Foundation, Inc.
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -28,7 +28,8 @@
void
relation_print (relation r, size_t size, FILE *out)
{
unsigned i, j;
unsigned int i;
unsigned int j;
for (i = 0; i < size; ++i)
{
@@ -94,7 +95,7 @@ traverse (int i)
void
relation_digraph (relation r, size_t size, bitsetv *function)
{
unsigned i;
unsigned int i;
infinity = size + 2;
CALLOC (INDEX, size + 1);

View File

@@ -1,5 +1,5 @@
/* Binary relations.
Copyright (C) 2002 Free Software Foundation, Inc.
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -27,7 +27,7 @@
If GRAPH is a relation, then GRAPH[Node] is a list of adjacent
nodes, ended with -1. */
typedef short relation_node;
typedef short int relation_node;
typedef relation_node *relation_nodes;
typedef relation_nodes *relation;

View File

@@ -1,7 +1,7 @@
/* Type definitions for nondeterministic finite state machine for Bison.
Copyright (C) 1984, 1989, 2000, 2001, 2002, 2003 Free Software
Foundation, Inc.
Copyright (C) 1984, 1989, 2000, 2001, 2002, 2003, 2004 Free
Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -94,7 +94,7 @@
| Numbering states. |
`-------------------*/
typedef short state_number;
typedef short int state_number;
# define STATE_NUMBER_MAXIMUM SHRT_MAX
/* Be ready to map a state_number to an int. */
@@ -113,7 +113,7 @@ typedef struct state state;
typedef struct
{
short num;
short int num;
state *states[1];
} transitions;
@@ -171,7 +171,7 @@ struct state *transitions_to (transitions *shifts, symbol_number sym);
typedef struct
{
short num;
short int num;
symbol *symbols[1];
} errs;
@@ -184,7 +184,7 @@ errs *errs_new (int num, symbol **tokens);
typedef struct
{
short num;
short int num;
bitset *lookaheads;
rule *rules[1];
} reductions;
@@ -212,7 +212,7 @@ struct state
/* Its items. Must be last, since ITEMS can be arbitrarily large.
*/
unsigned short nitems;
unsigned short int nitems;
item_number items[1];
};

View File

@@ -1,6 +1,6 @@
/* Definitions for symtab.c and callers, part of Bison.
Copyright (C) 1984, 1989, 1992, 2000, 2001, 2002
Copyright (C) 1984, 1989, 1992, 2000, 2001, 2002, 2004
Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -41,7 +41,7 @@ typedef enum
/* Internal token numbers. */
typedef short symbol_number;
typedef short int symbol_number;
#define SYMBOL_NUMBER_MAXIMUM SHRT_MAX
@@ -61,7 +61,7 @@ struct symbol
location printer_location;
symbol_number number;
short prec;
short int prec;
assoc assoc;
int user_token_number;

View File

@@ -1,6 +1,6 @@
/* Output the generated parsing program for Bison.
Copyright (C) 1984, 1986, 1989, 1992, 2000, 2001, 2002, 2003
Copyright (C) 1984, 1986, 1989, 1992, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -42,7 +42,7 @@
Of course vector_number_t ought to be wide enough to contain
state_number and symbol_number. */
typedef short vector_number;
typedef short int vector_number;
static inline vector_number
state_number_to_vector_number (state_number s)
@@ -84,7 +84,7 @@ int nvectors;
static base_number **froms = NULL;
static base_number **tos = NULL;
static unsigned int **conflict_tos = NULL;
static short *tally = NULL;
static short int *tally = NULL;
static base_number *width = NULL;
@@ -94,7 +94,7 @@ static base_number *width = NULL;
If N = MIN, stands for `raise a syntax error'.
If N > 0, stands for `shift SYMBOL and go to n'.
If N < 0, stands for `reduce -N'. */
typedef short action_number;
typedef short int action_number;
#define ACTION_NUMBER_MINIMUM SHRT_MIN
static action_number *actrow = NULL;
@@ -512,7 +512,7 @@ save_column (symbol_number sym, state_number default_state)
`-------------------------------------------------------------*/
static state_number
default_goto (symbol_number sym, short state_count[])
default_goto (symbol_number sym, short int state_count[])
{
state_number s;
int i;
@@ -554,7 +554,7 @@ static void
goto_actions (void)
{
symbol_number i;
short *state_count = CALLOC (state_count, nstates);
short int *state_count = CALLOC (state_count, nstates);
MALLOC (yydefgoto, nvars);
/* For a given nterm I, STATE_COUNT[S] is the number of times there