[cfe-commits] r173269 - in /cfe/trunk/tools/libclang: CIndex.cpp CXSourceLocation.cpp
Dmitri Gribenko
gribozavr at gmail.com
Wed Jan 23 07:56:08 PST 2013
Author: gribozavr
Date: Wed Jan 23 09:56:07 2013
New Revision: 173269
URL: http://llvm.org/viewvc/llvm-project?rev=173269&view=rev
Log:
Remove uneeded casts
Modified:
cfe/trunk/tools/libclang/CIndex.cpp
cfe/trunk/tools/libclang/CXSourceLocation.cpp
Modified: cfe/trunk/tools/libclang/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=173269&r1=173268&r2=173269&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndex.cpp (original)
+++ cfe/trunk/tools/libclang/CIndex.cpp Wed Jan 23 09:56:07 2013
@@ -131,8 +131,7 @@
}
CXSourceRange Result = {
- { static_cast<void*>(const_cast<SourceManager*>(&SM)),
- static_cast<void*>(const_cast<LangOptions*>(&LangOpts)) },
+ { &SM, &LangOpts },
R.getBegin().getRawEncoding(),
EndLoc.getRawEncoding()
};
@@ -4844,8 +4843,7 @@
// - Kind-specific fields
if (Tok.isLiteral()) {
CXTok.int_data[0] = CXToken_Literal;
- CXTok.ptr_data =
- static_cast<void*>(const_cast<char*>(Tok.getLiteralData()));
+ CXTok.ptr_data = const_cast<char *>(Tok.getLiteralData());
} else if (Tok.is(tok::raw_identifier)) {
// Lookup the identifier to determine whether we have a keyword.
IdentifierInfo *II
@@ -5833,7 +5831,7 @@
return 0;
const InclusionDirective *ID = getCursorInclusionDirective(cursor);
- return static_cast<void*>(const_cast<FileEntry*>(ID->getFile()));
+ return const_cast<FileEntry *>(ID->getFile());
}
CXSourceRange clang_Cursor_getCommentRange(CXCursor C) {
Modified: cfe/trunk/tools/libclang/CXSourceLocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CXSourceLocation.cpp?rev=173269&r1=173268&r2=173269&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CXSourceLocation.cpp (original)
+++ cfe/trunk/tools/libclang/CXSourceLocation.cpp Wed Jan 23 09:56:07 2013
@@ -346,7 +346,7 @@
return createNullLocation(file, line, column, offset);
if (file)
- *file = static_cast<void*>(const_cast<FileEntry*>(SM.getFileEntryForID(FID)));
+ *file = const_cast<FileEntry *>(SM.getFileEntryForID(FID));
if (line)
*line = SM.getLineNumber(FID, FileOffset);
if (column)
More information about the cfe-commits
mailing list