From f939fc12fea8a86862698dd07ff4d972ed99083d Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Fri, 21 Feb 2003 08:13:37 +0000 Subject: [PATCH] * data/lalr1.cc: Use temporary variables instead of casts to change integer types. Suggested by Paul Eggert. --- ChangeLog | 6 ++++++ data/lalr1.cc | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2abe9c76..0d891aa3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-02-21 Akim Demaille + + * data/lalr1.cc: Use temporary variables instead of casts to + change integer types. + Suggested by Paul Eggert. + 2003-02-21 Akim Demaille * doc/bison.texinfo: Use "location" consistently to refer to @n, diff --git a/data/lalr1.cc b/data/lalr1.cc index e1ad791a..2ef527b6 100644 --- a/data/lalr1.cc +++ b/data/lalr1.cc @@ -432,8 +432,9 @@ yy::]b4_parser_class_name[::parse () // Short files will use "unsigned char" for line numbers, // in which case they will be output as character litterals // by "<<". + unsigned yylineno = rline_[n_]; YYCDEBUG << "Reducing via rule " << n_ - 1 - << " (line " << static_cast (rline_[n_]) << "), "; + << " (line " << yylineno << "), "; for (]b4_int_type_for([b4_prhs])[ i = prhs_[n_]; 0 <= rhs_[i]; ++i) YYCDEBUG << name_[rhs_[i]] << ' '; @@ -923,7 +924,9 @@ namespace yy /** \brief (column related) Advance to the COLUMNS next columns. */ inline void columns (int columns = 1) { - if (int (initial_column) < columns + int (column)) + int leftmost = initial_column; + int current = column; + if (leftmost <= current + columns) column += columns; else column = initial_column; -- 2.45.2