From: Dmitri Gribenko Date: Sat, 26 Jan 2013 21:49:50 +0000 (+0000) Subject: libclang: type safety for CXTranslationUnitImpl::CIdx X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8c718e7d87018919b5b84b0d545fe477b2d532d1;p=clang libclang: type safety for CXTranslationUnitImpl::CIdx git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173590 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp index a78b6073d3..949db521cb 100644 --- a/tools/libclang/CIndex.cpp +++ b/tools/libclang/CIndex.cpp @@ -2758,7 +2758,7 @@ static void clang_saveTranslationUnit_Impl(void *UserData) { SaveTranslationUnitInfo *STUI = static_cast(UserData); - CIndexer *CXXIdx = (CIndexer*)STUI->TU->CIdx; + CIndexer *CXXIdx = STUI->TU->CIdx; if (CXXIdx->isOptEnabled(CXGlobalOpt_ThreadBackgroundPriorityForIndexing)) setThreadBackgroundPriority(); @@ -2857,7 +2857,7 @@ static void clang_reparseTranslationUnit_Impl(void *UserData) { (void) options; RTUI->result = 1; - CIndexer *CXXIdx = (CIndexer*)TU->CIdx; + CIndexer *CXXIdx = TU->CIdx; if (CXXIdx->isOptEnabled(CXGlobalOpt_ThreadBackgroundPriorityForEditing)) setThreadBackgroundPriority(); @@ -5475,7 +5475,7 @@ static void clang_annotateTokensImpl(void *UserData) { const unsigned NumTokens = ((clang_annotateTokens_Data*)UserData)->NumTokens; CXCursor *Cursors = ((clang_annotateTokens_Data*)UserData)->Cursors; - CIndexer *CXXIdx = (CIndexer*)TU->CIdx; + CIndexer *CXXIdx = TU->CIdx; if (CXXIdx->isOptEnabled(CXGlobalOpt_ThreadBackgroundPriorityForEditing)) setThreadBackgroundPriority(); diff --git a/tools/libclang/CIndexCodeCompletion.cpp b/tools/libclang/CIndexCodeCompletion.cpp index 9b0af2e898..1ffd0236c5 100644 --- a/tools/libclang/CIndexCodeCompletion.cpp +++ b/tools/libclang/CIndexCodeCompletion.cpp @@ -692,7 +692,7 @@ void clang_codeCompleteAt_Impl(void *UserData) { if (!AST) return; - CIndexer *CXXIdx = (CIndexer*)TU->CIdx; + CIndexer *CXXIdx = TU->CIdx; if (CXXIdx->isOptEnabled(CXGlobalOpt_ThreadBackgroundPriorityForEditing)) setThreadBackgroundPriority(); diff --git a/tools/libclang/CXTranslationUnit.h b/tools/libclang/CXTranslationUnit.h index 428f5622e7..c25056a9b7 100644 --- a/tools/libclang/CXTranslationUnit.h +++ b/tools/libclang/CXTranslationUnit.h @@ -23,7 +23,7 @@ namespace clang { } // namespace clang struct CXTranslationUnitImpl { - void *CIdx; + clang::CIndexer *CIdx; clang::ASTUnit *TheASTUnit; void *StringPool; void *Diagnostics; diff --git a/tools/libclang/Indexing.cpp b/tools/libclang/Indexing.cpp index 4a51e32066..6f01a0b349 100644 --- a/tools/libclang/Indexing.cpp +++ b/tools/libclang/Indexing.cpp @@ -759,7 +759,7 @@ static void clang_indexTranslationUnit_Impl(void *UserData) { if (!client_index_callbacks || index_callbacks_size == 0) return; - CIndexer *CXXIdx = (CIndexer*)TU->CIdx; + CIndexer *CXXIdx = TU->CIdx; if (CXXIdx->isOptEnabled(CXGlobalOpt_ThreadBackgroundPriorityForIndexing)) setThreadBackgroundPriority();