From: Reid Spencer Date: Fri, 12 May 2006 19:20:55 +0000 (+0000) Subject: Don't use old-style casts. This prevents compiler warnings when CommandLine.h X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=3e41da29fb74a4f2a43a1539b612b2fb11bef375;p=oota-llvm.git Don't use old-style casts. This prevents compiler warnings when CommandLine.h 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 --- diff --git a/include/llvm/Support/CommandLine.h b/include/llvm/Support/CommandLine.h index 993d93f4f66..19b5f29fb7f 100644 --- a/include/llvm/Support/CommandLine.h +++ b/include/llvm/Support/CommandLine.h @@ -997,7 +997,7 @@ class bits_storage { template static unsigned Bit(const T &V) { - unsigned BitPos = (unsigned)V; + unsigned BitPos = reinterpret_cast(V); assert(BitPos < sizeof(unsigned) * 8 && "enum exceeds width of bit vector!"); return 1 << BitPos; @@ -1038,7 +1038,7 @@ class bits_storage { template static unsigned Bit(const T &V) { - unsigned BitPos = (unsigned)V; + unsigned BitPos = reinterpret_cast(V); assert(BitPos < sizeof(unsigned) * 8 && "enum exceeds width of bit vector!"); return 1 << BitPos;