[cfe-commits] r41685 - in /cfe/trunk: 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
Chris Lattner
sabre at nondot.org
Mon Sep 3 11:28:41 PDT 2007
Author: lattner
Date: Mon Sep 3 13:28:41 2007
New Revision: 41685
URL: http://llvm.org/viewvc/llvm-project?rev=41685&view=rev
Log:
Eliminate some VC++ warnings, patch by Hartmut Kaiser!
Modified:
cfe/trunk/Lex/Lexer.cpp
cfe/trunk/Lex/LiteralSupport.cpp
cfe/trunk/include/clang/AST/Type.h
cfe/trunk/include/clang/Basic/TargetInfo.h
cfe/trunk/include/clang/Lex/IdentifierTable.h
cfe/trunk/include/clang/Lex/Token.h
cfe/trunk/include/clang/Parse/DeclSpec.h
Modified: cfe/trunk/Lex/Lexer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Lex/Lexer.cpp?rev=41685&r1=41684&r2=41685&view=diff
==============================================================================
--- cfe/trunk/Lex/Lexer.cpp (original)
+++ cfe/trunk/Lex/Lexer.cpp Mon Sep 3 13:28:41 2007
@@ -141,26 +141,26 @@
/// 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;
}
Modified: cfe/trunk/Lex/LiteralSupport.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Lex/LiteralSupport.cpp?rev=41685&r1=41684&r2=41685&view=diff
==============================================================================
--- cfe/trunk/Lex/LiteralSupport.cpp (original)
+++ cfe/trunk/Lex/LiteralSupport.cpp Mon Sep 3 13:28:41 2007
@@ -88,7 +88,7 @@
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;
}
Modified: cfe/trunk/include/clang/AST/Type.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Type.h?rev=41685&r1=41684&r2=41685&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Type.h (original)
+++ cfe/trunk/include/clang/AST/Type.h Mon Sep 3 13:28:41 2007
@@ -106,13 +106,13 @@
}
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
Modified: cfe/trunk/include/clang/Basic/TargetInfo.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TargetInfo.h?rev=41685&r1=41684&r2=41685&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/TargetInfo.h (original)
+++ cfe/trunk/include/clang/Basic/TargetInfo.h Mon Sep 3 13:28:41 2007
@@ -15,6 +15,7 @@
#define LLVM_CLANG_BASIC_TARGETINFO_H
#include "clang/Basic/SourceLocation.h"
+#include "llvm/Support/DataTypes.h"
#include <vector>
#include <string>
Modified: cfe/trunk/include/clang/Lex/IdentifierTable.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/IdentifierTable.h?rev=41685&r1=41684&r2=41685&view=diff
==============================================================================
--- cfe/trunk/include/clang/Lex/IdentifierTable.h (original)
+++ cfe/trunk/include/clang/Lex/IdentifierTable.h Mon Sep 3 13:28:41 2007
@@ -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,
Modified: cfe/trunk/include/clang/Lex/Token.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/Token.h?rev=41685&r1=41684&r2=41685&view=diff
==============================================================================
--- cfe/trunk/include/clang/Lex/Token.h (original)
+++ cfe/trunk/include/clang/Lex/Token.h Mon Sep 3 13:28:41 2007
@@ -96,15 +96,15 @@
/// 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 @@
/// 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)
Modified: cfe/trunk/include/clang/Parse/DeclSpec.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/DeclSpec.h?rev=41685&r1=41684&r2=41685&view=diff
==============================================================================
--- cfe/trunk/include/clang/Parse/DeclSpec.h (original)
+++ cfe/trunk/include/clang/Parse/DeclSpec.h Mon Sep 3 13:28:41 2007
@@ -20,11 +20,11 @@
#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:
More information about the cfe-commits
mailing list