Skip to content

Commit

Permalink
Don't use old-style casts. This prevents compiler warnings when Comma…
Browse files Browse the repository at this point in the history
…ndLine.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
  • Loading branch information
Reid Spencer committed May 12, 2006
1 parent 3b6d56c commit 3e41da2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/llvm/Support/CommandLine.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 3e41da2

Please sign in to comment.