Part one - removed references and smart pointers
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
target_sources(${PROJECT_NAME}
|
||||
target_sources(${DAWN_TARGET_NAME}
|
||||
PRIVATE
|
||||
assert.cpp
|
||||
)
|
@ -27,15 +27,11 @@
|
||||
}
|
||||
|
||||
void assertNotNull(const void *pointer) {
|
||||
assertTrue(pointer != NULL);
|
||||
}
|
||||
|
||||
void assertNotNullptr(const void *ptr) {
|
||||
assertTRue(ptr != nullptr);
|
||||
assertTrue(pointer != nullptr && pointer != NULL);
|
||||
}
|
||||
|
||||
void assertNull(const void *pointer) {
|
||||
assertTrue(pointer == NULL);
|
||||
assertTrue(pointer == NULL || pointer == nullptr);
|
||||
}
|
||||
|
||||
void assertDeprecated() {
|
||||
|
@ -13,11 +13,6 @@
|
||||
#if ASSERTS_ENABLED == 0
|
||||
|
||||
static inline void assertTrue(bool_t x) {}
|
||||
static inline void assertFalse(bool_t x) {}
|
||||
static inline void assertUnreachable() {}
|
||||
static inline void assertNotNull(const void *pointer) {}
|
||||
static inline void assertNull(const void *pointer) {}
|
||||
static inline void assertDeprecated() {}
|
||||
|
||||
#elif ASSERTS_ENABLED == 1
|
||||
|
||||
@ -45,13 +40,6 @@ static inline void assertDeprecated() {}
|
||||
*/
|
||||
void assertNotNull(const void *pointer);
|
||||
|
||||
/**
|
||||
* Asserts a given pointer to not be a C++ nullptr.
|
||||
*
|
||||
* @param ptr Pointer to assert not nullptr.
|
||||
*/
|
||||
void assertNotNullptr(const void *ptr);
|
||||
|
||||
/**
|
||||
* Asserts a given pointer to be a nullptr.
|
||||
* @param pointer Pointer to assert is nullptr.
|
||||
@ -66,9 +54,5 @@ static inline void assertDeprecated() {}
|
||||
#else
|
||||
|
||||
#define assertTrue assert
|
||||
#define assertFalse(x) assertTrue(x == 0)
|
||||
#define assertNotNull(x) assert(x != NULL)
|
||||
#define assertUnreachable() assert(false)
|
||||
#define assertDeprecated assertUnreachable
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user