From ff6000745886cb085ca80e42498020497bc7f95f Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sun, 3 Apr 2011 22:23:14 +0000 Subject: Fix build with NDEBUG defined svn path=/trunk/netsurf/; revision=12154 --- render/box_normalise.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'render/box_normalise.c') diff --git a/render/box_normalise.c b/render/box_normalise.c index b4c005c8e..21ede6dd4 100644 --- a/render/box_normalise.c +++ b/render/box_normalise.c @@ -30,11 +30,11 @@ #include "render/box.h" #include "render/table.h" #include "desktop/gui.h" -#define NDEBUG #include "utils/log.h" -#undef NDEBUG #include "utils/talloc.h" +/* Define to enable box normalise debug */ +#undef BOX_NORMALISE_DEBUG /** * Row spanning information for a cell @@ -105,7 +105,9 @@ bool box_normalise_block(struct box *block, struct content *c) assert(block != NULL); +#ifdef BOX_NORMALISE_DEBUG LOG(("block %p, block->type %u", block, block->type)); +#endif assert(block->type == BOX_BLOCK || block->type == BOX_INLINE_BLOCK || block->type == BOX_TABLE_CELL); @@ -113,7 +115,9 @@ bool box_normalise_block(struct box *block, struct content *c) gui_multitask(); for (child = block->children; child != NULL; child = next_child) { +#ifdef BOX_NORMALISE_DEBUG LOG(("child %p, child->type = %d", child, child->type)); +#endif next_child = child->next; /* child may be destroyed */ @@ -210,7 +214,9 @@ bool box_normalise_table(struct box *table, struct content * c) assert(table != NULL); assert(table->type == BOX_TABLE); +#ifdef BOX_NORMALISE_DEBUG LOG(("table %p", table)); +#endif col_info.num_columns = 1; col_info.current_column = 0; @@ -318,7 +324,9 @@ bool box_normalise_table(struct box *table, struct content * c) if (table->children == NULL) { struct box *row; +#ifdef BOX_NORMALISE_DEBUG LOG(("table->children == 0, creating implied row")); +#endif assert(table->style != NULL); @@ -375,7 +383,9 @@ bool box_normalise_table(struct box *table, struct content * c) if (table_calculate_column_types(table) == false) return false; +#ifdef BOX_NORMALISE_DEBUG LOG(("table %p done", table)); +#endif return true; } @@ -531,7 +541,9 @@ bool box_normalise_table_row_group(struct box *row_group, assert(row_group != 0); assert(row_group->type == BOX_TABLE_ROW_GROUP); +#ifdef BOX_NORMALISE_DEBUG LOG(("row_group %p", row_group)); +#endif for (child = row_group->children; child != NULL; child = next_child) { next_child = child->next; @@ -615,7 +627,9 @@ bool box_normalise_table_row_group(struct box *row_group, } if (row_group->children == NULL) { +#ifdef BOX_NORMALISE_DEBUG LOG(("row_group->children == 0, inserting implied row")); +#endif assert(row_group->style != NULL); @@ -640,7 +654,9 @@ bool box_normalise_table_row_group(struct box *row_group, col_info->num_rows++; } +#ifdef BOX_NORMALISE_DEBUG LOG(("row_group %p done", row_group)); +#endif return true; } @@ -658,7 +674,10 @@ bool box_normalise_table_row(struct box *row, assert(row != NULL); assert(row->type == BOX_TABLE_ROW); + +#ifdef BOX_NORMALISE_DEBUG LOG(("row %p", row)); +#endif for (child = row->children; child != NULL; child = next_child) { next_child = child->next; @@ -761,7 +780,9 @@ bool box_normalise_table_row(struct box *row, /* Increment row counter */ col_info->num_rows++; +#ifdef BOX_NORMALISE_DEBUG LOG(("row %p done", row)); +#endif return true; } @@ -842,7 +863,10 @@ bool box_normalise_inline_container(struct box *cont, struct content * c) assert(cont != NULL); assert(cont->type == BOX_INLINE_CONTAINER); + +#ifdef BOX_NORMALISE_DEBUG LOG(("cont %p", cont)); +#endif for (child = cont->children; child != NULL; child = next_child) { next_child = child->next; @@ -902,7 +926,10 @@ bool box_normalise_inline_container(struct box *cont, struct content * c) assert(0); } } + +#ifdef BOX_NORMALISE_DEBUG LOG(("cont %p done", cont)); +#endif return true; } -- cgit v1.2.3