From 69652660e765ec2bbcf1877ac05c66e91b8fa745 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Wed, 23 Jan 2013 08:58:23 +0000 Subject: [PATCH] Explicitly cast away the const-ness instead of doing it implicitly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173241 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/libclang/CXCursor.cpp | 8 ++++---- tools/libclang/CXSourceLocation.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/libclang/CXCursor.cpp b/tools/libclang/CXCursor.cpp index bdd06bd334..2b2ec3942e 100644 --- a/tools/libclang/CXCursor.cpp +++ b/tools/libclang/CXCursor.cpp @@ -778,7 +778,7 @@ cxcursor::getCursorOverloadedDeclRef(CXCursor C) { } Decl *cxcursor::getCursorDecl(CXCursor Cursor) { - return (Decl *)Cursor.data[0]; + return static_cast(const_cast(Cursor.data[0])); } Expr *cxcursor::getCursorExpr(CXCursor Cursor) { @@ -791,15 +791,15 @@ Stmt *cxcursor::getCursorStmt(CXCursor Cursor) { Cursor.kind == CXCursor_ObjCClassRef) return 0; - return (Stmt *)Cursor.data[1]; + return static_cast(const_cast(Cursor.data[1])); } Attr *cxcursor::getCursorAttr(CXCursor Cursor) { - return (Attr *)Cursor.data[1]; + return static_cast(const_cast(Cursor.data[1])); } Decl *cxcursor::getCursorParentDecl(CXCursor Cursor) { - return (Decl *)Cursor.data[0]; + return static_cast(const_cast(Cursor.data[0])); } ASTContext &cxcursor::getCursorContext(CXCursor Cursor) { diff --git a/tools/libclang/CXSourceLocation.cpp b/tools/libclang/CXSourceLocation.cpp index fcc78774ee..856481af74 100644 --- a/tools/libclang/CXSourceLocation.cpp +++ b/tools/libclang/CXSourceLocation.cpp @@ -346,7 +346,7 @@ void clang_getFileLocation(CXSourceLocation location, return createNullLocation(file, line, column, offset); if (file) - *file = (void *)SM.getFileEntryForID(FID); + *file = static_cast(const_cast(SM.getFileEntryForID(FID))); if (line) *line = SM.getLineNumber(FID, FileOffset); if (column) -- 2.40.0