From: Paul Eggert Date: Wed, 31 Mar 2004 00:37:21 +0000 (+0000) Subject: Use 'short int' rather than 'short', and similarly for 'long', 'unsigned', etc. X-Git-Tag: BISON-2_0~176 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/779e7ceb9395424c2cf90d43c75302ababc8ee72 Use 'short int' rather than 'short', and similarly for 'long', 'unsigned', etc. --- diff --git a/ChangeLog b/ChangeLog index a7301cc1..e41f0b5b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,44 @@ +2004-03-30 Paul Eggert + + * src/getargs.c (version): Update copyright year to 2004. + + * data/c.m4 (b4_int_type): Use 'short int' rather than + 'short', and similarly for 'long', 'unsigned', etc. + * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum, + yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError, + yy_yypstack, yydumpstack): Likewise. + * data/lalr1.cc (user_token_number_max_, user_token_number_max_, + translate_, seq_, [], pop, Slice, range_, operator+, operator+=): + Likewise. + * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char, + yy_stack_print, yyparse): Likewise. + * doc/bison.texinfo (Prologue, Multiple Types): Likewise. + * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise. + * lib/bitset.c (bitset_print): Likewise. + * lib/bitset_stats.c (bitste_log_histogram_print): Likewise. + * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise. + * lib/bitsetv.c (bitsetv_dump): Likewise. + * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise. + * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset): + Likewise. + * src/LR0.c (allocate_itemsets): Likewise. + * src/gram.h (rule_number, rule): Likewise. + * src/lalr.h (goto_number): Likewise. + * src/nullable.c (nullable_compute): Likewise. + * src/output.c (prepare_rules): Likewise. + * src/relation.c (relation_print, relation_digraph): Likewise. + * src/relation.h (relation_node): Likewise. + * src/state.h (state_number, transitions, errs, reductions, + struct state): Likewise. + * src/symtab.h (symbol_number, struct symbol): Likewise. + * src/tables.c (vector_number, tally, action_number, + default_goto, goto_actions): Likewise. + * tests/existing.at (GNU Cim Grammar): Likewise. + * tests/regression.at (Web2c Actions): Likewise. + + * src/output.c (muscle_insert_short_int_table): Renamed from + muscle_insert_short_table. All uses changed. + 2004-03-25 Paul Hilfinger * src/parse-gram.y: Define PERCENT_EXPECT_RR. diff --git a/data/c.m4 b/data/c.m4 index 209bb1a7..a72f059a 100644 --- a/data/c.m4 +++ b/data/c.m4 @@ -1,7 +1,7 @@ m4_divert(-1) -*- Autoconf -*- # C M4 Macros for Bison. -# Copyright (C) 2002 Free Software Foundation, Inc. +# Copyright (C) 2002, 2004 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -114,8 +114,8 @@ m4_define([b4_int_type], [m4_if(b4_ints_in($@, [0], [255]), [1], [unsigned char], b4_ints_in($@, [-128], [127]), [1], [signed char], - b4_ints_in($@, [0], [65535]), [1], [unsigned short], - b4_ints_in($@, [-32768], [32767]), [1], [short], + b4_ints_in($@, [0], [65535]), [1], [unsigned short int], + b4_ints_in($@, [-32768], [32767]), [1], [short int], m4_eval([0 <= $1]), [1], [unsigned int], diff --git a/data/glr.c b/data/glr.c index 586da61e..a77a9857 100644 --- a/data/glr.c +++ b/data/glr.c @@ -137,7 +137,7 @@ m4_define([b4_rhs_location], m4_changecom() m4_divert(0)dnl @output @output_parser_name@ -b4_copyright([Skeleton parser for GLR parsing with Bison], [2002, 2003]) +b4_copyright([Skeleton parser for GLR parsing with Bison], [2002, 2003, 2004]) [ /* This is the parser code for GLR (Generalized LR) parser. */ @@ -282,7 +282,7 @@ b4_syncline([@oline@], [@ofile@]) #define YYTRANSLATE(YYX) \ ((YYX <= 0) ? YYEOF : \ - (unsigned)(YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + (unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ static const ]b4_int_type_for([b4_translate])[ yytranslate[] = @@ -394,9 +394,9 @@ static const ]b4_int_type_for([b4_conflict_list_heads])[ yyconflp[] = /* YYCONFL[I] -- lists of conflicting rule numbers, each terminated by 0, pointed into by YYCONFLP. */ ]dnl Do not use b4_int_type_for here, since there are places where -dnl pointers onto yyconfl are taken, which type is "short *". +dnl pointers onto yyconfl are taken, which type is "short int *". dnl We probably ought to introduce a type for confl. -[static const short yyconfl[] = +[static const short int yyconfl[] = { ]b4_conflicting_rules[ }; @@ -552,10 +552,10 @@ typedef int yyStateNum; typedef int yyRuleNum; /** Grammar symbol */ -typedef short yySymbol; +typedef short int yySymbol; /** Item references, as in LALR(1) machine */ -typedef short yyItemNum; +typedef short int yyItemNum; typedef struct yyGLRState yyGLRState; typedef struct yySemanticOption yySemanticOption; @@ -809,7 +809,7 @@ yydefaultAction (yyStateNum yystate) */ static inline void yygetLRActions (yyStateNum yystate, int yytoken, - int* yyaction, const short** yyconflicts) + int* yyaction, const short int** yyconflicts) { int yyindex = yypact[yystate] + yytoken; if (yyindex < 0 || YYLAST < yyindex || yycheck[yyindex] != yytoken) @@ -1539,7 +1539,7 @@ yyprocessOneStack (yyGLRStack* yystack, int yyk, ]b4_user_formals[) { int yyaction; - const short* yyconflicts; + const short int* yyconflicts; yyRuleNum yyrule; yySymbol* const yytokenp = yystack->yytokenp; @@ -1840,7 +1840,7 @@ yyrecoverSyntaxError (yyGLRStack* yystack, { yyRuleNum yyrule; int yyaction; - const short* yyconflicts; + const short int* yyconflicts; yyStateNum yystate = yystack.yytops.yystates[0]->yylrState; YYDPRINTF ((stderr, "Entering state %d\n", yystate)); @@ -1942,7 +1942,7 @@ yy_yypstack (yyGLRState* yys) yy_yypstack (yys->yypred); fprintf (stderr, " -> "); } - fprintf (stderr, "%d@@%lu", yys->yylrState, (unsigned long) yys->yyposn); + fprintf (stderr, "%d@@%lu", yys->yylrState, (unsigned long int) yys->yyposn); } static void @@ -1972,30 +1972,30 @@ yypdumpstack (yyGLRStack* yystack) size_t yyi; for (yyp = yystack->yyitems; yyp < yystack->yynextFree; yyp += 1) { - fprintf (stderr, "%3lu. ", (unsigned long) (yyp - yystack->yyitems)); + fprintf (stderr, "%3lu. ", (unsigned long int) (yyp - yystack->yyitems)); if (*(yybool *) yyp) { fprintf (stderr, "Res: %d, LR State: %d, posn: %lu, pred: %ld", yyp->yystate.yyresolved, yyp->yystate.yylrState, - (unsigned long) yyp->yystate.yyposn, - (long) YYINDEX (yyp->yystate.yypred)); + (unsigned long int) yyp->yystate.yyposn, + (long int) YYINDEX (yyp->yystate.yypred)); if (! yyp->yystate.yyresolved) fprintf (stderr, ", firstVal: %ld", - (long) YYINDEX (yyp->yystate.yysemantics.yyfirstVal)); + (long int) YYINDEX (yyp->yystate.yysemantics.yyfirstVal)); } else { fprintf (stderr, "Option. rule: %d, state: %ld, next: %ld", yyp->yyoption.yyrule, - (long) YYINDEX (yyp->yyoption.yystate), - (long) YYINDEX (yyp->yyoption.yynext)); + (long int) YYINDEX (yyp->yyoption.yystate), + (long int) YYINDEX (yyp->yyoption.yynext)); } fprintf (stderr, "\n"); } fprintf (stderr, "Tops:"); for (yyi = 0; yyi < yystack->yytops.yysize; yyi += 1) - fprintf (stderr, "%lu: %ld; ", (unsigned long) yyi, - (long) YYINDEX (yystack->yytops.yystates[yyi])); + fprintf (stderr, "%lu: %ld; ", (unsigned long int) yyi, + (long int) YYINDEX (yystack->yytops.yystates[yyi])); fprintf (stderr, "\n"); } ] @@ -2003,7 +2003,7 @@ yypdumpstack (yyGLRStack* yystack) b4_epilogue m4_if(b4_defines_flag, 0, [], [@output @output_header_name@ -b4_copyright([Skeleton parser for GLR parsing with Bison], [2002, 2003]) +b4_copyright([Skeleton parser for GLR parsing with Bison], [2002, 2003, 2004]) b4_token_defines(b4_tokens) diff --git a/data/lalr1.cc b/data/lalr1.cc index 3585cd19..fba29b3b 100644 --- a/data/lalr1.cc +++ b/data/lalr1.cc @@ -1,6 +1,6 @@ m4_divert(-1) # C++ skeleton for Bison -# Copyright (C) 2002, 2003 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -128,7 +128,7 @@ m4_divert(0)dnl m4_if(b4_defines_flag, 0, [], [@output @output_header_name@ b4_copyright([C++ Skeleton parser for LALR(1) parsing with Bison], - [2002, 2003])[ + [2002, 2003, 2004])[ /* FIXME: This is wrong, we want computed header guards. I don't know why the macros are missing now. :( */ #ifndef PARSER_HEADER_H @@ -291,7 +291,7 @@ namespace yy static const int terror_; static const int errcode_; static const int ntokens_; - static const unsigned user_token_number_max_; + static const unsigned int user_token_number_max_; static const TokenNumberType undef_token_; /* State. */ @@ -334,7 +334,7 @@ namespace yy ])dnl @output @output_parser_name@ b4_copyright([C++ Skeleton parser for LALR(1) parsing with Bison], - [2002, 2003]) + [2002, 2003, 2004]) m4_if(b4_defines_flag, 0, [], [#include @output_header_name@])[ @@ -885,7 +885,7 @@ yy::]b4_parser_class_name[::translate_ (int token) { ]b4_translate[ }; - if ((unsigned) token <= user_token_number_max_) + if ((unsigned int) token <= user_token_number_max_) return translate_table[token]; else return undef_token_; @@ -900,13 +900,13 @@ const int yy::]b4_parser_class_name[::terror_ = 1; const int yy::]b4_parser_class_name[::errcode_ = 256; const int yy::]b4_parser_class_name[::ntokens_ = ]b4_tokens_number[; -const unsigned yy::]b4_parser_class_name[::user_token_number_max_ = ]b4_user_token_number_max[; +const unsigned int yy::]b4_parser_class_name[::user_token_number_max_ = ]b4_user_token_number_max[; const yy::]b4_parser_class_name[::TokenNumberType yy::]b4_parser_class_name[::undef_token_ = ]b4_undef_token_number[; ]b4_epilogue dnl @output stack.hh -b4_copyright([Stack handling for Bison C++ parsers], [2002, 2003])[ +b4_copyright([Stack handling for Bison C++ parsers], [2002, 2003, 2004])[ #ifndef BISON_STACK_HH # define BISON_STACK_HH @@ -927,20 +927,20 @@ namespace yy { } - Stack (unsigned n) : seq_ (n) + Stack (unsigned int n) : seq_ (n) { } inline T& - operator [] (unsigned i) + operator [] (unsigned int i) { return seq_[i]; } inline const T& - operator [] (unsigned i) const + operator [] (unsigned int i) const { return seq_[i]; } @@ -954,14 +954,14 @@ namespace yy inline void - pop (unsigned n = 1) + pop (unsigned int n = 1) { for (; n; --n) seq_.pop_front (); } inline - unsigned + unsigned int height () const { return seq_.size (); @@ -981,14 +981,14 @@ namespace yy public: Slice (const S& stack, - unsigned range) : stack_ (stack), - range_ (range) + unsigned int range) : stack_ (stack), + range_ (range) { } inline const T& - operator [] (unsigned i) const + operator [] (unsigned int i) const { return stack_[range_ - i]; } @@ -996,14 +996,14 @@ namespace yy private: const S& stack_; - unsigned range_; + unsigned int range_; }; } #endif // not BISON_STACK_HH] dnl @output position.hh -b4_copyright([Position class for Bison C++ parsers], [2002, 2003])[ +b4_copyright([Position class for Bison C++ parsers], [2002, 2003, 2004])[ /** ** \file position.hh @@ -1116,7 +1116,7 @@ namespace yy } #endif // not BISON_POSITION_HH] @output location.hh -b4_copyright([Location class for Bison C++ parsers], [2002, 2003])[ +b4_copyright([Location class for Bison C++ parsers], [2002, 2003, 2004])[ /** ** \file location.hh @@ -1187,7 +1187,7 @@ namespace yy } /** \brief Add two Location objects */ - inline const Location operator+ (const Location& begin, unsigned width) + inline const Location operator+ (const Location& begin, unsigned int width) { Location res = begin; res.columns (width); @@ -1195,7 +1195,7 @@ namespace yy } /** \brief Add and assign a Location */ - inline Location &operator+= (Location& res, unsigned width) + inline Location &operator+= (Location& res, unsigned int width) { res.columns (width); return res; diff --git a/data/yacc.c b/data/yacc.c index 6ef0775c..0957600e 100644 --- a/data/yacc.c +++ b/data/yacc.c @@ -1,7 +1,7 @@ m4_divert(-1) -*- C -*- # Yacc compatible skeleton for Bison -# Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 +# Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -76,8 +76,8 @@ m4_define([b4_int_type], [m4_if(b4_ints_in($@, [0], [255]), [1], [unsigned char], b4_ints_in($@, [-128], [127]), [1], [yysigned_char], - b4_ints_in($@, [0], [65535]), [1], [unsigned short], - b4_ints_in($@, [-32768], [32767]), [1], [short], + b4_ints_in($@, [0], [65535]), [1], [unsigned short int], + b4_ints_in($@, [-32768], [32767]), [1], [short int], m4_eval([0 <= $1]), [1], [unsigned int], @@ -134,7 +134,7 @@ m4_changecom() m4_divert(0)dnl @output @output_parser_name@ b4_copyright([Skeleton parser for Yacc-like parsing with Bison], - [1984, 1989, 1990, 2000, 2001, 2002, 2003])[ + [1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004])[ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. @@ -261,7 +261,7 @@ b4_syncline([@oline@], [@ofile@])[ /* A type that is properly aligned for any stack member. */ union yyalloc { - short yyss; + short int yyss; YYSTYPE yyvs; ]b4_location_if([ YYLTYPE yyls; ])dnl @@ -274,10 +274,10 @@ union yyalloc N elements. */ ]b4_location_if( [# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ + ((N) * (sizeof (short int) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ + 2 * YYSTACK_GAP_MAXIMUM)], [# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM)])[ /* Copy COUNT objects from FROM to TO. The source and destination do @@ -319,7 +319,7 @@ union yyalloc #if defined (__STDC__) || defined (__cplusplus) typedef signed char yysigned_char; #else - typedef short yysigned_char; + typedef short int yysigned_char; #endif /* YYFINAL -- State number of the termination state. */ @@ -560,8 +560,8 @@ do { \ `------------------------------------------------------------------*/ ]b4_c_function_def([yy_stack_print], [static void], - [[short *bottom], [bottom]], - [[short *top], [top]])[ + [[short int *bottom], [bottom]], + [[short int *top], [top]])[ { YYFPRINTF (stderr, "Stack now"); for (/* Nothing. */; bottom <= top; ++bottom) @@ -763,9 +763,9 @@ b4_c_function_def([yyparse], [int], b4_parse_param) to reallocate them elsewhere. */ /* The state stack. */ - short yyssa[YYINITDEPTH]; - short *yyss = yyssa; - register short *yyssp; + short int yyssa[YYINITDEPTH]; + short int *yyss = yyssa; + register short int *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; @@ -842,7 +842,7 @@ b4_syncline([@oline@], [@ofile@])])dnl these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; - short *yyss1 = yyss; + short int *yyss1 = yyss; ]b4_location_if([ YYLTYPE *yyls1 = yyls;])[ /* Each stack pointer address is followed by the size of the @@ -870,7 +870,7 @@ b4_syncline([@oline@], [@ofile@])])dnl yystacksize = YYMAXDEPTH; { - short *yyss1 = yyss; + short int *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) @@ -1241,7 +1241,7 @@ b4_epilogue m4_if(b4_defines_flag, 0, [], [@output @output_header_name@ b4_copyright([Skeleton parser for Yacc-like parsing with Bison], - [1984, 1989, 1990, 2000, 2001, 2002, 2003]) + [1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004]) /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. diff --git a/doc/bison.texinfo b/doc/bison.texinfo index 22e5da91..f01c638a 100644 --- a/doc/bison.texinfo +++ b/doc/bison.texinfo @@ -2338,7 +2338,7 @@ can be done with two @var{Prologue} blocks, one before and one after the %@} %union @{ - long n; + long int n; tree t; /* @r{@code{tree} is defined in @file{ptypes.h}.} */ @} @@ -2755,7 +2755,7 @@ This macro definition must go in the prologue of the grammar file In most programs, you will need different data types for different kinds of tokens and groupings. For example, a numeric constant may need type -@code{int} or @code{long}, while a string constant needs type @code{char *}, +@code{int} or @code{long int}, while a string constant needs type @code{char *}, and an identifier might need a pointer to an entry in the symbol table. To use more than one data type for semantic values in one parser, Bison diff --git a/lib/bbitset.h b/lib/bbitset.h index 7dd62f96..b8be7e5b 100644 --- a/lib/bbitset.h +++ b/lib/bbitset.h @@ -1,5 +1,5 @@ /* Base bitset stuff. - Copyright (C) 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz). This program is free software; you can redistribute it and/or modify @@ -48,8 +48,8 @@ extern const char * const bitset_type_names[]; enum bitset_alloc_type {BITSET_MALLOC, BITSET_OBALLOC}; /* Data type used to store a word of bits. */ -typedef unsigned long bitset_word; -#define BITSET_WORD_BITS ((unsigned) (CHAR_BIT * sizeof (bitset_word))) +typedef unsigned long int bitset_word; +#define BITSET_WORD_BITS ((unsigned int) (CHAR_BIT * sizeof (bitset_word))) /* Bit index. In theory we might need a type wider than size_t, but in practice we lose at most a factor of CHAR_BIT by going with diff --git a/lib/bitset.c b/lib/bitset.c index 3c0d956e..93fe75d3 100644 --- a/lib/bitset.c +++ b/lib/bitset.c @@ -1,5 +1,5 @@ /* General bitsets. - Copyright (C) 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz). This program is free software; you can redistribute it and/or modify @@ -296,7 +296,7 @@ bitset_print (FILE *file, bitset bset, bool verbose) if (verbose) fprintf (file, "n_bits = %lu, set = {", - (unsigned long) bitset_size (bset)); + (unsigned long int) bitset_size (bset)); pos = 30; BITSET_FOR_EACH (iter, bset, i, 0) diff --git a/lib/bitset_stats.c b/lib/bitset_stats.c index 40bc9f0c..70acd977 100644 --- a/lib/bitset_stats.c +++ b/lib/bitset_stats.c @@ -1,5 +1,5 @@ /* Bitset statistics. - Copyright (C) 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz). This program is free software; you can redistribute it and/or modify @@ -160,8 +160,8 @@ bitset_log_histogram_print (FILE *file, const char *name, const char *msg, for (; i < n_bins; i++) fprintf (file, "%*lu-%lu\t%8u (%5.1f%%)\n", max_width - ((unsigned int) (0.30103 * (i) + 0.9999) + 1), - (unsigned long) 1 << (i - 1), - ((unsigned long) 1 << i) - 1, + 1UL << (i - 1), + (1UL << i) - 1, bins[i], (100.0 * bins[i]) / total); } diff --git a/lib/bitsetv-print.c b/lib/bitsetv-print.c index 6bddeab8..5a624f59 100644 --- a/lib/bitsetv-print.c +++ b/lib/bitsetv-print.c @@ -1,5 +1,5 @@ /* Bitset vectors. - Copyright (C) 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. This file is part of Bison. @@ -57,7 +57,7 @@ bitsetv_matrix_dump (FILE * out, const char *title, bitsetv bset) /* Contents. */ for (i = 0; bset[i]; ++i) { - fprintf (out, "%2lu|", (unsigned long) i); + fprintf (out, "%2lu|", (unsigned long int) i); for (j = 0; j < hsize; ++j) fputs (bitset_test (bset[i], j) ? "1" : " ", out); fputs ("|\n", out); diff --git a/lib/bitsetv.c b/lib/bitsetv.c index c9aea246..42e0a3d7 100644 --- a/lib/bitsetv.c +++ b/lib/bitsetv.c @@ -1,5 +1,5 @@ /* Bitset vectors. - Copyright (C) 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. This file is part of GCC. @@ -149,7 +149,7 @@ bitsetv_dump (FILE *file, char const *title, char const *subtitle, fprintf (file, "%s\n", title); for (i = 0; bsetv[i]; i++) { - fprintf (file, "%s %lu\n", subtitle, (unsigned long) i); + fprintf (file, "%s %lu\n", subtitle, (unsigned long int) i); bitset_dump (file, bsetv[i]); } @@ -164,7 +164,7 @@ debug_bitsetv (bitsetv bsetv) for (i = 0; bsetv[i]; i++) { - fprintf (stderr, "%lu: ", (unsigned long) i); + fprintf (stderr, "%lu: ", (unsigned long int) i); debug_bitset (bsetv[i]); } diff --git a/lib/ebitset.c b/lib/ebitset.c index 3998073b..effa2c22 100644 --- a/lib/ebitset.c +++ b/lib/ebitset.c @@ -1,5 +1,5 @@ /* Functions to support expandable bitsets. - Copyright (C) 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz). This program is free software; you can redistribute it and/or modify @@ -52,7 +52,7 @@ /* Number of bits stored in each element. */ #define EBITSET_ELT_BITS \ - ((unsigned) (EBITSET_ELT_WORDS * BITSET_WORD_BITS)) + ((unsigned int) (EBITSET_ELT_WORDS * BITSET_WORD_BITS)) /* Ebitset element. We use an array of bits. */ typedef struct ebitset_elt_struct @@ -216,7 +216,7 @@ ebitset_elt_alloc (void) obstack_specify_allocation (&ebitset_obstack, OBSTACK_CHUNK_SIZE, __alignof__ (ebitset_elt), - (void *(*)PARAMS ((long))) + (void *(*)PARAMS ((long int))) OBSTACK_CHUNK_ALLOC, (void (*)PARAMS ((void *))) OBSTACK_CHUNK_FREE); diff --git a/lib/lbitset.c b/lib/lbitset.c index 82fc10ce..26d798c5 100644 --- a/lib/lbitset.c +++ b/lib/lbitset.c @@ -1,5 +1,5 @@ /* Functions to support link list bitsets. - Copyright (C) 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz). This program is free software; you can redistribute it and/or modify @@ -54,7 +54,7 @@ typedef bitset_word lbitset_word; /* Number of bits stored in each element. */ #define LBITSET_ELT_BITS \ - ((unsigned) (LBITSET_ELT_WORDS * LBITSET_WORD_BITS)) + ((unsigned int) (LBITSET_ELT_WORDS * LBITSET_WORD_BITS)) /* Lbitset element. We use an array of bits for each element. These are linked together in a doubly-linked list. */ @@ -127,7 +127,7 @@ lbitset_elt_alloc (void) obstack_specify_allocation (&lbitset_obstack, OBSTACK_CHUNK_SIZE, __alignof__ (lbitset_elt), - (void *(*)PARAMS ((long))) + (void *(*)PARAMS ((long int))) OBSTACK_CHUNK_ALLOC, (void (*)PARAMS ((void *))) OBSTACK_CHUNK_FREE); @@ -1390,7 +1390,7 @@ debug_lbitset (bitset bset) for (elt = LBITSET_HEAD (bset); elt; elt = elt->next) { - fprintf (stderr, "Elt %lu\n", (unsigned long) elt->index); + fprintf (stderr, "Elt %lu\n", (unsigned long int) elt->index); for (i = 0; i < LBITSET_ELT_WORDS; i++) { unsigned int j; diff --git a/src/LR0.c b/src/LR0.c index ae39b7ce..2a75193e 100644 --- a/src/LR0.c +++ b/src/LR0.c @@ -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) diff --git a/src/gram.h b/src/gram.h index cbdfa5e0..caae4847 100644 --- a/src/gram.h +++ b/src/gram.h @@ -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; diff --git a/src/lalr.h b/src/lalr.h index 7912a089..ce10edd0 100644 --- a/src/lalr.h +++ b/src/lalr.h @@ -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; diff --git a/src/nullable.c b/src/nullable.c index 9357535c..d65c4f2b 100644 --- a/src/nullable.c +++ b/src/nullable.c @@ -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); diff --git a/src/output.c b/src/output.c index d2fe981f..68dd2dff 100644 --- a/src/output.c +++ b/src/output.c @@ -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); diff --git a/src/relation.c b/src/relation.c index 9eb647c4..8f97fa99 100644 --- a/src/relation.c +++ b/src/relation.c @@ -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); diff --git a/src/relation.h b/src/relation.h index f8ecc59d..f79174c2 100644 --- a/src/relation.h +++ b/src/relation.h @@ -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; diff --git a/src/state.h b/src/state.h index b7591289..2c6c45a5 100644 --- a/src/state.h +++ b/src/state.h @@ -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]; }; diff --git a/src/symtab.h b/src/symtab.h index 3cf2f588..42c8ffb8 100644 --- a/src/symtab.h +++ b/src/symtab.h @@ -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; diff --git a/src/tables.c b/src/tables.c index 2682472b..af5a5cb5 100644 --- a/src/tables.c +++ b/src/tables.c @@ -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 diff --git a/tests/existing.at b/tests/existing.at index fcb1af04..f1af48b9 100644 --- a/tests/existing.at +++ b/tests/existing.at @@ -1,6 +1,6 @@ # Exercising Bison on actual grammars. -*- Autotest -*- -# Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003 +# Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -372,9 +372,9 @@ AT_SETUP([GNU Cim Grammar]) AT_DATA([[input.y]], [[%union { - long token; - long ival; - long arrdim; + long int token; + long int ival; + long int arrdim; double rval; char *ident; char *tval; diff --git a/tests/regression.at b/tests/regression.at index 51495b89..94422bd3 100644 --- a/tests/regression.at +++ b/tests/regression.at @@ -1,5 +1,5 @@ # Bison Regressions. -*- Autotest -*- -# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -535,7 +535,7 @@ AT_CLEANUP # # It used to be wrong on yydefact only: # -# static const short yydefact[] = +# static const short int yydefact[] = # { # - 2, 0, 1, 0, 0, 2, 3, 2, 5, 4, # + 2, 0, 1, 0, 0, 0, 3, 2, 5, 4, @@ -613,7 +613,7 @@ static const char *const yytname[] = "$end", "error", "$undefined", "\"if\"", "\"const\"", "\"then\"", "\"else\"", "$accept", "statement", "struct_stat", "if", "else", 0 }; -static const unsigned short yytoknum[] = +static const unsigned short int yytoknum[] = { 0, 256, 257, 258, 259, 260, 261 };