RRenamed BX_CHECK to BX_ASSERT.

This commit is contained in:
Бранимир Караџић
2020-06-16 10:06:04 -07:00
parent 7bf14f0bac
commit f888abe8fb
16 changed files with 78 additions and 78 deletions

View File

@@ -22,7 +22,7 @@ namespace bx
inline void Error::setError(ErrorResult _errorResult, const StringView& _msg)
{
BX_CHECK(0 != _errorResult.code, "Invalid ErrorResult passed to setError!");
BX_ASSERT(0 != _errorResult.code, "Invalid ErrorResult passed to setError!");
if (!isOk() )
{
@@ -62,12 +62,12 @@ namespace bx
inline ErrorScope::ErrorScope(Error* _err)
: m_err(_err)
{
BX_CHECK(NULL != _err, "_err can't be NULL");
BX_ASSERT(NULL != _err, "_err can't be NULL");
}
inline ErrorScope::~ErrorScope()
{
BX_CHECK(m_err->isOk(), "Error: %d", m_err->get().code);
BX_ASSERT(m_err->isOk(), "Error: %d", m_err->get().code);
}
} // namespace bx

View File

@@ -186,7 +186,7 @@ namespace bx
template <uint16_t MaxHandlesT>
inline uint16_t HandleListT<MaxHandlesT>::getNext(uint16_t _handle) const
{
BX_CHECK(isValid(_handle), "Invalid handle %d!", _handle);
BX_ASSERT(isValid(_handle), "Invalid handle %d!", _handle);
const Link& curr = m_links[_handle];
return curr.m_next;
}
@@ -194,7 +194,7 @@ namespace bx
template <uint16_t MaxHandlesT>
inline uint16_t HandleListT<MaxHandlesT>::getPrev(uint16_t _handle) const
{
BX_CHECK(isValid(_handle), "Invalid handle %d!", _handle);
BX_ASSERT(isValid(_handle), "Invalid handle %d!", _handle);
const Link& curr = m_links[_handle];
return curr.m_prev;
}
@@ -202,7 +202,7 @@ namespace bx
template <uint16_t MaxHandlesT>
inline void HandleListT<MaxHandlesT>::remove(uint16_t _handle)
{
BX_CHECK(isValid(_handle), "Invalid handle %d!", _handle);
BX_ASSERT(isValid(_handle), "Invalid handle %d!", _handle);
Link& curr = m_links[_handle];
if (kInvalidHandle != curr.m_prev)
@@ -358,7 +358,7 @@ namespace bx
template <uint16_t MaxHandlesT>
inline void HandleAllocLruT<MaxHandlesT>::free(uint16_t _handle)
{
BX_CHECK(isValid(_handle), "Invalid handle %d!", _handle);
BX_ASSERT(isValid(_handle), "Invalid handle %d!", _handle);
m_list.remove(_handle);
m_alloc.free(_handle);
}
@@ -366,7 +366,7 @@ namespace bx
template <uint16_t MaxHandlesT>
inline void HandleAllocLruT<MaxHandlesT>::touch(uint16_t _handle)
{
BX_CHECK(isValid(_handle), "Invalid handle %d!", _handle);
BX_ASSERT(isValid(_handle), "Invalid handle %d!", _handle);
m_list.remove(_handle);
m_list.pushFront(_handle);
}

View File

@@ -118,7 +118,7 @@ namespace bx
inline int32_t SizerWriter::write(const void* /*_data*/, int32_t _size, Error* _err)
{
BX_CHECK(NULL != _err, "Reader/Writer interface calling functions must handle errors.");
BX_ASSERT(NULL != _err, "Reader/Writer interface calling functions must handle errors.");
int32_t morecore = int32_t(m_pos - m_top) + _size;
@@ -170,7 +170,7 @@ namespace bx
inline int32_t MemoryReader::read(void* _data, int32_t _size, Error* _err)
{
BX_CHECK(NULL != _err, "Reader/Writer interface calling functions must handle errors.");
BX_ASSERT(NULL != _err, "Reader/Writer interface calling functions must handle errors.");
int64_t remainder = m_top-m_pos;
int32_t size = uint32_min(_size, uint32_t(min<int64_t>(remainder, INT32_MAX) ) );
@@ -233,7 +233,7 @@ namespace bx
inline int32_t MemoryWriter::write(const void* _data, int32_t _size, Error* _err)
{
BX_CHECK(NULL != _err, "Reader/Writer interface calling functions must handle errors.");
BX_ASSERT(NULL != _err, "Reader/Writer interface calling functions must handle errors.");
int32_t morecore = int32_t(m_pos - m_size) + _size;

View File

@@ -161,7 +161,7 @@ namespace bx
, m_size(_size)
, m_buffer(_buffer)
{
BX_CHECK(_control.available() >= _size, "%d >= %d", _control.available(), _size);
BX_ASSERT(_control.available() >= _size, "%d >= %d", _control.available(), _size);
}
template <typename ControlT>
@@ -210,7 +210,7 @@ namespace bx
{
uint32_t size = m_control.reserve(_size);
BX_UNUSED(size);
BX_CHECK(size == _size, "%d == %d", size, _size);
BX_ASSERT(size == _size, "%d == %d", size, _size);
m_write = m_control.m_current;
m_end = m_write+_size;
}

View File

@@ -137,7 +137,7 @@ namespace bx
template<typename Rng, typename Ty>
inline void shuffle(Rng* _rng, Ty* _array, uint32_t _num)
{
BX_CHECK(_num != 0, "Number of elements can't be 0!");
BX_ASSERT(_num != 0, "Number of elements can't be 0!");
for (uint32_t ii = 0, num = _num-1; ii < num; ++ii)
{

View File

@@ -230,9 +230,9 @@
# define BX_CLASS(_class, ...) BX_MACRO_DISPATCHER(BX_CLASS_, __VA_ARGS__)(_class, __VA_ARGS__)
#endif // BX_COMPILER_MSVC
#ifndef BX_CHECK
# define BX_CHECK(_condition, ...) BX_NOOP()
#endif // BX_CHECK
#ifndef BX_ASSERT
# define BX_ASSERT(_condition, ...) BX_NOOP()
#endif // BX_ASSERT
#ifndef BX_TRACE
# define BX_TRACE(...) BX_NOOP()
@@ -240,7 +240,7 @@
#ifndef BX_WARN
# define BX_WARN(_condition, ...) BX_NOOP()
#endif // BX_CHECK
#endif // BX_ASSERT
// static_assert sometimes causes unused-local-typedef...
BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG("-Wunused-local-typedef")