From 58d54740785eb2c7208a01afb5bd9736e5808069 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Thu, 31 May 2012 09:09:43 +0200 Subject: Assertions improved This patch is replaces generic xs_asserts by errno_assers and alloc_asserts as appropriate. It is based on 0MQ patch by Martin Hurton. Signed-off-by: Martin Sustrik --- src/prefix_filter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/prefix_filter.cpp') diff --git a/src/prefix_filter.cpp b/src/prefix_filter.cpp index abf68d0..b166bca 100644 --- a/src/prefix_filter.cpp +++ b/src/prefix_filter.cpp @@ -111,7 +111,7 @@ static bool pfx_add (pfx_node_t *node_, (node_->min < c ? c - node_->min : node_->min - c) + 1; node_->next.table = (pfx_node_t**) malloc (sizeof (pfx_node_t*) * node_->count); - xs_assert (node_->next.table); + alloc_assert (node_->next.table); for (unsigned short i = 0; i != node_->count; ++i) node_->next.table [i] = 0; node_->min = std::min (node_->min, c); @@ -293,7 +293,7 @@ static void pfx_rm_all (pfx_node_t *node_, void *subscribers_, node_->count = new_max - new_min + 1; node_->next.table = (pfx_node_t**) malloc (sizeof (pfx_node_t*) * node_->count); - xs_assert (node_->next.table); + alloc_assert (node_->next.table); memmove (node_->next.table, old_table + (new_min - node_->min), sizeof (pfx_node_t*) * node_->count); @@ -393,7 +393,7 @@ static bool pfx_rm (pfx_node_t *node_, const unsigned char *prefix_, node_->count = node_->count - (new_min - node_->min); node_->next.table = (pfx_node_t**) malloc (sizeof (pfx_node_t*) * node_->count); - xs_assert (node_->next.table); + alloc_assert (node_->next.table); memmove (node_->next.table, old_table + (new_min - node_->min), sizeof (pfx_node_t*) * node_->count); @@ -417,7 +417,7 @@ static bool pfx_rm (pfx_node_t *node_, const unsigned char *prefix_, pfx_node_t **old_table = node_->next.table; node_->next.table = (pfx_node_t**) malloc (sizeof (pfx_node_t*) * node_->count); - xs_assert (node_->next.table); + alloc_assert (node_->next.table); memmove (node_->next.table, old_table, sizeof (pfx_node_t*) * node_->count); -- cgit v1.2.3