]> granicus.if.org Git - clang/commitdiff
[libclang] Add some constness in CXSourceLocation and CXSourceRange.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Fri, 11 Jan 2013 22:29:47 +0000 (22:29 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Fri, 11 Jan 2013 22:29:47 +0000 (22:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172261 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang-c/Index.h
tools/libclang/CXSourceLocation.h

index 0214a7da6d9f022ced4296cb6939843d8e1f9bbe..6fa8296bdfb250c422358a7f07c077aab019056e 100644 (file)
@@ -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;
index 735629d2c2dfea0a9bee11152e69a42fcdf00111..f97ac1f3aff813e08ad39d772bd3866957a2a325 100644 (file)
@@ -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;
 }