]> granicus.if.org Git - clang/commitdiff
Eliminate some VC++ warnings, patch by Hartmut Kaiser!
authorChris Lattner <sabre@nondot.org>
Mon, 3 Sep 2007 18:28:41 +0000 (18:28 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 3 Sep 2007 18:28:41 +0000 (18:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41685 91177308-0d34-0410-b5e6-96231b3b80d8

Lex/Lexer.cpp
Lex/LiteralSupport.cpp
include/clang/AST/Type.h
include/clang/Basic/TargetInfo.h
include/clang/Lex/IdentifierTable.h
include/clang/Lex/Token.h
include/clang/Parse/DeclSpec.h

index c45a36a9a59fbca0b6c209d421cc435774fdc31c..f8640b35562e2ddf8d79d6d6d54a48da8f24742f 100644 (file)
@@ -141,26 +141,26 @@ static void InitCharacterInfo() {
 /// isIdentifierBody - Return true if this is the body character of an
 /// identifier, which is [a-zA-Z0-9_].
 static inline bool isIdentifierBody(unsigned char c) {
-  return CharInfo[c] & (CHAR_LETTER|CHAR_NUMBER|CHAR_UNDER);
+  return (CharInfo[c] & (CHAR_LETTER|CHAR_NUMBER|CHAR_UNDER)) ? true : false;
 }
 
 /// isHorizontalWhitespace - Return true if this character is horizontal
 /// whitespace: ' ', '\t', '\f', '\v'.  Note that this returns false for '\0'.
 static inline bool isHorizontalWhitespace(unsigned char c) {
-  return CharInfo[c] & CHAR_HORZ_WS;
+  return (CharInfo[c] & CHAR_HORZ_WS) ? true : false;
 }
 
 /// isWhitespace - Return true if this character is horizontal or vertical
 /// whitespace: ' ', '\t', '\f', '\v', '\n', '\r'.  Note that this returns false
 /// for '\0'.
 static inline bool isWhitespace(unsigned char c) {
-  return CharInfo[c] & (CHAR_HORZ_WS|CHAR_VERT_WS);
+  return (CharInfo[c] & (CHAR_HORZ_WS|CHAR_VERT_WS)) ? true : false;
 }
 
 /// isNumberBody - Return true if this is the body character of an
 /// preprocessing number, which is [a-zA-Z0-9_.].
 static inline bool isNumberBody(unsigned char c) {
-  return CharInfo[c] & (CHAR_LETTER|CHAR_NUMBER|CHAR_UNDER|CHAR_PERIOD);
+  return (CharInfo[c] & (CHAR_LETTER|CHAR_NUMBER|CHAR_UNDER|CHAR_PERIOD)) ? true : false;
 }
 
 
index 04282563ea94e6a4bba425a12c7aa9476f985673..c2bdd8e5f5b7c8ce2d4253e652df9174f62b6623 100644 (file)
@@ -88,7 +88,7 @@ static unsigned ProcessCharEscape(const char *&ThisTokBuf,
     for (; ThisTokBuf != ThisTokEnd; ++ThisTokBuf) {
       int CharVal = HexDigitValue(ThisTokBuf[0]);
       if (CharVal == -1) break;
-      Overflow |= ResultChar & 0xF0000000;  // About to shift out a digit?
+      Overflow |= (ResultChar & 0xF0000000) ? true : false;  // About to shift out a digit?
       ResultChar <<= 4;
       ResultChar |= CharVal;
     }
index b58652cd0dc381825ea8f367ffa03d2e1813ee01..c61cc69d6fc89fff933450054c7240e4d0b8d2b9 100644 (file)
@@ -106,13 +106,13 @@ public:
   }
 
   bool isConstQualified() const {
-    return ThePtr & Const;
+    return (ThePtr & Const) ? true : false;
   }
   bool isVolatileQualified() const {
-    return ThePtr & Volatile;
+    return (ThePtr & Volatile) ? true : false;
   }
   bool isRestrictQualified() const {
-    return ThePtr & Restrict;
+    return (ThePtr & Restrict) ? true : false;
   }
   
   /// addConst/addVolatile/addRestrict - add the specified type qual to this
index 689fbfc3715dd8b7dce6994eb24f3822e6b975cb..4eb6c3df3e55063ed5e42a727a103b0e955503e5 100644 (file)
@@ -15,6 +15,7 @@
 #define LLVM_CLANG_BASIC_TARGETINFO_H
 
 #include "clang/Basic/SourceLocation.h"
+#include "llvm/Support/DataTypes.h"
 #include <vector>
 #include <string>
 
index 0320164f9a224ad47d93f9ecaac52dac33099690..f18924c9d0bcb5f2fdb0b57420fe7ce3799c19f5 100644 (file)
@@ -21,7 +21,7 @@
 
 namespace clang {
   class MacroInfo;
-  class LangOptions;
+  struct LangOptions;
   
 /// IdentifierInfo - One of these records is kept for each identifier that
 /// is lexed.  This contains information about whether the token was #define'd,
index f336370334d81c7c92dbbc73893a78666fbd3aaa..a0754005e87f239405876eadd167c0dab6181d65 100644 (file)
@@ -96,15 +96,15 @@ public:
   
   /// isAtStartOfLine - Return true if this token is at the start of a line.
   ///
-  bool isAtStartOfLine() const { return Flags & StartOfLine; }
+  bool isAtStartOfLine() const { return (Flags & StartOfLine) ? true : false; }
   
   /// hasLeadingSpace - Return true if this token has whitespace before it.
   ///
-  bool hasLeadingSpace() const { return Flags & LeadingSpace; }
+  bool hasLeadingSpace() const { return (Flags & LeadingSpace) ? true : false; }
   
   /// isExpandDisabled - Return true if this identifier token should never
   /// be expanded in the future, due to C99 6.10.3.4p2.
-  bool isExpandDisabled() const { return Flags & DisableExpand; }
+  bool isExpandDisabled() const { return (Flags & DisableExpand) ? true : false; }
   
   /// isObjCAtKeyword - Return true if we have an ObjC keyword identifier. 
   bool isObjCAtKeyword(tok::ObjCKeywordKind objcKey) const;
@@ -115,7 +115,7 @@ public:
   /// needsCleaning - Return true if this token has trigraphs or escaped
   /// newlines in it.
   ///
-  bool needsCleaning() const { return Flags & NeedsCleaning; }
+  bool needsCleaning() const { return (Flags & NeedsCleaning) ? true : false; }
 };
 
 /// PPConditionalInfo - Information about the conditional stack (#if directives)
index c0956dc00fd4902acf8509864a915c46f1e17ae0..6a15290072e3e023a6d228c2573e42863585cb26 100644 (file)
 #include "llvm/ADT/SmallVector.h"
 
 namespace clang {
-  class LangOptions;
+  struct LangOptions;
   class IdentifierInfo;
   
 /// DeclSpec - This class captures information about "declaration specifiers",
-/// which encompases storage-class-specifiers, type-specifiers, type-qualifiers,
+/// which encompasses storage-class-specifiers, type-specifiers, type-qualifiers,
 /// and function-specifiers.
 class DeclSpec {
 public: