From 2d13fdd681b52a05468b3de1be32a8f6b003fa9a Mon Sep 17 00:00:00 2001 From: drillsar Date: Sat, 1 Jul 2017 22:37:12 -0400 Subject: [PATCH] 32-bit value fix to the 64-bit type. --- src/xenia/base/bit_stream.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xenia/base/bit_stream.cc b/src/xenia/base/bit_stream.cc index 70a9f1a23..ce74937dd 100644 --- a/src/xenia/base/bit_stream.cc +++ b/src/xenia/base/bit_stream.cc @@ -53,7 +53,7 @@ uint64_t BitStream::Peek(size_t num_bits) { // AND with mask // ...................| target bits | - bits &= (1 << num_bits) - 1; + bits &= (1ULL << num_bits) - 1; return bits; } @@ -74,7 +74,7 @@ bool BitStream::Write(uint64_t val, size_t num_bits) { size_t rel_offset_bits = offset_bits_ - (offset_bytes << 3); // Construct a mask - uint64_t mask = (1 << num_bits) - 1; + uint64_t mask = (1ULL << num_bits) - 1; mask <<= 64 - (rel_offset_bits + num_bits); mask = ~mask;