These should probably be #ifndef. In particular, the first would catch #24
|
#ifdef NDEBUG |
|
static void |
|
_map_node_array_validate(void *o) |
|
{ |
|
assert(IS_ARRAY_NODE(o)); |
|
MapNode_Array *node = (MapNode_Array*)(o); |
|
Py_ssize_t i = 0, count = 0; |
|
for (; i < HAMT_ARRAY_NODE_SIZE; i++) { |
|
if (node->a_array[i] != NULL) { |
|
count++; |
|
} |
|
} |
|
assert(count == node->a_count); |
|
} |
|
|
|
#define VALIDATE_ARRAY_NODE(NODE) \ |
|
do { _map_node_array_validate(NODE); } while (0); |
|
#else |
|
#define VALIDATE_ARRAY_NODE(NODE) |
|
#endif |
|
#ifdef NDEBUG |
|
/* Ensure that Collision.without implementation |
|
converts to Bitmap nodes itself. |
|
*/ |
|
if (IS_COLLISION_NODE(sub_node)) { |
|
assert(map_node_collision_count( |
|
(MapNode_Collision*)sub_node) > 1); |
|
} |
|
#endif |
|
#ifdef NDEBUG |
|
if (IS_COLLISION_NODE(node)) { |
|
assert( |
|
(map_node_collision_count( |
|
(MapNode_Collision*)node)) > 1); |
|
} |
|
else if (IS_ARRAY_NODE(node)) { |
|
assert(((MapNode_Array*)node)->a_count >= 16); |
|
} |
|
#endif |
|
#ifdef NDEBUG |
|
assert(iter->i_level >= 0); |
|
iter->i_nodes[iter->i_level] = NULL; |
|
#endif |
|
#ifdef NDEBUG |
|
assert(iter->i_level >= 0); |
|
iter->i_nodes[iter->i_level] = NULL; |
|
#endif |
|
#ifdef NDEBUG |
|
assert(iter->i_level >= 0); |
|
iter->i_nodes[iter->i_level] = NULL; |
|
#endif |
|
#ifdef NDEBUG |
|
assert(iter->i_level >= 0); |
|
iter->i_nodes[iter->i_level] = NULL; |
|
#endif |
These should probably be
#ifndef. In particular, the first would catch #24immutables/immutables/_map.c
Lines 396 to 415 in 11863b2
immutables/immutables/_map.c
Lines 1112 to 1120 in 11863b2
immutables/immutables/_map.c
Lines 2009 to 2018 in 11863b2
immutables/immutables/_map.c
Lines 2301 to 2304 in 11863b2
immutables/immutables/_map.c
Lines 2338 to 2341 in 11863b2
immutables/immutables/_map.c
Lines 2362 to 2365 in 11863b2
immutables/immutables/_map.c
Lines 2384 to 2387 in 11863b2