[x265] [PATCH 04 of 14] bitstream: add paren to avoid ambiguous precedence in X265_CHECK

Steve Borho steve at borho.org
Sat Sep 20 18:46:03 CEST 2014


# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1411228267 -3600
#      Sat Sep 20 16:51:07 2014 +0100
# Node ID 40252e734c76a865f938e9c01933f508fcfa6b70
# Parent  f2b4d2b34f8342d1194ed4e5d67aec2052f96299
bitstream: add paren to avoid ambiguous precedence in X265_CHECK

diff -r f2b4d2b34f83 -r 40252e734c76 source/common/bitstream.cpp
--- a/source/common/bitstream.cpp	Sat Sep 20 16:40:44 2014 +0100
+++ b/source/common/bitstream.cpp	Sat Sep 20 16:51:07 2014 +0100
@@ -44,7 +44,7 @@
 void Bitstream::write(uint32_t val, uint32_t numBits)
 {
     X265_CHECK(numBits <= 32, "numBits out of range\n");
-    X265_CHECK(numBits == 32 || (val & (~0 << numBits)) == 0, "numBits & val out of range\n");
+    X265_CHECK(numBits == 32 || ((val & (~0 << numBits)) == 0), "numBits & val out of range\n");
 
     uint32_t totalPartialBits = m_partialByteBits + numBits;
     uint32_t nextPartialBits = totalPartialBits & 7;


More information about the x265-devel mailing list