diff options
Diffstat (limited to 'clang/lib/Lex')
-rw-r--r-- | clang/lib/Lex/HeaderMap.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Lex/Lexer.cpp | 3 | ||||
-rw-r--r-- | clang/lib/Lex/PTHLexer.cpp | 4 |
3 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/Lex/HeaderMap.cpp b/clang/lib/Lex/HeaderMap.cpp index bbfc1df..7dc0491 100644 --- a/clang/lib/Lex/HeaderMap.cpp +++ b/clang/lib/Lex/HeaderMap.cpp @@ -144,7 +144,7 @@ HMapBucket HeaderMap::getBucket(unsigned BucketNo) const { sizeof(HMapHeader)); const HMapBucket *BucketPtr = BucketArray+BucketNo; - if ((char*)(BucketPtr+1) > FileBuffer->getBufferEnd()) { + if ((const char*)(BucketPtr+1) > FileBuffer->getBufferEnd()) { Result.Prefix = 0; Result.Suffix = 0; return Result; // Invalid buffer, corrupt hmap. diff --git a/clang/lib/Lex/Lexer.cpp b/clang/lib/Lex/Lexer.cpp index e214ece..ebb3b6a 100644 --- a/clang/lib/Lex/Lexer.cpp +++ b/clang/lib/Lex/Lexer.cpp @@ -2179,7 +2179,8 @@ bool Lexer::SkipBlockComment(Token &Result, const char *CurPtr) { #ifdef __SSE2__ __m128i Slashes = _mm_set1_epi8('/'); while (CurPtr+16 <= BufferEnd) { - int cmp = _mm_movemask_epi8(_mm_cmpeq_epi8(*(__m128i*)CurPtr, Slashes)); + int cmp = _mm_movemask_epi8(_mm_cmpeq_epi8(*(const __m128i*)CurPtr, + Slashes)); if (cmp != 0) { // Adjust the pointer to point directly after the first slash. It's // not necessary to set C here, it will be overwritten at the end of diff --git a/clang/lib/Lex/PTHLexer.cpp b/clang/lib/Lex/PTHLexer.cpp index 67738e90..bb6e73c 100644 --- a/clang/lib/Lex/PTHLexer.cpp +++ b/clang/lib/Lex/PTHLexer.cpp @@ -448,8 +448,8 @@ PTHManager *PTHManager::Create(const std::string &file, // Get the buffer ranges and check if there are at least three 32-bit // words at the end of the file. - const unsigned char *BufBeg = (unsigned char*)File->getBufferStart(); - const unsigned char *BufEnd = (unsigned char*)File->getBufferEnd(); + const unsigned char *BufBeg = (const unsigned char*)File->getBufferStart(); + const unsigned char *BufEnd = (const unsigned char*)File->getBufferEnd(); // Check the prologue of the file. if ((BufEnd - BufBeg) < (signed)(sizeof("cfe-pth") + 4 + 4) || |