r174996 - Fixing the MSVC compiler warning a different way; removed use of static_cast and instead used a signed integer parameter.

Aaron Ballman aaron at aaronballman.com
Tue Feb 12 11:20:48 PST 2013


Author: aaronballman
Date: Tue Feb 12 13:20:48 2013
New Revision: 174996

URL: http://llvm.org/viewvc/llvm-project?rev=174996&view=rev
Log:
Fixing the MSVC compiler warning a different way; removed use of static_cast and instead used a signed integer parameter.

Modified:
    cfe/trunk/lib/Format/TokenAnnotator.cpp

Modified: cfe/trunk/lib/Format/TokenAnnotator.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/TokenAnnotator.cpp?rev=174996&r1=174995&r2=174996&view=diff
==============================================================================
--- cfe/trunk/lib/Format/TokenAnnotator.cpp (original)
+++ cfe/trunk/lib/Format/TokenAnnotator.cpp Tue Feb 12 13:20:48 2013
@@ -705,7 +705,7 @@ public:
   ExpressionParser(AnnotatedLine &Line) : Current(&Line.First) {}
 
   /// \brief Parse expressions with the given operatore precedence.
-  void parse(unsigned Precedence = prec::Unknown) {
+  void parse(signed Precedence = prec::Unknown) {
     if (Precedence > prec::PointerToMember || Current == NULL)
       return;
 
@@ -729,7 +729,7 @@ public:
       // found, insert fake parenthesis and return.
       if (Current == NULL || Current->is(tok::semi) || closesScope(*Current) ||
           ((Current->Type == TT_BinaryOperator || Current->is(tok::comma)) &&
-           getPrecedence(*Current) < static_cast<prec::Level>(Precedence))) {
+           getPrecedence(*Current) < Precedence)) {
         if (OperatorFound) {
           ++Start->FakeLParens;
           if (Current != NULL)





More information about the cfe-commits mailing list