Make getChar() return int
authorThiago Macieira <thiago.macieira@intel.com>
Sat, 7 Dec 2013 06:06:50 +0000 (22:06 -0800)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 9 Dec 2013 20:49:19 +0000 (21:49 +0100)
All the calls to this function are:
  yyCh = getChar();

and yyCh is an int. This solves a sign-change warning found by ICC:
cpp.cpp(427): warning #68: integer conversion resulted in a change of sign

Change-Id: I1fe00005ab5095316b49fb0a0b71bbb60141a57e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
src/linguist/lupdate/cpp.cpp

index 5371cfc..b282e8f 100644 (file)
@@ -239,7 +239,7 @@ private:
 
     std::ostream &yyMsg(int line = 0);
 
-    uint getChar();
+    int getChar();
     uint getToken();
     bool getMacroArgs();
 
@@ -417,7 +417,7 @@ void CppParser::setInput(QTextStream &ts, const QString &fileName)
   The 0 doesn't produce any token.
 */
 
-uint CppParser::getChar()
+int CppParser::getChar()
 {
     const ushort *uc = yyInPtr;
     forever {
@@ -455,7 +455,7 @@ uint CppParser::getChar()
             yyAtNewline = false;
         }
         yyInPtr = uc;
-        return c;
+        return int(c);
     }
 }