diff --git a/THANKS b/THANKS index 93e72fe1..48b4ec85 100644 --- a/THANKS +++ b/THANKS @@ -172,6 +172,7 @@ Wolfram Wagner ww@mpi-sb.mpg.de Wwp subscript@free.fr xolodho xolodho@gmail.com Zack Weinberg zack@codesourcery.com +長田偉伸 cbh34680@iret.co.jp Many people are not named here because we lost track of them. We thank them! Please, help us keeping this list up to date. diff --git a/data/location.cc b/data/location.cc index 3cc949df..07f1ca62 100644 --- a/data/location.cc +++ b/data/location.cc @@ -73,12 +73,10 @@ m4_define([b4_position_define], unsigned column; private: - /// Compute max(min, lhs+rhs) (provided min <= lhs). - static unsigned add_ (unsigned lhs, int rhs, unsigned min) + /// Compute max(min, lhs+rhs). + static unsigned add_ (unsigned lhs, int rhs, int min) { - return (0 < rhs || -static_cast(rhs) < lhs - ? rhs + lhs - : min); + return static_cast(std::max(min, static_cast(lhs) + rhs)); } }; @@ -134,7 +132,7 @@ m4_define([b4_position_define], ** \param pos a reference to the position to redirect */ template - inline std::basic_ostream& + std::basic_ostream& operator<< (std::basic_ostream& ostr, const position& pos) { if (pos.filename) @@ -271,7 +269,7 @@ m4_define([b4_location_define], ** Avoid duplicate information. */ template - inline std::basic_ostream& + std::basic_ostream& operator<< (std::basic_ostream& ostr, const location& loc) { unsigned end_col = 0 < loc.end.column ? loc.end.column - 1 : 0;