From: Cary Coutant Date: Sat, 6 Feb 2016 18:28:36 +0000 (-0800) Subject: Fix incorrect casts. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=72c55146bb505642994637071b305bf4d30ef685;p=binutils-gdb.git Fix incorrect casts. gold/ PR gold/19577 * reloc.h (Bits::has_unsigned_overflow32): Fix static_cast. (Bits::has_unsigned_overflow): Remove unnecessary static_cast. --- diff --git a/gold/ChangeLog b/gold/ChangeLog index ba0b97361cb..a8184fc9634 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,9 @@ +2016-02-06 Cary Coutant + + PR gold/19577 + * reloc.h (Bits::has_unsigned_overflow32): Fix static_cast. + (Bits::has_unsigned_overflow): Remove unnecessary static_cast. + 2016-02-06 Cary Coutant PR gold/19577 diff --git a/gold/reloc.h b/gold/reloc.h index fce73136375..9c09c7cbcc8 100644 --- a/gold/reloc.h +++ b/gold/reloc.h @@ -1015,7 +1015,7 @@ class Bits gold_assert(bits > 0 && bits <= 32); if (bits == 32) return false; - uint32_t max = static_cast((1U << bits) - 1); + uint32_t max = static_cast((1U << bits) - 1); return val > max; } @@ -1081,7 +1081,7 @@ class Bits gold_assert(bits > 0 && bits <= 64); if (bits == 64) return false; - uint64_t max = static_cast((static_cast(1) << bits) - 1); + uint64_t max = (static_cast(1) << bits) - 1; return val > max; }