Skip to content

Commit 2507c05

Browse files
lukaszgotszaldintelsys_zuul
authored andcommitted
use IGC_ASSERT in common Units.hpp
Change-Id: I2a0ae8c9abac5cf80782901edbe0dea15a773d2e
1 parent 30f1cf4 commit 2507c05

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

IGC/common/Units.hpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2828
#include "common/debug/Debug.hpp"
2929
#include <limits>
3030
#include <type_traits>
31+
#include "Probe.h"
3132

3233
template<typename T, typename TUnder = unsigned int, int TRatio = T::ratio>
3334
class Unit
@@ -68,8 +69,8 @@ class Unit
6869
template<typename R>
6970
Unit<T, TUnder> operator =(Unit<R, TUnder> other)
7071
{
71-
assert( other.m_value % T::ratio == 0 &&
72-
"Invalid assignment: resulting count is not a whole number" );
72+
IGC_ASSERT(other.m_value % T::ratio == 0 &&
73+
"Invalid assignment: resulting count is not a whole number");
7374
this->m_value = other.m_value;
7475
return *this;
7576
}
@@ -146,7 +147,7 @@ class Unit
146147
}
147148
else
148149
{
149-
assert( 0 && "Corrupted value of a unit, should be a multiple of the ratio." );
150+
IGC_ASSERT(0 && "Corrupted value of a unit, should be a multiple of the ratio.");
150151
return 0;
151152
}
152153
}
@@ -219,8 +220,8 @@ class Unit
219220
"Size of the unit on the right hand side of operator + must be equal to"
220221
"or a multiple of the left-hand unit size.");
221222

222-
assert( (other.m_value % T::ratio == 0) &&
223-
"Invalid addition: resulting count is not a whole number" );
223+
IGC_ASSERT((other.m_value % T::ratio == 0) &&
224+
"Invalid addition: resulting count is not a whole number");
224225
Unit<T, TUnder> res;
225226
res.m_value = this->m_value + other.m_value;
226227
return res;
@@ -236,8 +237,8 @@ class Unit
236237
"Size of the unit on the right hand side of operator- must be equal to"
237238
"or a multiple of the left-hand unit size.");
238239

239-
assert( (other.m_value % T::ratio == 0) &&
240-
"Invalid subtraction: resulting count is not a whole number" );
240+
IGC_ASSERT((other.m_value % T::ratio == 0) &&
241+
"Invalid subtraction: resulting count is not a whole number");
241242
Unit<T, TUnder> res;
242243
res.m_value = this->m_value - other.m_value;
243244
return res;
@@ -253,8 +254,8 @@ class Unit
253254
"Size of the unit on the right hand side of operator- must be equal to"
254255
"or a multiple of the left-hand unit size.");
255256

256-
assert( (other.m_value % T::ratio == 0) &&
257-
"Invalid subtraction: resulting count is not a whole number" );
257+
IGC_ASSERT((other.m_value % T::ratio == 0) &&
258+
"Invalid subtraction: resulting count is not a whole number");
258259
Unit<T, TUnder> res;
259260
res.m_value = other.m_value - this->m_value;
260261
return res;

0 commit comments

Comments
 (0)