Don't use old-style casts. This prevents compiler warnings when CommandLine.h
authorReid Spencer <rspencer@reidspencer.com>
Fri, 12 May 2006 19:20:55 +0000 (19:20 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Fri, 12 May 2006 19:20:55 +0000 (19:20 +0000)
is used in projects that have stricter warning control than LLVM. This also
helps us find casts more easily if we ever need to.

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

include/llvm/Support/CommandLine.h

index 993d93f4f667155f96a5b68e956647c9dd9f3bba..19b5f29fb7f0d64502f2cff92c31eb72f84567be 100644 (file)
@@ -997,7 +997,7 @@ class bits_storage {
   
   template<class T>
   static unsigned Bit(const T &V) {
-    unsigned BitPos = (unsigned)V;
+    unsigned BitPos = reinterpret_cast<unsigned>(V);
     assert(BitPos < sizeof(unsigned) * 8 &&
           "enum exceeds width of bit vector!");
     return 1 << BitPos;
@@ -1038,7 +1038,7 @@ class bits_storage<DataType, bool> {
   
   template<class T>
   static unsigned Bit(const T &V) {
-    unsigned BitPos = (unsigned)V;
+    unsigned BitPos = reinterpret_cast<unsigned>(V);
     assert(BitPos < sizeof(unsigned) * 8 &&
           "enum exceeds width of bit vector!");
     return 1 << BitPos;