[cfe-commits] r106215 - /cfe/trunk/include/clang/Basic/IdentifierTable.h

Gabor Greif ggreif at gmail.com
Thu Jun 17 03:59:09 PDT 2010


Author: ggreif
Date: Thu Jun 17 05:59:08 2010
New Revision: 106215

URL: http://llvm.org/viewvc/llvm-project?rev=106215&view=rev
Log:
use typedef to make hack more transparent and also appease gcc3.4 constness warning

Modified:
    cfe/trunk/include/clang/Basic/IdentifierTable.h

Modified: cfe/trunk/include/clang/Basic/IdentifierTable.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/IdentifierTable.h?rev=106215&r1=106214&r2=106215&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/IdentifierTable.h (original)
+++ cfe/trunk/include/clang/Basic/IdentifierTable.h Thu Jun 17 05:59:08 2010
@@ -89,7 +89,8 @@
     // The 'this' pointer really points to a
     // std::pair<IdentifierInfo, const char*>, where internal pointer
     // points to the external string data.
-    return ((std::pair<IdentifierInfo, const char*>*) this)->second;
+    typedef std::pair<IdentifierInfo, const char*> actualtype;
+    return ((const actualtype*) this)->second;
   }
 
   /// getLength - Efficiently return the length of this identifier info.
@@ -101,7 +102,8 @@
     // The 'this' pointer really points to a
     // std::pair<IdentifierInfo, const char*>, where internal pointer
     // points to the external string data.
-    const char* p = ((std::pair<IdentifierInfo, const char*>*) this)->second-2;
+    typedef std::pair<IdentifierInfo, const char*> actualtype;
+    const char* p = ((const actualtype*) this)->second - 2;
     return (((unsigned) p[0]) | (((unsigned) p[1]) << 8)) - 1;
   }
 





More information about the cfe-commits mailing list