[cfe-commits] r172564 - /cfe/trunk/tools/libclang/CXSourceLocation.cpp

David Greene greened at obbligato.org
Tue Jan 15 14:09:49 PST 2013


Author: greened
Date: Tue Jan 15 16:09:49 2013
New Revision: 172564

URL: http://llvm.org/viewvc/llvm-project?rev=172564&view=rev
Log:
Fix Casting

Use const_cast<> to avoid a cast-away-const error.

Modified:
    cfe/trunk/tools/libclang/CXSourceLocation.cpp

Modified: cfe/trunk/tools/libclang/CXSourceLocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CXSourceLocation.cpp?rev=172564&r1=172563&r2=172564&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CXSourceLocation.cpp (original)
+++ cfe/trunk/tools/libclang/CXSourceLocation.cpp Tue Jan 15 16:09:49 2013
@@ -232,7 +232,7 @@
   }
   
   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 @@
     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)





More information about the cfe-commits mailing list