Introduce our own assertion macros with finer control

This commit is contained in:
Mike Gelfand
2017-06-08 10:24:12 +03:00
parent 5f7bc801c8
commit 98695fe3c1
69 changed files with 1137 additions and 1048 deletions

View File

@@ -12,9 +12,8 @@
#pragma once
#include <assert.h>
#include "transmission.h"
#include "tr-assert.h"
/**
* @addtogroup utils Utilities
@@ -50,9 +49,9 @@ void tr_ptrArrayForeach(tr_ptrArray* array, PtrArrayForeachFunc func);
@return the nth item in a tr_ptrArray */
static inline void* tr_ptrArrayNth(tr_ptrArray* array, int i)
{
assert(array != NULL);
assert(i >= 0);
assert(i < array->n_items);
TR_ASSERT(array != NULL);
TR_ASSERT(i >= 0);
TR_ASSERT(i < array->n_items);
return array->items[i];
}