aboutsummaryrefslogtreecommitdiff
path: root/gold/reloc.h
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@gmail.com>2016-02-06 10:28:36 -0800
committerCary Coutant <ccoutant@gmail.com>2016-02-06 10:28:36 -0800
commit72c55146bb505642994637071b305bf4d30ef685 (patch)
tree7a01d27765620f86671cf2d01b9bd6d7566008ec /gold/reloc.h
parent3b8bcce879fb163889b8ba1c09baf5e9b18bc388 (diff)
downloadgdb-72c55146bb505642994637071b305bf4d30ef685.zip
gdb-72c55146bb505642994637071b305bf4d30ef685.tar.gz
gdb-72c55146bb505642994637071b305bf4d30ef685.tar.bz2
Fix incorrect casts.
gold/ PR gold/19577 * reloc.h (Bits::has_unsigned_overflow32): Fix static_cast. (Bits::has_unsigned_overflow): Remove unnecessary static_cast.
Diffstat (limited to 'gold/reloc.h')
-rw-r--r--gold/reloc.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/gold/reloc.h b/gold/reloc.h
index fce7313..9c09c7c 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<int32_t>((1U << bits) - 1);
+ uint32_t max = static_cast<uint32_t>((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<int64_t>((static_cast<uint64_t>(1) << bits) - 1);
+ uint64_t max = (static_cast<uint64_t>(1) << bits) - 1;
return val > max;
}