]> granicus.if.org Git - clang/commitdiff
Fix Casting
authorDavid Greene <greened@obbligato.org>
Tue, 15 Jan 2013 22:09:49 +0000 (22:09 +0000)
committerDavid Greene <greened@obbligato.org>
Tue, 15 Jan 2013 22:09:49 +0000 (22:09 +0000)
Use const_cast<> to avoid a cast-away-const error.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172564 91177308-0d34-0410-b5e6-96231b3b80d8

tools/libclang/CXSourceLocation.cpp

index a6a031edd88a69eca591cf96aaab823d4353e522..2b3a300f0dee00a57000b5d42f15e0f8026e5fd1 100644 (file)
@@ -232,7 +232,7 @@ void clang_getExpansionLocation(CXSourceLocation location,
   }
   
   if (file)
-    *file = (void *)SM.getFileEntryForSLocEntry(sloc);
+    *file = const_cast<FileEntry *>(SM.getFileEntryForSLocEntry(sloc));
   if (line)
     *line = SM.getExpansionLineNumber(ExpansionLoc);
   if (column)
@@ -309,7 +309,7 @@ void clang_getSpellingLocation(CXSourceLocation location,
     return createNullLocation(file, line, column, offset);
   
   if (file)
-    *file = (void *)SM.getFileEntryForID(FID);
+    *file = const_cast<FileEntry *>(SM.getFileEntryForID(FID));
   if (line)
     *line = SM.getLineNumber(FID, FileOffset);
   if (column)