From c105738fa36bb2400adc47399c5b878d252d1c86 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 28 May 2015 16:08:46 +0100 Subject: Change LOG() macro to be varadic This changes the LOG macro to be varadic removing the need for all callsites to have double bracketing and allows for future improvement on how we use the logging macros. The callsites were changed with coccinelle and the changes checked by hand. Compile tested for several frontends but not all. A formatting annotation has also been added which allows the compiler to check the parameters and types passed to the logging. --- render/box_normalise.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'render/box_normalise.c') diff --git a/render/box_normalise.c b/render/box_normalise.c index 861ad741e..1010c408b 100644 --- a/render/box_normalise.c +++ b/render/box_normalise.c @@ -109,7 +109,7 @@ bool box_normalise_block(struct box *block, html_content *c) assert(block != NULL); #ifdef BOX_NORMALISE_DEBUG - LOG(("block %p, block->type %u", block, block->type)); + LOG("block %p, block->type %u", block, block->type); #endif assert(block->type == BOX_BLOCK || block->type == BOX_INLINE_BLOCK || @@ -117,7 +117,7 @@ bool box_normalise_block(struct box *block, html_content *c) for (child = block->children; child != NULL; child = next_child) { #ifdef BOX_NORMALISE_DEBUG - LOG(("child %p, child->type = %d", child, child->type)); + LOG("child %p, child->type = %d", child, child->type); #endif next_child = child->next; /* child may be destroyed */ @@ -221,7 +221,7 @@ bool box_normalise_table(struct box *table, html_content * c) assert(table->type == BOX_TABLE); #ifdef BOX_NORMALISE_DEBUG - LOG(("table %p", table)); + LOG("table %p", table); #endif col_info.num_columns = 1; @@ -335,7 +335,7 @@ bool box_normalise_table(struct box *table, html_content * c) struct box *row; #ifdef BOX_NORMALISE_DEBUG - LOG(("table->children == 0, creating implied row")); + LOG("table->children == 0, creating implied row"); #endif assert(table->style != NULL); @@ -397,7 +397,7 @@ bool box_normalise_table(struct box *table, html_content * c) return false; #ifdef BOX_NORMALISE_DEBUG - LOG(("table %p done", table)); + LOG("table %p done", table); #endif return true; @@ -583,7 +583,7 @@ bool box_normalise_table_row_group(struct box *row_group, assert(row_group->type == BOX_TABLE_ROW_GROUP); #ifdef BOX_NORMALISE_DEBUG - LOG(("row_group %p", row_group)); + LOG("row_group %p", row_group); #endif for (child = row_group->children; child != NULL; child = next_child) { @@ -675,7 +675,7 @@ 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")); + LOG("row_group->children == 0, inserting implied row"); #endif assert(row_group->style != NULL); @@ -710,7 +710,7 @@ bool box_normalise_table_row_group(struct box *row_group, row_group->rows = group_row_count; #ifdef BOX_NORMALISE_DEBUG - LOG(("row_group %p done", row_group)); + LOG("row_group %p done", row_group); #endif return true; @@ -732,7 +732,7 @@ bool box_normalise_table_row(struct box *row, assert(row->type == BOX_TABLE_ROW); #ifdef BOX_NORMALISE_DEBUG - LOG(("row %p", row)); + LOG("row %p", row); #endif for (child = row->children; child != NULL; child = next_child) { @@ -841,7 +841,7 @@ bool box_normalise_table_row(struct box *row, col_info->num_rows++; #ifdef BOX_NORMALISE_DEBUG - LOG(("row %p done", row)); + LOG("row %p done", row); #endif return true; @@ -932,7 +932,7 @@ bool box_normalise_inline_container(struct box *cont, html_content * c) assert(cont->type == BOX_INLINE_CONTAINER); #ifdef BOX_NORMALISE_DEBUG - LOG(("cont %p", cont)); + LOG("cont %p", cont); #endif for (child = cont->children; child != NULL; child = next_child) { @@ -995,7 +995,7 @@ bool box_normalise_inline_container(struct box *cont, html_content * c) } #ifdef BOX_NORMALISE_DEBUG - LOG(("cont %p done", cont)); + LOG("cont %p done", cont); #endif return true; -- cgit v1.2.3