From: Argyrios Kyrtzidis Date: Fri, 11 Jan 2013 22:29:47 +0000 (+0000) Subject: [libclang] Add some constness in CXSourceLocation and CXSourceRange. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e2748288a04cda2e976a3fe859e4334afaf9274a;p=clang [libclang] Add some constness in CXSourceLocation and CXSourceRange. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172261 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h index 0214a7da6d..6fa8296bdf 100644 --- a/include/clang-c/Index.h +++ b/include/clang-c/Index.h @@ -342,7 +342,7 @@ CINDEX_LINKAGE CXFile clang_getFile(CXTranslationUnit tu, * to map a source location to a particular file, line, and column. */ typedef struct { - void *ptr_data[2]; + const void *ptr_data[2]; unsigned int_data; } CXSourceLocation; @@ -353,7 +353,7 @@ typedef struct { * starting and end locations from a source range, respectively. */ typedef struct { - void *ptr_data[2]; + const void *ptr_data[2]; unsigned begin_int_data; unsigned end_int_data; } CXSourceRange; diff --git a/tools/libclang/CXSourceLocation.h b/tools/libclang/CXSourceLocation.h index 735629d2c2..f97ac1f3af 100644 --- a/tools/libclang/CXSourceLocation.h +++ b/tools/libclang/CXSourceLocation.h @@ -32,7 +32,7 @@ translateSourceLocation(const SourceManager &SM, const LangOptions &LangOpts, if (Loc.isInvalid()) clang_getNullLocation(); - CXSourceLocation Result = { { (void*) &SM, (void*) &LangOpts, }, + CXSourceLocation Result = { { &SM, &LangOpts, }, Loc.getRawEncoding() }; return Result; }