[cfe-commits] r106216 - in /cfe/trunk: include/clang/AST/TypeLoc.h include/clang/Lex/Token.h lib/Sema/SemaExprCXX.cpp

Gabor Greif ggreif at gmail.com
Thu Jun 17 04:29:31 PDT 2010


Author: ggreif
Date: Thu Jun 17 06:29:31 2010
New Revision: 106216

URL: http://llvm.org/viewvc/llvm-project?rev=106216&view=rev
Log:
fix some more gcc3.4 constness warnings

Modified:
    cfe/trunk/include/clang/AST/TypeLoc.h
    cfe/trunk/include/clang/Lex/Token.h
    cfe/trunk/lib/Sema/SemaExprCXX.cpp

Modified: cfe/trunk/include/clang/AST/TypeLoc.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/TypeLoc.h?rev=106216&r1=106215&r2=106216&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/TypeLoc.h (original)
+++ cfe/trunk/include/clang/AST/TypeLoc.h Thu Jun 17 06:29:31 2010
@@ -142,7 +142,7 @@
 
 /// \brief Return the TypeLoc for a type source info.
 inline TypeLoc TypeSourceInfo::getTypeLoc() const {
-  return TypeLoc(Ty, (void*)(this + 1));
+  return TypeLoc(Ty, const_cast<TypeSourceInfo*>(this + 1));
 }
 
 /// \brief Wrapper of type source information for a type with

Modified: cfe/trunk/include/clang/Lex/Token.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/Token.h?rev=106216&r1=106215&r2=106216&view=diff
==============================================================================
--- cfe/trunk/include/clang/Lex/Token.h (original)
+++ cfe/trunk/include/clang/Lex/Token.h Thu Jun 17 06:29:31 2010
@@ -170,7 +170,7 @@
   }
   void setLiteralData(const char *Ptr) {
     assert(isLiteral() && "Cannot set literal data of non-literal");
-    PtrData = (void*)Ptr;
+    PtrData = const_cast<char*>(Ptr);
   }
 
   void *getAnnotationValue() const {

Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=106216&r1=106215&r2=106216&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Thu Jun 17 06:29:31 2010
@@ -2924,7 +2924,8 @@
   // record types and dependent types matter.
   void *ObjectTypePtrForLookup = 0;
   if (!SS.isSet()) {
-    ObjectTypePtrForLookup = (void *)ObjectType->getAs<RecordType>();
+    ObjectTypePtrForLookup = const_cast<RecordType*>(
+                                               ObjectType->getAs<RecordType>());
     if (!ObjectTypePtrForLookup && ObjectType->isDependentType())
       ObjectTypePtrForLookup = Context.DependentTy.getAsOpaquePtr();
   }





More information about the cfe-commits mailing list