diff options
Diffstat (limited to 'render')
-rw-r--r-- | render/box.c | 4 | ||||
-rw-r--r-- | render/box_construct.c | 2 | ||||
-rw-r--r-- | render/box_normalise.c | 24 | ||||
-rw-r--r-- | render/box_textarea.c | 3 | ||||
-rw-r--r-- | render/form.c | 98 | ||||
-rw-r--r-- | render/html.c | 40 | ||||
-rw-r--r-- | render/html_css.c | 37 | ||||
-rw-r--r-- | render/html_css_fetcher.c | 9 | ||||
-rw-r--r-- | render/html_interaction.c | 2 | ||||
-rw-r--r-- | render/html_object.c | 14 | ||||
-rw-r--r-- | render/html_script.c | 47 | ||||
-rw-r--r-- | render/imagemap.c | 21 | ||||
-rw-r--r-- | render/layout.c | 113 | ||||
-rw-r--r-- | render/table.c | 11 | ||||
-rw-r--r-- | render/textplain.c | 4 |
15 files changed, 187 insertions, 242 deletions
diff --git a/render/box.c b/render/box.c index c9bf61df3..0d92b594c 100644 --- a/render/box.c +++ b/render/box.c @@ -1144,7 +1144,7 @@ bool box_handle_scrollbars(struct content *c, struct box *box, if (box->scroll_y == NULL) { data = malloc(sizeof(struct html_scrollbar_data)); if (data == NULL) { - LOG(("malloc failed")); + LOG("malloc failed"); warn_user("NoMemory", 0); return false; } @@ -1164,7 +1164,7 @@ bool box_handle_scrollbars(struct content *c, struct box *box, if (box->scroll_x == NULL) { data = malloc(sizeof(struct html_scrollbar_data)); if (data == NULL) { - LOG(("malloc failed")); + LOG("malloc failed"); warn_user("NoMemory", 0); return false; } diff --git a/render/box_construct.c b/render/box_construct.c index 5bceefd4d..581c6f2cd 100644 --- a/render/box_construct.c +++ b/render/box_construct.c @@ -1898,7 +1898,7 @@ bool box_frameset(BOX_SPECIAL_PARAMS) bool ok; if (content->frameset) { - LOG(("Error: multiple framesets in document.")); + LOG("Error: multiple framesets in document."); /* Don't convert children */ if (convert_children) *convert_children = false; 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; diff --git a/render/box_textarea.c b/render/box_textarea.c index eb865beac..4e4adff80 100644 --- a/render/box_textarea.c +++ b/render/box_textarea.c @@ -149,8 +149,7 @@ static void box_textarea_callback(void *data, struct textarea_msg *msg) break; default: - LOG(("Drag type %d not handled.", - msg->data.drag)); + LOG("Drag type %d not handled.", msg->data.drag); /* This is a logic faliure in the * front end code so abort. */ diff --git a/render/form.c b/render/form.c index 34029df44..16bf5bbb7 100644 --- a/render/form.c +++ b/render/form.c @@ -218,7 +218,7 @@ void form_free_control(struct form_control *control) struct form_control *c; assert(control != NULL); - LOG(("Control:%p name:%p value:%p initial:%p", control, control->name, control->value, control->initial_value)); + LOG("Control:%p name:%p value:%p initial:%p", control, control->name, control->value, control->initial_value); free(control->name); free(control->value); free(control->initial_value); @@ -229,7 +229,7 @@ void form_free_control(struct form_control *control) for (option = control->data.select.items; option; option = next) { next = option->next; - LOG(("select option:%p text:%p value:%p", option, option->text, option->value)); + LOG("select option:%p text:%p value:%p", option, option->text, option->value); free(option->text); free(option->value); free(option); @@ -346,7 +346,7 @@ bool form_successful_controls_dom(struct form *_form, /** \todo Replace this call with something DOMish */ charset = form_acceptable_charset(_form); if (charset == NULL) { - LOG(("failed to find charset")); + LOG("failed to find charset"); return false; } @@ -360,7 +360,7 @@ bool form_successful_controls_dom(struct form *_form, err = dom_html_form_element_get_elements(form, &form_elements); if (err != DOM_NO_ERR) { - LOG(("Could not get form elements")); + LOG("Could not get form elements"); goto dom_no_memory; } @@ -368,7 +368,7 @@ bool form_successful_controls_dom(struct form *_form, err = dom_html_collection_get_length(form_elements, &element_count); if (err != DOM_NO_ERR) { - LOG(("Could not get form element count")); + LOG("Could not get form element count"); goto dom_no_memory; } @@ -400,7 +400,7 @@ bool form_successful_controls_dom(struct form *_form, err = dom_html_collection_item(form_elements, index, &form_element); if (err != DOM_NO_ERR) { - LOG(("Could not retrieve form element %d", index)); + LOG("Could not retrieve form element %d", index); goto dom_no_memory; } @@ -412,7 +412,7 @@ bool form_successful_controls_dom(struct form *_form, */ err = dom_node_get_node_name(form_element, &nodename); if (err != DOM_NO_ERR) { - LOG(("Could not get node name")); + LOG("Could not get node name"); goto dom_no_memory; } @@ -421,14 +421,14 @@ bool form_successful_controls_dom(struct form *_form, (dom_html_text_area_element *)form_element, &element_disabled); if (err != DOM_NO_ERR) { - LOG(("Could not get text area disabled property")); + LOG("Could not get text area disabled property"); goto dom_no_memory; } err = dom_html_text_area_element_get_name( (dom_html_text_area_element *)form_element, &inputname); if (err != DOM_NO_ERR) { - LOG(("Could not get text area name property")); + LOG("Could not get text area name property"); goto dom_no_memory; } } else if (dom_string_isequal(nodename, corestring_dom_SELECT)) { @@ -436,14 +436,14 @@ bool form_successful_controls_dom(struct form *_form, (dom_html_select_element *)form_element, &element_disabled); if (err != DOM_NO_ERR) { - LOG(("Could not get select disabled property")); + LOG("Could not get select disabled property"); goto dom_no_memory; } err = dom_html_select_element_get_name( (dom_html_select_element *)form_element, &inputname); if (err != DOM_NO_ERR) { - LOG(("Could not get select name property")); + LOG("Could not get select name property"); goto dom_no_memory; } } else if (dom_string_isequal(nodename, corestring_dom_INPUT)) { @@ -451,14 +451,14 @@ bool form_successful_controls_dom(struct form *_form, (dom_html_input_element *)form_element, &element_disabled); if (err != DOM_NO_ERR) { - LOG(("Could not get input disabled property")); + LOG("Could not get input disabled property"); goto dom_no_memory; } err = dom_html_input_element_get_name( (dom_html_input_element *)form_element, &inputname); if (err != DOM_NO_ERR) { - LOG(("Could not get input name property")); + LOG("Could not get input name property"); goto dom_no_memory; } } else if (dom_string_isequal(nodename, corestring_dom_BUTTON)) { @@ -466,21 +466,21 @@ bool form_successful_controls_dom(struct form *_form, (dom_html_button_element *)form_element, &element_disabled); if (err != DOM_NO_ERR) { - LOG(("Could not get button disabled property")); + LOG("Could not get button disabled property"); goto dom_no_memory; } err = dom_html_button_element_get_name( (dom_html_button_element *)form_element, &inputname); if (err != DOM_NO_ERR) { - LOG(("Could not get button name property")); + LOG("Could not get button name property"); goto dom_no_memory; } } else { /* Unknown element type came through! */ - LOG(("Unknown element type: %*s", - dom_string_byte_length(nodename), - dom_string_data(nodename))); + LOG("Unknown element type: %*s", + (int)dom_string_byte_length(nodename), + dom_string_data(nodename)); goto dom_no_memory; } if (element_disabled) @@ -493,7 +493,7 @@ bool form_successful_controls_dom(struct form *_form, (dom_html_text_area_element *)form_element, &inputvalue); if (err != DOM_NO_ERR) { - LOG(("Could not get text area content")); + LOG("Could not get text area content"); goto dom_no_memory; } } else if (dom_string_isequal(nodename, corestring_dom_SELECT)) { @@ -502,13 +502,13 @@ bool form_successful_controls_dom(struct form *_form, (dom_html_select_element *)form_element, &options); if (err != DOM_NO_ERR) { - LOG(("Could not get select options collection")); + LOG("Could not get select options collection"); goto dom_no_memory; } err = dom_html_options_collection_get_length( options, &options_count); if (err != DOM_NO_ERR) { - LOG(("Could not get select options collection length")); + LOG("Could not get select options collection length"); goto dom_no_memory; } for(option_index = 0; option_index < options_count; @@ -525,14 +525,14 @@ bool form_successful_controls_dom(struct form *_form, err = dom_html_options_collection_item( options, option_index, &option_element); if (err != DOM_NO_ERR) { - LOG(("Could not get options item %d", option_index)); + LOG("Could not get options item %d", option_index); goto dom_no_memory; } err = dom_html_option_element_get_selected( (dom_html_option_element *)option_element, &selected); if (err != DOM_NO_ERR) { - LOG(("Could not get option selected property")); + LOG("Could not get option selected property"); goto dom_no_memory; } if (!selected) @@ -541,13 +541,13 @@ bool form_successful_controls_dom(struct form *_form, (dom_html_option_element *)option_element, &inputvalue); if (err != DOM_NO_ERR) { - LOG(("Could not get option value")); + LOG("Could not get option value"); goto dom_no_memory; } success_new = calloc(1, sizeof(*success_new)); if (success_new == NULL) { - LOG(("Could not allocate data for option")); + LOG("Could not allocate data for option"); goto dom_no_memory; } @@ -556,12 +556,12 @@ bool form_successful_controls_dom(struct form *_form, success_new->name = ENCODE_ITEM(inputname); if (success_new->name == NULL) { - LOG(("Could not encode name for option")); + LOG("Could not encode name for option"); goto dom_no_memory; } success_new->value = ENCODE_ITEM(inputvalue); if (success_new->value == NULL) { - LOG(("Could not encode value for option")); + LOG("Could not encode value for option"); goto dom_no_memory; } } @@ -571,7 +571,7 @@ bool form_successful_controls_dom(struct form *_form, (dom_html_button_element *) form_element, &inputtype); if (err != DOM_NO_ERR) { - LOG(("Could not get button element type")); + LOG("Could not get button element type"); goto dom_no_memory; } if (dom_string_caseless_isequal( @@ -591,7 +591,7 @@ bool form_successful_controls_dom(struct form *_form, (dom_html_button_element *)form_element, &inputvalue); if (err != DOM_NO_ERR) { - LOG(("Could not get submit button value")); + LOG("Could not get submit button value"); goto dom_no_memory; } /* Drop through to report successful button */ @@ -608,7 +608,7 @@ bool form_successful_controls_dom(struct form *_form, (dom_html_input_element *) form_element, &inputtype); if (err != DOM_NO_ERR) { - LOG(("Could not get input element type")); + LOG("Could not get input element type"); goto dom_no_memory; } if (dom_string_caseless_isequal( @@ -628,7 +628,7 @@ bool form_successful_controls_dom(struct form *_form, (dom_html_input_element *)form_element, &inputvalue); if (err != DOM_NO_ERR) { - LOG(("Could not get submit button value")); + LOG("Could not get submit button value"); goto dom_no_memory; } /* Drop through to report the successful button */ @@ -646,11 +646,11 @@ bool form_successful_controls_dom(struct form *_form, corestring_dom___ns_key_image_coords_node_data, &coords); if (err != DOM_NO_ERR) { - LOG(("Could not get image XY data")); + LOG("Could not get image XY data"); goto dom_no_memory; } if (coords == NULL) { - LOG(("No XY data on the image input")); + LOG("No XY data on the image input"); goto dom_no_memory; } @@ -659,7 +659,7 @@ bool form_successful_controls_dom(struct form *_form, success_new = calloc(1, sizeof(*success_new)); if (success_new == NULL) { free(basename); - LOG(("Could not allocate data for image.x")); + LOG("Could not allocate data for image.x"); goto dom_no_memory; } @@ -669,13 +669,13 @@ bool form_successful_controls_dom(struct form *_form, success_new->name = malloc(strlen(basename) + 3); if (success_new->name == NULL) { free(basename); - LOG(("Could not allocate name for image.x")); + LOG("Could not allocate name for image.x"); goto dom_no_memory; } success_new->value = malloc(20); if (success_new->value == NULL) { free(basename); - LOG(("Could not allocate value for image.x")); + LOG("Could not allocate value for image.x"); goto dom_no_memory; } sprintf(success_new->name, "%s.x", basename); @@ -684,7 +684,7 @@ bool form_successful_controls_dom(struct form *_form, success_new = calloc(1, sizeof(*success_new)); if (success_new == NULL) { free(basename); - LOG(("Could not allocate data for image.y")); + LOG("Could not allocate data for image.y"); goto dom_no_memory; } @@ -694,13 +694,13 @@ bool form_successful_controls_dom(struct form *_form, success_new->name = malloc(strlen(basename) + 3); if (success_new->name == NULL) { free(basename); - LOG(("Could not allocate name for image.y")); + LOG("Could not allocate name for image.y"); goto dom_no_memory; } success_new->value = malloc(20); if (success_new->value == NULL) { free(basename); - LOG(("Could not allocate value for image.y")); + LOG("Could not allocate value for image.y"); goto dom_no_memory; } sprintf(success_new->name, "%s.y", basename); @@ -715,7 +715,7 @@ bool form_successful_controls_dom(struct form *_form, (dom_html_input_element *)form_element, &checked); if (err != DOM_NO_ERR) { - LOG(("Could not get input element checked")); + LOG("Could not get input element checked"); goto dom_no_memory; } if (!checked) @@ -724,7 +724,7 @@ bool form_successful_controls_dom(struct form *_form, (dom_html_input_element *)form_element, &inputvalue); if (err != DOM_NO_ERR) { - LOG(("Could not get input element value")); + LOG("Could not get input element value"); goto dom_no_memory; } if (inputvalue == NULL) { @@ -739,7 +739,7 @@ bool form_successful_controls_dom(struct form *_form, (dom_html_input_element *)form_element, &inputvalue); if (err != DOM_NO_ERR) { - LOG(("Could not get file value")); + LOG("Could not get file value"); goto dom_no_memory; } err = dom_node_get_user_data( @@ -747,14 +747,14 @@ bool form_successful_controls_dom(struct form *_form, corestring_dom___ns_key_file_name_node_data, &rawfile_temp); if (err != DOM_NO_ERR) { - LOG(("Could not get file rawname")); + LOG("Could not get file rawname"); goto dom_no_memory; } rawfile_temp = strdup(rawfile_temp != NULL ? rawfile_temp : ""); if (rawfile_temp == NULL) { - LOG(("Could not copy file rawname")); + LOG("Could not copy file rawname"); goto dom_no_memory; } /* Fall out to the allocation */ @@ -763,7 +763,7 @@ bool form_successful_controls_dom(struct form *_form, dom_string_caseless_isequal( inputtype, corestring_dom_button)) { /* Skip these */ - LOG(("Skipping RESET and BUTTON")); + LOG("Skipping RESET and BUTTON"); continue; } else { /* Everything else is treated as text values */ @@ -771,7 +771,7 @@ bool form_successful_controls_dom(struct form *_form, (dom_html_input_element *)form_element, &inputvalue); if (err != DOM_NO_ERR) { - LOG(("Could not get input value")); + LOG("Could not get input value"); goto dom_no_memory; } /* Fall out to the allocation */ @@ -780,7 +780,7 @@ bool form_successful_controls_dom(struct form *_form, success_new = calloc(1, sizeof(*success_new)); if (success_new == NULL) { - LOG(("Could not allocate data for generic")); + LOG("Could not allocate data for generic"); goto dom_no_memory; } @@ -789,12 +789,12 @@ bool form_successful_controls_dom(struct form *_form, success_new->name = ENCODE_ITEM(inputname); if (success_new->name == NULL) { - LOG(("Could not encode name for generic")); + LOG("Could not encode name for generic"); goto dom_no_memory; } success_new->value = ENCODE_ITEM(inputvalue); if (success_new->value == NULL) { - LOG(("Could not encode value for generic")); + LOG("Could not encode value for generic"); goto dom_no_memory; } if (rawfile_temp != NULL) { diff --git a/render/html.c b/render/html.c index e8692a0a7..47efb82bd 100644 --- a/render/html.c +++ b/render/html.c @@ -83,7 +83,7 @@ static void html_box_convert_done(html_content *c, bool success) dom_exception exc; /* returned by libdom functions */ dom_node *html; - LOG(("Done XML to box (%p)", c)); + LOG("Done XML to box (%p)", c); /* Clean up and report error if unsuccessful or aborted */ if ((success == false) || (c->aborted)) { @@ -113,7 +113,7 @@ static void html_box_convert_done(html_content *c, bool success) /** @todo should this call html_object_free_objects(c); * like the other error paths */ - LOG(("error retrieving html element from dom")); + LOG("error retrieving html element from dom"); content_broadcast_errorcode(&c->base, NSERROR_DOM); content_set_error(&c->base); return; @@ -122,7 +122,7 @@ static void html_box_convert_done(html_content *c, bool success) /* extract image maps - can't do this sensibly in dom_to_box */ err = imagemap_extract(c); if (err != NSERROR_OK) { - LOG(("imagemap extraction failed")); + LOG("imagemap extraction failed"); html_object_free_objects(c); content_broadcast_errorcode(&c->base, err); content_set_error(&c->base); @@ -571,14 +571,14 @@ void html_finish_conversion(html_content *htmlc) js_fire_event(htmlc->jscontext, "load", htmlc->document, NULL); /* convert dom tree to box tree */ - LOG(("DOM to box (%p)", htmlc)); + LOG("DOM to box (%p)", htmlc); content_set_status(&htmlc->base, messages_get("Processing")); msg_data.explicit_status_text = NULL; content_broadcast(&htmlc->base, CONTENT_MSG_STATUS, msg_data); exc = dom_document_get_document_element(htmlc->document, (void *) &html); if ((exc != DOM_NO_ERR) || (html == NULL)) { - LOG(("error retrieving html element from dom")); + LOG("error retrieving html element from dom"); content_broadcast_errorcode(&htmlc->base, NSERROR_DOM); content_set_error(&htmlc->base); return; @@ -586,7 +586,7 @@ void html_finish_conversion(html_content *htmlc) error = dom_to_box(html, htmlc, html_box_convert_done); if (error != NSERROR_OK) { - LOG(("box conversion failed")); + LOG("box conversion failed"); dom_node_unref(html); html_object_free_objects(htmlc); content_broadcast_errorcode(&htmlc->base, error); @@ -1023,11 +1023,11 @@ static bool html_convert(struct content *c) exc = dom_document_get_quirks_mode(htmlc->document, &htmlc->quirks); if (exc == DOM_NO_ERR) { html_css_quirks_stylesheets(htmlc); - LOG(("quirks set to %d", htmlc->quirks)); + LOG("quirks set to %d", htmlc->quirks); } htmlc->base.active--; /* the html fetch is no longer active */ - LOG(("%d fetches active", htmlc->base.active)); + LOG("%d fetches active", htmlc->base.active); /* The parse cannot be completed here because it may be paused * untill all the resources being fetched have completed. @@ -1080,11 +1080,11 @@ html_begin_conversion(html_content *htmlc) * complete to avoid repeating the completion pointlessly. */ if (htmlc->parse_completed == false) { - LOG(("Completing parse")); + LOG("Completing parse"); /* complete parsing */ error = dom_hubbub_parser_completed(htmlc->parser); if (error != DOM_HUBBUB_OK) { - LOG(("Parsing failed")); + LOG("Parsing failed"); content_broadcast_errorcode(&htmlc->base, libdom_hubbub_error_to_nserror(error)); @@ -1135,7 +1135,7 @@ html_begin_conversion(html_content *htmlc) /* locate root element and ensure it is html */ exc = dom_document_get_document_element(htmlc->document, (void *) &html); if ((exc != DOM_NO_ERR) || (html == NULL)) { - LOG(("error retrieving html element from dom")); + LOG("error retrieving html element from dom"); content_broadcast_errorcode(&htmlc->base, NSERROR_DOM); return false; } @@ -1145,7 +1145,7 @@ html_begin_conversion(html_content *htmlc) (node_name == NULL) || (!dom_string_caseless_lwc_isequal(node_name, corestring_lwc_html))) { - LOG(("root element not html")); + LOG("root element not html"); content_broadcast_errorcode(&htmlc->base, NSERROR_DOM); dom_node_unref(html); return false; @@ -1252,7 +1252,7 @@ static void html_stop(struct content *c) break; default: - LOG(("Unexpected status %d", c->status)); + LOG("Unexpected status %d", c->status); assert(0); } } @@ -1403,7 +1403,7 @@ static void html_destroy(struct content *c) html_content *html = (html_content *) c; struct form *f, *g; - LOG(("content %p", c)); + LOG("content %p", c); /* Destroy forms */ for (f = html->forms; f != NULL; f = g) { @@ -1801,7 +1801,7 @@ static void html__dom_user_data_handler(dom_node_operation operation, free(data); break; default: - LOG(("User data operation not handled.")); + LOG("User data operation not handled."); assert(0); } } @@ -1817,7 +1817,7 @@ static void html__set_file_gadget_filename(struct content *c, ret = guit->utf8->local_to_utf8(fn, 0, &utf8_fn); if (ret != NSERROR_OK) { assert(ret != NSERROR_BAD_ENCODING); - LOG(("utf8 to local encoding conversion failed")); + LOG("utf8 to local encoding conversion failed"); /* Load was for us - just no memory */ return; } @@ -1969,7 +1969,7 @@ static bool html_drop_file_at_point(struct content *c, int x, int y, char *file) if (ret != NSERROR_OK) { /* bad encoding shouldn't happen */ assert(ret != NSERROR_BAD_ENCODING); - LOG(("local to utf8 encoding failed")); + LOG("local to utf8 encoding failed"); free(buffer); warn_user("NoMemory", NULL); return true; @@ -2035,19 +2035,19 @@ html_debug_dump(struct content *c, FILE *f, enum content_debug op) ret = NSERROR_OK; } else { if (htmlc->document == NULL) { - LOG(("No document to dump")); + LOG("No document to dump"); return NSERROR_DOM; } exc = dom_document_get_document_element(htmlc->document, (void *) &html); if ((exc != DOM_NO_ERR) || (html == NULL)) { - LOG(("Unable to obtain root node")); + LOG("Unable to obtain root node"); return NSERROR_DOM; } ret = libdom_dump_structure(html, f, 0); - LOG(("DOM structure dump returning %d", ret)); + LOG("DOM structure dump returning %d", ret); dom_node_unref(html); } diff --git a/render/html_css.c b/render/html_css.c index 89ab4477c..91a1e64dc 100644 --- a/render/html_css.c +++ b/render/html_css.c @@ -101,20 +101,17 @@ html_convert_css_callback(hlcache_handle *css, switch (event->type) { case CONTENT_MSG_DONE: - LOG(("done stylesheet slot %d '%s'", i, - nsurl_access(hlcache_handle_get_url(css)))); + LOG("done stylesheet slot %d '%s'", i, nsurl_access(hlcache_handle_get_url(css))); parent->base.active--; - LOG(("%d fetches active", parent->base.active)); + LOG("%d fetches active", parent->base.active); break; case CONTENT_MSG_ERROR: - LOG(("stylesheet %s failed: %s", - nsurl_access(hlcache_handle_get_url(css)), - event->data.error)); + LOG("stylesheet %s failed: %s", nsurl_access(hlcache_handle_get_url(css)), event->data.error); hlcache_handle_release(css); s->sheet = NULL; parent->base.active--; - LOG(("%d fetches active", parent->base.active)); + LOG("%d fetches active", parent->base.active); content_add_error(&parent->base, "?", 0); break; @@ -165,7 +162,7 @@ html_stylesheet_from_domnode(html_content *c, exc = dom_node_get_text_content(node, &style); if ((exc != DOM_NO_ERR) || (style == NULL)) { - LOG(("No text content")); + LOG("No text content"); return NSERROR_OK; } @@ -196,7 +193,7 @@ html_stylesheet_from_domnode(html_content *c, nsurl_unref(url); c->base.active++; - LOG(("%d fetches active", c->base.active)); + LOG("%d fetches active", c->base.active); return NSERROR_OK; } @@ -267,13 +264,13 @@ static bool html_css_process_modified_style(html_content *c, error = html_stylesheet_from_domnode(c, s->node, &sheet); if (error != NSERROR_OK) { - LOG(("Failed to update sheet")); + LOG("Failed to update sheet"); content_broadcast_errorcode(&c->base, error); return false; } if (sheet != NULL) { - LOG(("Updating sheet %p with %p", s->sheet, sheet)); + LOG("Updating sheet %p with %p", s->sheet, sheet); if (s->sheet != NULL) { switch (content_get_status(s->sheet)) { @@ -282,7 +279,7 @@ static bool html_css_process_modified_style(html_content *c, default: hlcache_handle_abort(s->sheet); c->base.active--; - LOG(("%d fetches active", c->base.active)); + LOG("%d fetches active", c->base.active); } hlcache_handle_release(s->sheet); } @@ -327,8 +324,7 @@ bool html_css_update_style(html_content *c, dom_node *style) s = html_create_style_element(c, style); } if (s == NULL) { - LOG(("Could not find or create inline stylesheet for %p", - style)); + LOG("Could not find or create inline stylesheet for %p", style); return false; } @@ -401,8 +397,7 @@ bool html_css_process_link(html_content *htmlc, dom_node *node) } dom_string_unref(href); - LOG(("linked stylesheet %i '%s'", htmlc->stylesheet_count, - nsurl_access(joined))); + LOG("linked stylesheet %i '%s'", htmlc->stylesheet_count, nsurl_access(joined)); /* extend stylesheets array to allow for new sheet */ stylesheets = realloc(htmlc->stylesheets, @@ -436,7 +431,7 @@ bool html_css_process_link(html_content *htmlc, dom_node *node) htmlc->stylesheet_count++; htmlc->base.active++; - LOG(("%d fetches active", htmlc->base.active)); + LOG("%d fetches active", htmlc->base.active); return true; @@ -501,7 +496,7 @@ nserror html_css_quirks_stylesheets(html_content *c) } c->base.active++; - LOG(("%d fetches active", c->base.active)); + LOG("%d fetches active", c->base.active); } return ns_error; @@ -545,7 +540,7 @@ nserror html_css_new_stylesheets(html_content *c) } c->base.active++; - LOG(("%d fetches active", c->base.active)); + LOG("%d fetches active", c->base.active); if (nsoption_bool(block_advertisements)) { @@ -559,7 +554,7 @@ nserror html_css_new_stylesheets(html_content *c) } c->base.active++; - LOG(("%d fetches active", c->base.active)); + LOG("%d fetches active", c->base.active); } @@ -572,7 +567,7 @@ nserror html_css_new_stylesheets(html_content *c) } c->base.active++; - LOG(("%d fetches active", c->base.active)); + LOG("%d fetches active", c->base.active); return ns_error; } diff --git a/render/html_css_fetcher.c b/render/html_css_fetcher.c index 8ac9123b0..b676fedec 100644 --- a/render/html_css_fetcher.c +++ b/render/html_css_fetcher.c @@ -61,13 +61,13 @@ static html_css_fetcher_context *ring = NULL; static bool html_css_fetcher_initialise(lwc_string *scheme) { - LOG(("html_css_fetcher_initialise called for %s", lwc_string_data(scheme))); + LOG("html_css_fetcher_initialise called for %s", lwc_string_data(scheme)); return true; } static void html_css_fetcher_finalise(lwc_string *scheme) { - LOG(("html_css_fetcher_finalise called for %s", lwc_string_data(scheme))); + LOG("html_css_fetcher_finalise called for %s", lwc_string_data(scheme)); } static bool html_css_fetcher_can_fetch(const nsurl *url) @@ -251,8 +251,7 @@ static void html_css_fetcher_poll(lwc_string *scheme) html_css_fetcher_send_callback(&msg, c); } } else { - LOG(("Processing of %s failed!", - nsurl_access(c->url))); + LOG("Processing of %s failed!", nsurl_access(c->url)); /* Ensure that we're unlocked here. If we aren't, * then html_css_fetcher_process() is broken. @@ -291,7 +290,7 @@ nserror html_css_fetcher_register(void) if (lwc_intern_string("x-ns-css", SLEN("x-ns-css"), &scheme) != lwc_error_ok) { - LOG(("could not intern \"x-ns-css\".")); + LOG("could not intern \"x-ns-css\"."); return NSERROR_INIT_FAILED; } diff --git a/render/html_interaction.c b/render/html_interaction.c index c2cca60e2..6e2a2df4c 100644 --- a/render/html_interaction.c +++ b/render/html_interaction.c @@ -272,7 +272,7 @@ static void html__image_coords_dom_user_data_handler(dom_node_operation operatio free(coords); break; default: - LOG(("User data operation not handled.")); + LOG("User data operation not handled."); assert(0); } } diff --git a/render/html_object.c b/render/html_object.c index 455733d0a..335abd1fc 100644 --- a/render/html_object.c +++ b/render/html_object.c @@ -158,7 +158,7 @@ html_object_callback(hlcache_handle *object, case CONTENT_MSG_DONE: c->base.active--; - LOG(("%d fetches active", c->base.active)); + LOG("%d fetches active", c->base.active); html_object_done(box, object, o->background); @@ -188,7 +188,7 @@ html_object_callback(hlcache_handle *object, if (box != NULL) { c->base.active--; - LOG(("%d fetches active", c->base.active)); + LOG("%d fetches active", c->base.active); content_add_error(&c->base, "?", 0); html_object_failed(box, c, o->background); @@ -507,7 +507,7 @@ static bool html_replace_object(struct content_html_object *object, nsurl *url) /* remove existing object */ if (content_get_status(object->content) != CONTENT_STATUS_DONE) { c->base.active--; - LOG(("%d fetches active", c->base.active)); + LOG("%d fetches active", c->base.active); } hlcache_handle_release(object->content); @@ -528,7 +528,7 @@ static bool html_replace_object(struct content_html_object *object, nsurl *url) for (page = c; page != NULL; page = page->page) { page->base.active++; - LOG(("%d fetches active", c->base.active)); + LOG("%d fetches active", c->base.active); page->base.status = CONTENT_STATUS_READY; } @@ -611,7 +611,7 @@ nserror html_object_abort_objects(html_content *htmlc) object->content = NULL; htmlc->base.active--; - LOG(("%d fetches active", htmlc->base.active)); + LOG("%d fetches active", htmlc->base.active); break; } @@ -648,7 +648,7 @@ nserror html_object_free_objects(html_content *html) struct content_html_object *victim = html->object_list; if (victim->content != NULL) { - LOG(("object %p", victim->content)); + LOG("object %p", victim->content); if (content_get_type(victim->content) == CONTENT_HTML) { guit->browser->schedule(-1, html_object_refresh, victim); @@ -710,7 +710,7 @@ bool html_fetch_object(html_content *c, nsurl *url, struct box *box, c->num_objects++; if (box != NULL) { c->base.active++; - LOG(("%d fetches active", c->base.active)); + LOG("%d fetches active", c->base.active); } return true; diff --git a/render/html_script.c b/render/html_script.c index 2ebdffc12..07bee51c1 100644 --- a/render/html_script.c +++ b/render/html_script.c @@ -163,21 +163,18 @@ convert_script_async_cb(hlcache_handle *script, break; case CONTENT_MSG_DONE: - LOG(("script %d done '%s'", i, - nsurl_access(hlcache_handle_get_url(script)))); + LOG("script %d done '%s'", i, nsurl_access(hlcache_handle_get_url(script))); parent->base.active--; - LOG(("%d fetches active", parent->base.active)); + LOG("%d fetches active", parent->base.active); break; case CONTENT_MSG_ERROR: - LOG(("script %s failed: %s", - nsurl_access(hlcache_handle_get_url(script)), - event->data.error)); + LOG("script %s failed: %s", nsurl_access(hlcache_handle_get_url(script)), event->data.error); hlcache_handle_release(script); s->data.handle = NULL; parent->base.active--; - LOG(("%d fetches active", parent->base.active)); + LOG("%d fetches active", parent->base.active); content_add_error(&parent->base, "?", 0); break; @@ -212,21 +209,18 @@ convert_script_defer_cb(hlcache_handle *script, switch (event->type) { case CONTENT_MSG_DONE: - LOG(("script %d done '%s'", i, - nsurl_access(hlcache_handle_get_url(script)))); + LOG("script %d done '%s'", i, nsurl_access(hlcache_handle_get_url(script))); parent->base.active--; - LOG(("%d fetches active", parent->base.active)); + LOG("%d fetches active", parent->base.active); break; case CONTENT_MSG_ERROR: - LOG(("script %s failed: %s", - nsurl_access(hlcache_handle_get_url(script)), - event->data.error)); + LOG("script %s failed: %s", nsurl_access(hlcache_handle_get_url(script)), event->data.error); hlcache_handle_release(script); s->data.handle = NULL; parent->base.active--; - LOG(("%d fetches active", parent->base.active)); + LOG("%d fetches active", parent->base.active); content_add_error(&parent->base, "?", 0); break; @@ -269,10 +263,9 @@ convert_script_sync_cb(hlcache_handle *script, switch (event->type) { case CONTENT_MSG_DONE: - LOG(("script %d done '%s'", i, - nsurl_access(hlcache_handle_get_url(script)))); + LOG("script %d done '%s'", i, nsurl_access(hlcache_handle_get_url(script))); parent->base.active--; - LOG(("%d fetches active", parent->base.active)); + LOG("%d fetches active", parent->base.active); s->already_started = true; @@ -289,21 +282,19 @@ convert_script_sync_cb(hlcache_handle *script, /* continue parse */ err = dom_hubbub_parser_pause(parent->parser, false); if (err != DOM_HUBBUB_OK) { - LOG(("unpause returned 0x%x", err)); + LOG("unpause returned 0x%x", err); } break; case CONTENT_MSG_ERROR: - LOG(("script %s failed: %s", - nsurl_access(hlcache_handle_get_url(script)), - event->data.error)); + LOG("script %s failed: %s", nsurl_access(hlcache_handle_get_url(script)), event->data.error); hlcache_handle_release(script); s->data.handle = NULL; parent->base.active--; - LOG(("%d fetches active", parent->base.active)); + LOG("%d fetches active", parent->base.active); content_add_error(&parent->base, "?", 0); s->already_started = true; @@ -311,7 +302,7 @@ convert_script_sync_cb(hlcache_handle *script, /* continue parse */ err = dom_hubbub_parser_pause(parent->parser, false); if (err != DOM_HUBBUB_OK) { - LOG(("unpause returned 0x%x", err)); + LOG("unpause returned 0x%x", err); } break; @@ -359,7 +350,7 @@ exec_src_script(html_content *c, return DOM_HUBBUB_NOMEM; } - LOG(("script %i '%s'", c->scripts_count, nsurl_access(joined))); + LOG("script %i '%s'", c->scripts_count, nsurl_access(joined)); /* there are three ways to process the script tag at this point: * @@ -438,11 +429,11 @@ exec_src_script(html_content *c, */ /* mark duff script fetch as already started */ nscript->already_started = true; - LOG(("Fetch failed with error %d",ns_error)); + LOG("Fetch failed with error %d", ns_error); } else { /* update base content active fetch count */ c->base.active++; - LOG(("%d fetches active", c->base.active)); + LOG("%d fetches active", c->base.active); switch (script_type) { case HTML_SCRIPT_SYNC: @@ -524,14 +515,14 @@ html_process_script(void *ctx, dom_node *node) msg_data.jscontext = &c->jscontext; content_broadcast(&c->base, CONTENT_MSG_GETCTX, msg_data); - LOG(("javascript context %p ", c->jscontext)); + LOG("javascript context %p ", c->jscontext); if (c->jscontext == NULL) { /* no context and it could not be created, abort */ return DOM_HUBBUB_OK; } } - LOG(("content %p parser %p node %p", c, c->parser, node)); + LOG("content %p parser %p node %p", c, c->parser, node); exc = dom_element_get_attribute(node, corestring_dom_type, &mimetype); if (exc != DOM_NO_ERR || mimetype == NULL) { diff --git a/render/imagemap.c b/render/imagemap.c index 8f0fcd0a6..2e84bd0cf 100644 --- a/render/imagemap.c +++ b/render/imagemap.c @@ -241,32 +241,21 @@ void imagemap_dump(html_content *c) map = c->imagemaps[i]; while (map != NULL) { - LOG(("Imagemap: %s", map->key)); + LOG("Imagemap: %s", map->key); for (entry = map->list; entry; entry = entry->next) { switch (entry->type) { case IMAGEMAP_DEFAULT: - LOG(("\tDefault: %s", nsurl_access( - entry->url))); + LOG("\tDefault: %s", nsurl_access(entry->url)); break; case IMAGEMAP_RECT: - LOG(("\tRectangle: %s: [(%d,%d),(%d,%d)]", - nsurl_access(entry->url), - entry->bounds.rect.x0, - entry->bounds.rect.y0, - entry->bounds.rect.x1, - entry->bounds.rect.y1)); + LOG("\tRectangle: %s: [(%d,%d),(%d,%d)]", nsurl_access(entry->url), entry->bounds.rect.x0, entry->bounds.rect.y0, entry->bounds.rect.x1, entry->bounds.rect.y1); break; case IMAGEMAP_CIRCLE: - LOG(("\tCircle: %s: [(%d,%d),%d]", - nsurl_access(entry->url), - entry->bounds.circle.x, - entry->bounds.circle.y, - entry->bounds.circle.r)); + LOG("\tCircle: %s: [(%d,%d),%d]", nsurl_access(entry->url), entry->bounds.circle.x, entry->bounds.circle.y, entry->bounds.circle.r); break; case IMAGEMAP_POLY: - LOG(("\tPolygon: %s:", nsurl_access( - entry->url))); + LOG("\tPolygon: %s:", nsurl_access(entry->url)); for (j = 0; j != entry->bounds.poly.num; j++) { fprintf(stderr, "(%d,%d) ", diff --git a/render/layout.c b/render/layout.c index 9b479da17..4539867d0 100644 --- a/render/layout.c +++ b/render/layout.c @@ -475,7 +475,7 @@ bool layout_block_context(struct box *block, int viewport_height, } #ifdef LAYOUT_DEBUG - LOG(("box %p, cx %i, cy %i", box, cx, cy)); + LOG("box %p, cx %i, cy %i", box, cx, cy); #endif /* Layout (except tables). */ @@ -1021,8 +1021,7 @@ bool layout_block_object(struct box *block) assert(block->object); #ifdef LAYOUT_DEBUG - LOG(("block %p, object %s, width %i", block, - hlcache_handle_get_url(block->object), block->width)); + LOG("block %p, object %s, width %i", block, hlcache_handle_get_url(block->object), block->width); #endif if (content_get_type(block->object) == CONTENT_HTML) { @@ -2058,7 +2057,7 @@ void find_sides(struct box *fl, int y0, int y1, int fy0, fy1, fx0, fx1; #ifdef LAYOUT_DEBUG - LOG(("y0 %i, y1 %i, x0 %i, x1 %i", y0, y1, *x0, *x1)); + LOG("y0 %i, y1 %i, x0 %i, x1 %i", y0, y1, *x0, *x1); #endif *left = *right = 0; @@ -2083,7 +2082,7 @@ void find_sides(struct box *fl, int y0, int y1, } #ifdef LAYOUT_DEBUG - LOG(("x0 %i, x1 %i, left %p, right %p", *x0, *x1, *left, *right)); + LOG("x0 %i, x1 %i, left %p, right %p", *x0, *x1, *left, *right); #endif } @@ -2112,8 +2111,7 @@ bool layout_inline_container(struct box *inline_container, int width, assert(inline_container->type == BOX_INLINE_CONTAINER); #ifdef LAYOUT_DEBUG - LOG(("inline_container %p, width %i, cont %p, cx %i, cy %i", - inline_container, width, cont, cx, cy)); + LOG("inline_container %p, width %i, cont %p, cx %i, cy %i", inline_container, width, cont, cx, cy); #endif has_text_children = false; @@ -2143,7 +2141,7 @@ bool layout_inline_container(struct box *inline_container, int width, */ for (c = inline_container->children; c; ) { #ifdef LAYOUT_DEBUG - LOG(("c %p", c)); + LOG("c %p", c); #endif curwidth = inline_container->width; if (!layout_line(c, &curwidth, &y, cx, cy + y, cont, first_line, @@ -2309,12 +2307,8 @@ static bool layout_text_box_split(html_content *content, else c2->parent->last = c2; #ifdef LAYOUT_DEBUG - LOG(("split_box %p len: %u \"%.*s\"", - split_box, split_box->length, - split_box->length, split_box->text)); - LOG((" new_box %p len: %u \"%.*s\"", - c2, c2->length, - c2->length, c2->text)); + LOG("split_box %p len: %u \"%.*s\"", split_box, split_box->length, split_box->length, split_box->text); + LOG(" new_box %p len: %u \"%.*s\"", c2, c2->length, c2->length, c2->text); #endif return true; } @@ -2362,9 +2356,7 @@ bool layout_line(struct box *first, int *width, int *y, plot_font_style_t fstyle; #ifdef LAYOUT_DEBUG - LOG(("first %p, first->text '%.*s', width %i, y %i, cx %i, cy %i", - first, (int) first->length, first->text, *width, - *y, cx, cy)); + LOG("first %p, first->text '%.*s', width %i, y %i, cx %i, cy %i", first, (int)first->length, first->text, *width, *y, cx, cy); #endif /* find sides at top of line */ @@ -2395,7 +2387,7 @@ bool layout_line(struct box *first, int *width, int *y, * body executed at least once * keep in sync with the loop in layout_minmax_line() */ #ifdef LAYOUT_DEBUG - LOG(("x0 %i, x1 %i, x1 - x0 %i", x0, x1, x1 - x0)); + LOG("x0 %i, x1 %i, x1 - x0 %i", x0, x1, x1 - x0); #endif for (x = 0, b = first; x <= x1 - x0 && b != 0; b = b->next) { @@ -2408,7 +2400,7 @@ bool layout_line(struct box *first, int *width, int *y, b->type == BOX_INLINE_END); #ifdef LAYOUT_DEBUG - LOG(("pass 1: b %p, x %i", b, x)); + LOG("pass 1: b %p, x %i", b, x); #endif if (b->type == BOX_BR) @@ -2621,12 +2613,12 @@ bool layout_line(struct box *first, int *width, int *y, /* pass 2: place boxes in line: loop body executed at least once */ #ifdef LAYOUT_DEBUG - LOG(("x0 %i, x1 %i, x1 - x0 %i", x0, x1, x1 - x0)); + LOG("x0 %i, x1 %i, x1 - x0 %i", x0, x1, x1 - x0); #endif for (x = x_previous = 0, b = first; x <= x1 - x0 && b; b = b->next) { #ifdef LAYOUT_DEBUG - LOG(("pass 2: b %p, x %i", b, x)); + LOG("pass 2: b %p, x %i", b, x); #endif if (b->type == BOX_INLINE_BLOCK && @@ -2696,7 +2688,7 @@ bool layout_line(struct box *first, int *width, int *y, } else { /* float */ #ifdef LAYOUT_DEBUG - LOG(("float %p", b)); + LOG("float %p", b); #endif d = b->children; @@ -2707,8 +2699,7 @@ bool layout_line(struct box *first, int *width, int *y, return false; #ifdef LAYOUT_DEBUG - LOG(("%p : %d %d", d, d->margin[TOP], - d->border[TOP].width)); + LOG("%p : %d %d", d, d->margin[TOP], d->border[TOP].width); #endif d->x = d->margin[LEFT] + d->border[LEFT].width; @@ -2798,7 +2789,7 @@ bool layout_line(struct box *first, int *width, int *y, } if (cont->float_children == b) { #ifdef LAYOUT_DEBUG - LOG(("float %p already placed", b)); + LOG("float %p already placed", b); #endif box_dump(stderr, cont, 0, true); @@ -2842,11 +2833,7 @@ bool layout_line(struct box *first, int *width, int *y, w = split_box->width; #ifdef LAYOUT_DEBUG - LOG(("splitting: split_box %p \"%.*s\", spilt %zu, w %i, " - "left %p, right %p, inline_count %u", - split_box, (int) split_box->length, - split_box->text, split, w, - left, right, inline_count)); + LOG("splitting: split_box %p \"%.*s\", spilt %zu, w %i, ""left %p, right %p, inline_count %u", split_box, (int)split_box->length, split_box->text, split, w, left, right, inline_count); #endif if ((split == 0 || x1 - x0 <= x + space_before + w) && @@ -2866,7 +2853,7 @@ bool layout_line(struct box *first, int *width, int *y, } x += space_before + w; #ifdef LAYOUT_DEBUG - LOG(("forcing")); + LOG("forcing"); #endif } else if ((split == 0 || x1 - x0 <= x + space_before + w) && inline_count == 1) { @@ -2876,12 +2863,11 @@ bool layout_line(struct box *first, int *width, int *y, used_height = 0; if (left) { #ifdef LAYOUT_DEBUG - LOG(("cy %i, left->y %i, left->height %i", - cy, left->y, left->height)); + LOG("cy %i, left->y %i, left->height %i", cy, left->y, left->height); #endif used_height = left->y + left->height - cy + 1; #ifdef LAYOUT_DEBUG - LOG(("used_height %i", used_height)); + LOG("used_height %i", used_height); #endif } if (right && used_height < @@ -2893,21 +2879,20 @@ bool layout_line(struct box *first, int *width, int *y, b = split_box; #ifdef LAYOUT_DEBUG - LOG(("moving below float")); + LOG("moving below float"); #endif } else if (split == 0 || x1 - x0 <= x + space_before + w) { /* first word of box doesn't fit so leave box for next * line */ b = split_box; #ifdef LAYOUT_DEBUG - LOG(("leaving for next line")); + LOG("leaving for next line"); #endif } else { /* fit as many words as possible */ assert(split != 0); #ifdef LAYOUT_DEBUG - LOG(("'%.*s' %i %zu %i", (int) split_box->length, - split_box->text, x1 - x0, split, w)); + LOG("'%.*s' %i %zu %i", (int)split_box->length, split_box->text, x1 - x0, split, w); #endif if (split != split_box->length) { if (!layout_text_box_split(content, &fstyle, @@ -2917,7 +2902,7 @@ bool layout_line(struct box *first, int *width, int *y, } x += space_before + w; #ifdef LAYOUT_DEBUG - LOG(("fitting words")); + LOG("fitting words"); #endif } move_y = true; @@ -3095,7 +3080,7 @@ struct box *layout_minmax_line(struct box *first, b->type == BOX_INLINE_END); #ifdef LAYOUT_DEBUG - LOG(("%p: min %i, max %i", b, min, max)); + LOG("%p: min %i, max %i", b, min, max); #endif if (b->type == BOX_BR) { @@ -3342,7 +3327,7 @@ struct box *layout_minmax_line(struct box *first, *line_max = max; #ifdef LAYOUT_DEBUG - LOG(("line_min %i, line_max %i", min, max)); + LOG("line_min %i, line_max %i", min, max); #endif assert(b != first); @@ -3424,7 +3409,7 @@ void place_float_below(struct box *c, int width, int cx, int y, struct box *right; #ifdef LAYOUT_DEBUG - LOG(("c %p, width %i, cx %i, y %i, cont %p", c, width, cx, y, cont)); + LOG("c %p, width %i, cx %i, y %i, cont %p", c, width, cx, y, cont); #endif do { @@ -3653,11 +3638,13 @@ bool layout_table(struct box *table, int available_width, /* calculate width required by cells */ for (i = 0; i != columns; i++) { #ifdef LAYOUT_DEBUG - LOG(("table %p, column %u: type %s, width %i, min %i, max %i", - table, i, - ((const char *[]) {"UNKNOWN", "FIXED", "AUTO", - "PERCENT", "RELATIVE"})[col[i].type], - col[i].width, col[i].min, col[i].max)); + LOG("table %p, column %u: type %s, width %i, min %i, max %i", table, i, ((const char *[]){ + "UNKNOWN", + "FIXED", + "AUTO", + "PERCENT", + "RELATIVE" + })[col[i].type], col[i].width, col[i].min, col[i].max); #endif if (col[i].positioned) { @@ -3677,16 +3664,14 @@ bool layout_table(struct box *table, int available_width, required_width += col[i].min; #ifdef LAYOUT_DEBUG - LOG(("required_width %i", required_width)); + LOG("required_width %i", required_width); #endif } required_width += (columns + 1 - positioned_columns) * border_spacing_h; #ifdef LAYOUT_DEBUG - LOG(("width %i, min %i, max %i, auto %i, required %i", - table_width, table->min_width, table->max_width, - auto_width, required_width)); + LOG("width %i, min %i, max %i, auto %i, required %i", table_width, table->min_width, table->max_width, auto_width, required_width); #endif if (auto_width < required_width) { @@ -4503,7 +4488,7 @@ void layout_compute_relative_offset(struct box *box, int *x, int *y) } #ifdef LAYOUT_DEBUG - LOG(("left %i, right %i, top %i, bottom %i", left, right, top, bottom)); + LOG("left %i, right %i, top %i, bottom %i", left, right, top, bottom); #endif *x = left; @@ -4640,11 +4625,7 @@ bool layout_absolute(struct box *box, struct box *containing_block, /* 10.3.7 */ #ifdef LAYOUT_DEBUG - LOG(("%i + %i + %i + %i + %i + %i + %i + %i + %i = %i", - left, margin[LEFT], border[LEFT].width, - padding[LEFT], width, padding[RIGHT], - border[RIGHT].width, margin[RIGHT], right, - containing_block->width)); + LOG("%i + %i + %i + %i + %i + %i + %i + %i + %i = %i", left, margin[LEFT], border[LEFT].width, padding[LEFT], width, padding[RIGHT], border[RIGHT].width, margin[RIGHT], right, containing_block->width); #endif if (left == AUTO && width == AUTO && right == AUTO) { @@ -4809,11 +4790,7 @@ bool layout_absolute(struct box *box, struct box *containing_block, } #ifdef LAYOUT_DEBUG - LOG(("%i + %i + %i + %i + %i + %i + %i + %i + %i = %i", - left, margin[LEFT], border[LEFT].width, padding[LEFT], - width, padding[RIGHT], border[RIGHT].width, - margin[RIGHT], right, - containing_block->width)); + LOG("%i + %i + %i + %i + %i + %i + %i + %i + %i = %i", left, margin[LEFT], border[LEFT].width, padding[LEFT], width, padding[RIGHT], border[RIGHT].width, margin[RIGHT], right, containing_block->width); #endif box->x = left + margin[LEFT] + border[LEFT].width - cx; @@ -4847,11 +4824,7 @@ bool layout_absolute(struct box *box, struct box *containing_block, /* 10.6.4 */ #ifdef LAYOUT_DEBUG - LOG(("%i + %i + %i + %i + %i + %i + %i + %i + %i = %i", - top, margin[TOP], border[TOP].width, padding[TOP], - height, padding[BOTTOM], border[BOTTOM].width, - margin[BOTTOM], bottom, - containing_block->height)); + LOG("%i + %i + %i + %i + %i + %i + %i + %i + %i = %i", top, margin[TOP], border[TOP].width, padding[TOP], height, padding[BOTTOM], border[BOTTOM].width, margin[BOTTOM], bottom, containing_block->height); #endif if (top == AUTO && height == AUTO && bottom == AUTO) { @@ -4939,11 +4912,7 @@ bool layout_absolute(struct box *box, struct box *containing_block, } #ifdef LAYOUT_DEBUG - LOG(("%i + %i + %i + %i + %i + %i + %i + %i + %i = %i", - top, margin[TOP], border[TOP].width, padding[TOP], - height, padding[BOTTOM], border[BOTTOM].width, - margin[BOTTOM], bottom, - containing_block->height)); + LOG("%i + %i + %i + %i + %i + %i + %i + %i + %i = %i", top, margin[TOP], border[TOP].width, padding[TOP], height, padding[BOTTOM], border[BOTTOM].width, margin[BOTTOM], bottom, containing_block->height); #endif box->y = top + margin[TOP] + border[TOP].width - cy; diff --git a/render/table.c b/render/table.c index 22b5afd37..656386491 100644 --- a/render/table.c +++ b/render/table.c @@ -220,10 +220,13 @@ bool table_calculate_column_types(struct box *table) #ifdef TABLE_DEBUG for (i = 0; i != table->columns; i++) - LOG(("table %p, column %u: type %s, width %i", table, i, - ((const char *[]) {"UNKNOWN", "FIXED", "AUTO", - "PERCENT", "RELATIVE"})[col[i].type], - col[i].width)); + LOG("table %p, column %u: type %s, width %i", table, i, ((const char *[]){ + "UNKNOWN", + "FIXED", + "AUTO", + "PERCENT", + "RELATIVE" + })[col[i].type], col[i].width); #endif return true; diff --git a/render/textplain.c b/render/textplain.c index 72feea746..c9f83f9ac 100644 --- a/render/textplain.c +++ b/render/textplain.c @@ -467,7 +467,7 @@ void textplain_reformat(struct content *c, int width, int height) int character_width; size_t line_start; - LOG(("content %p w:%d h:%d",c, width, height)); + LOG("content %p w:%d h:%d", c, width, height); /* compute available columns (assuming monospaced font) - use 8 * characters for better accuracy */ @@ -557,7 +557,7 @@ void textplain_reformat(struct content *c, int width, int height) return; no_memory: - LOG(("out of memory (line_count %lu)", line_count)); + LOG("out of memory (line_count %lu)", line_count); return; } |