From: Bill Wendling Date: Wed, 23 Jan 2013 08:25:41 +0000 (+0000) Subject: Explicitly cast away the const-ness instead of doing it implicitly. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ccdfdd7937d74396ca1b3bb69ed2642a8ff4c712;p=clang Explicitly cast away the const-ness instead of doing it implicitly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173232 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp index 5ec0fba1a8..fa0bd524fb 100644 --- a/tools/libclang/CIndex.cpp +++ b/tools/libclang/CIndex.cpp @@ -130,9 +130,12 @@ CXSourceRange cxloc::translateSourceRange(const SourceManager &SM, EndLoc = EndLoc.getLocWithOffset(Length); } - CXSourceRange Result = { { (void *)&SM, (void *)&LangOpts }, - R.getBegin().getRawEncoding(), - EndLoc.getRawEncoding() }; + CXSourceRange Result = { + { static_cast(const_cast(&SM)), + static_cast(const_cast(&LangOpts)) }, + R.getBegin().getRawEncoding(), + EndLoc.getRawEncoding() + }; return Result; } @@ -4841,7 +4844,8 @@ static void getTokens(ASTUnit *CXXUnit, SourceRange Range, // - Kind-specific fields if (Tok.isLiteral()) { CXTok.int_data[0] = CXToken_Literal; - CXTok.ptr_data = (void *)Tok.getLiteralData(); + CXTok.ptr_data = + static_cast(const_cast(Tok.getLiteralData())); } else if (Tok.is(tok::raw_identifier)) { // Lookup the identifier to determine whether we have a keyword. IdentifierInfo *II @@ -5829,7 +5833,7 @@ CXFile clang_getIncludedFile(CXCursor cursor) { return 0; const InclusionDirective *ID = getCursorInclusionDirective(cursor); - return (void *)ID->getFile(); + return static_cast(const_cast(ID->getFile())); } CXSourceRange clang_Cursor_getCommentRange(CXCursor C) {