summaryrefslogtreecommitdiffstats
path: root/src/intel/genxml/gen_pack_header.py
diff options
context:
space:
mode:
authorEric Engestrom <[email protected]>2017-11-22 10:11:13 +0000
committerEric Engestrom <[email protected]>2017-11-23 09:44:16 +0000
commit1d3944aeebb0cc68c999e0d129edbdc29381cb4d (patch)
tree83980edfc12107b1956bc715d720c6b108575ffd /src/intel/genxml/gen_pack_header.py
parentf9cb2370f3404501c2b594ac116bfb6bfe878e87 (diff)
genxml: fix assert guards
This removes a few hundred warnings on debug builds with asserts off. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/intel/genxml/gen_pack_header.py')
-rw-r--r--src/intel/genxml/gen_pack_header.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/intel/genxml/gen_pack_header.py b/src/intel/genxml/gen_pack_header.py
index 1a5d193d228..e6cea8646ff 100644
--- a/src/intel/genxml/gen_pack_header.py
+++ b/src/intel/genxml/gen_pack_header.py
@@ -73,7 +73,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;
@@ -91,7 +91,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));
@@ -108,7 +108,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);
@@ -131,7 +131,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);
@@ -150,7 +150,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);