summaryrefslogtreecommitdiffstats
path: root/src/broadcom
diff options
context:
space:
mode:
authorEric Engestrom <[email protected]>2017-11-24 17:59:23 +0000
committerEric Engestrom <[email protected]>2017-11-28 09:50:36 +0000
commitbb46111c01479d831932eb63f69da5ccda29f6fc (patch)
tree03e46b611c0380e40ec25ab0eacd3696eaa6533e /src/broadcom
parent7bb89e1c8f314a9d8e591a7531722a15f0ac72d0 (diff)
broadcom: use NDEBUG to guard asserts
Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/broadcom')
-rw-r--r--src/broadcom/cle/v3d_packet_helpers.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/broadcom/cle/v3d_packet_helpers.h b/src/broadcom/cle/v3d_packet_helpers.h
index c86cad85266..bc1bf3eb76e 100644
--- a/src/broadcom/cle/v3d_packet_helpers.h
+++ b/src/broadcom/cle/v3d_packet_helpers.h
@@ -64,7 +64,7 @@ __gen_uint(uint64_t v, uint32_t start, uint32_t end)
{
__gen_validate_value(v);
-#if DEBUG
+#ifndef NDEBUG
const int width = end - start + 1;
if (width < 64) {
const uint64_t max = (1ull << width) - 1;
@@ -82,7 +82,7 @@ __gen_sint(int64_t v, uint32_t start, uint32_t end)
__gen_validate_value(v);
-#if DEBUG
+#ifndef NDEBUG
if (width < 64) {
const int64_t max = (1ll << (width - 1)) - 1;
const int64_t min = -(1ll << (width - 1));
@@ -99,7 +99,7 @@ static inline uint64_t
__gen_offset(uint64_t v, uint32_t start, uint32_t end)
{
__gen_validate_value(v);
-#if DEBUG
+#ifndef NDEBUG
uint64_t mask = (~0ull >> (64 - (end - start + 1))) << start;
assert((v & ~mask) == 0);
@@ -122,7 +122,7 @@ __gen_sfixed(float v, uint32_t start, uint32_t end, uint32_t fract_bits)
const float factor = (1 << fract_bits);
-#if DEBUG
+#ifndef NDEBUG
const float max = ((1 << (end - start)) - 1) / factor;
const float min = -(1 << (end - start)) / factor;
assert(min <= v && v <= max);
@@ -141,7 +141,7 @@ __gen_ufixed(float v, uint32_t start, uint32_t end, uint32_t fract_bits)
const float factor = (1 << fract_bits);
-#if DEBUG
+#ifndef NDEBUG
const float max = ((1 << (end - start + 1)) - 1) / factor;
const float min = 0.0f;
assert(min <= v && v <= max);