summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2015-05-28 16:08:46 +0100
committerVincent Sanders <vince@kyllikki.org>2015-05-28 16:08:46 +0100
commitc105738fa36bb2400adc47399c5b878d252d1c86 (patch)
tree138eeb449e1bf51ee1726b5f820740aada0ccd0b /desktop
parent20f2c86a511f7913cf858e7bd3668b0b59663ba0 (diff)
downloadnetsurf-c105738fa36bb2400adc47399c5b878d252d1c86.tar.gz
netsurf-c105738fa36bb2400adc47399c5b878d252d1c86.tar.bz2
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.
Diffstat (limited to 'desktop')
-rw-r--r--desktop/browser.c40
-rw-r--r--desktop/browser_history.c8
-rw-r--r--desktop/cookie_manager.c11
-rw-r--r--desktop/font_haru.c13
-rw-r--r--desktop/frames.c4
-rw-r--r--desktop/global_history.c14
-rw-r--r--desktop/hotlist.c24
-rw-r--r--desktop/knockout.c8
-rw-r--r--desktop/mouse.c16
-rw-r--r--desktop/netsurf.c34
-rw-r--r--desktop/print.c4
-rw-r--r--desktop/save_complete.c8
-rw-r--r--desktop/save_pdf.c38
-rw-r--r--desktop/save_text.c6
-rw-r--r--desktop/scrollbar.c2
-rw-r--r--desktop/searchweb.c14
-rw-r--r--desktop/sslcert_viewer.c8
-rw-r--r--desktop/textarea.c28
-rw-r--r--desktop/tree.c2
-rw-r--r--desktop/treeview.c14
20 files changed, 128 insertions, 168 deletions
diff --git a/desktop/browser.c b/desktop/browser.c
index abda8853a..2d7257bd4 100644
--- a/desktop/browser.c
+++ b/desktop/browser.c
@@ -129,7 +129,7 @@ bool browser_window_redraw(struct browser_window *bw, int x, int y,
struct rect content_clip;
if (bw == NULL) {
- LOG(("NULL browser window"));
+ LOG("NULL browser window");
return false;
}
@@ -286,7 +286,7 @@ bool browser_window_redraw(struct browser_window *bw, int x, int y,
bool browser_window_redraw_ready(struct browser_window *bw)
{
if (bw == NULL) {
- LOG(("NULL browser window"));
+ LOG("NULL browser window");
return false;
} else if (bw->current_content != NULL) {
/* Can't render locked contents */
@@ -359,7 +359,7 @@ void browser_window_set_position(struct browser_window *bw, int x, int y)
bw->x = x;
bw->y = y;
} else {
- LOG(("Asked to set position of front end window."));
+ LOG("Asked to set position of front end window.");
assert(0);
}
}
@@ -756,7 +756,7 @@ nserror browser_window_debug(struct browser_window *bw, enum content_debug op)
static bool slow_script(void *ctx)
{
static int count = 0;
- LOG(("Continuing execution %d", count));
+ LOG("Continuing execution %d", count);
count++;
if (count > 1) {
count = 0;
@@ -924,11 +924,11 @@ browser_window_download(struct browser_window *bw,
/* no internal handler for this type, call out to frontend */
error = guit->browser->launch_url(url);
} else if (error != NSERROR_OK) {
- LOG(("Failed to fetch download: %d", error));
+ LOG("Failed to fetch download: %d", error);
} else {
error = download_context_create(l, root->window);
if (error != NSERROR_OK) {
- LOG(("Failed creating download context: %d", error));
+ LOG("Failed creating download context: %d", error);
llcache_handle_abort(l);
llcache_handle_release(l);
}
@@ -1048,7 +1048,7 @@ static nserror browser_window_favicon_callback(hlcache_handle *c,
error = nsurl_create("resource:favicon.ico", &nsurl);
if (error != NSERROR_OK) {
- LOG(("Unable to create default location url"));
+ LOG("Unable to create default location url");
} else {
hlcache_handle_retrieve(nsurl,
@@ -1129,7 +1129,7 @@ static void browser_window_update_favicon(hlcache_handle *c,
error = nsurl_create("resource:favicon.ico", &nsurl);
}
if (error != NSERROR_OK) {
- LOG(("Unable to create default location url"));
+ LOG("Unable to create default location url");
return;
}
} else {
@@ -1137,12 +1137,9 @@ static void browser_window_update_favicon(hlcache_handle *c,
}
if (link == NULL) {
- LOG(("fetching general favicon from '%s'",
- nsurl_access(nsurl)));
+ LOG("fetching general favicon from '%s'", nsurl_access(nsurl));
} else {
- LOG(("fetching favicon rel:%s '%s'",
- lwc_string_data(link->rel),
- nsurl_access(nsurl)));
+ LOG("fetching favicon rel:%s '%s'", lwc_string_data(link->rel), nsurl_access(nsurl));
}
hlcache_handle_retrieve(nsurl, HLCACHE_RETRIEVE_SNIFF_TYPE,
@@ -1710,7 +1707,7 @@ static void browser_window_destroy_internal(struct browser_window *bw)
{
assert(bw);
- LOG(("Destroying window"));
+ LOG("Destroying window");
if (bw->children != NULL || bw->iframes != NULL) {
browser_window_destroy_children(bw);
@@ -1721,7 +1718,7 @@ static void browser_window_destroy_internal(struct browser_window *bw)
/* The ugly cast here is so the reformat function can be
* passed a gui window pointer in its API rather than void*
*/
- LOG(("Clearing schedule %p(%p)", guit->window->reformat, bw->window));
+ LOG("Clearing schedule %p(%p)", guit->window->reformat, bw->window);
guit->browser->schedule(-1, (void(*)(void*))guit->window->reformat, bw->window);
/* If this brower window is not the root window, and has focus, unset
@@ -1799,8 +1796,7 @@ static void browser_window_destroy_internal(struct browser_window *bw)
free(bw->name);
free(bw->status_text);
bw->status_text = NULL;
- LOG(("Status text cache match:miss %d:%d",
- bw->status_match, bw->status_miss));
+ LOG("Status text cache match:miss %d:%d", bw->status_match, bw->status_miss);
}
/**
@@ -1892,14 +1888,14 @@ nserror browser_window_navigate(struct browser_window *bw,
assert(bw);
assert(url);
- LOG(("bw %p, url %s", bw, nsurl_access(url)));
+ LOG("bw %p, url %s", bw, nsurl_access(url));
/* don't allow massively nested framesets */
for (cur = bw; cur->parent; cur = cur->parent) {
depth++;
}
if (depth > FRAME_DEPTH) {
- LOG(("frame depth too high."));
+ LOG("frame depth too high.");
return NSERROR_FRAME_DEPTH;
}
@@ -1991,7 +1987,7 @@ nserror browser_window_navigate(struct browser_window *bw,
browser_window_remove_caret(bw, false);
browser_window_destroy_children(bw);
- LOG(("Loading '%s'", nsurl_access(url)));
+ LOG("Loading '%s'", nsurl_access(url));
browser_window_set_status(bw, messages_get("Loading"));
bw->history_add = (flags & BW_NAVIGATE_HISTORY);
@@ -2207,7 +2203,7 @@ void browser_window_set_dimensions(struct browser_window *bw,
bw->width = width;
bw->height = height;
} else {
- LOG(("Asked to set dimensions of front end window."));
+ LOG("Asked to set dimensions of front end window.");
assert(0);
}
}
@@ -2484,7 +2480,7 @@ nserror browser_window_schedule_reformat(struct browser_window *bw)
/* The ugly cast here is so the reformat function can be
* passed a gui window pointer in its API rather than void*
*/
- LOG(("Scheduleing %p(%p)", guit->window->reformat, bw->window));
+ LOG("Scheduleing %p(%p)", guit->window->reformat, bw->window);
guit->browser->schedule(0, (void(*)(void*))guit->window->reformat, bw->window);
return NSERROR_OK;
}
diff --git a/desktop/browser_history.c b/desktop/browser_history.c
index 95f85bb6c..1ee800019 100644
--- a/desktop/browser_history.c
+++ b/desktop/browser_history.c
@@ -451,7 +451,7 @@ nserror browser_window_history_clone(const struct browser_window *existing,
new_history->start = browser_window_history__clone_entry(new_history,
new_history->start);
if (!new_history->start) {
- LOG(("Insufficient memory to clone history"));
+ LOG("Insufficient memory to clone history");
browser_window_history_destroy(clone);
clone->history = NULL;
return NSERROR_NOMEM;
@@ -516,7 +516,7 @@ nserror browser_window_history_add(struct browser_window *bw,
* loading */
bitmap = urldb_get_thumbnail(nsurl);
if (bitmap == NULL) {
- LOG(("Creating thumbnail for %s", nsurl_access(nsurl)));
+ LOG("Creating thumbnail for %s", nsurl_access(nsurl));
bitmap = guit->bitmap->create(WIDTH, HEIGHT,
BITMAP_NEW | BITMAP_CLEAR_MEMORY |
BITMAP_OPAQUE);
@@ -531,7 +531,7 @@ nserror browser_window_history_add(struct browser_window *bw,
/* Thumbnailing failed. Ignore it
* silently but clean up bitmap.
*/
- LOG(("Thumbnail renderfailed"));
+ LOG("Thumbnail renderfailed");
guit->bitmap->destroy(bitmap);
bitmap = NULL;
}
@@ -700,7 +700,7 @@ bool browser_window_history_redraw(struct browser_window *bw,
history = bw->history;
if (history == NULL) {
- LOG(("Attempt to draw NULL history."));
+ LOG("Attempt to draw NULL history.");
return false;
}
diff --git a/desktop/cookie_manager.c b/desktop/cookie_manager.c
index c0ca16128..6731e8edb 100644
--- a/desktop/cookie_manager.c
+++ b/desktop/cookie_manager.c
@@ -695,8 +695,7 @@ static void cookie_manager_delete_entry(struct cookie_manager_entry *e)
urldb_delete_cookie(domain, path, name);
} else {
- LOG(("Delete cookie fail: "
- "need domain, path, and name."));
+ LOG("Delete cookie fail: ""need domain, path, and name.");
}
}
@@ -757,7 +756,7 @@ nserror cookie_manager_init(struct core_window_callback_table *cw_t,
{
nserror err;
- LOG(("Generating cookie manager data"));
+ LOG("Generating cookie manager data");
/* Init. cookie manager treeview entry fields */
err = cookie_manager_init_entry_fields();
@@ -794,7 +793,7 @@ nserror cookie_manager_init(struct core_window_callback_table *cw_t,
/* Inform client of window height */
treeview_get_height(cm_ctx.tree);
- LOG(("Generated cookie manager data"));
+ LOG("Generated cookie manager data");
return NSERROR_OK;
}
@@ -806,7 +805,7 @@ nserror cookie_manager_fini(void)
int i;
nserror err;
- LOG(("Finalising cookie manager"));
+ LOG("Finalising cookie manager");
cm_ctx.built = false;
@@ -823,7 +822,7 @@ nserror cookie_manager_fini(void)
if (cm_ctx.values[i].value != NULL)
free((void *) cm_ctx.values[i].value);
- LOG(("Finalised cookie manager"));
+ LOG("Finalised cookie manager");
return err;
}
diff --git a/desktop/font_haru.c b/desktop/font_haru.c
index aaee84c35..d2d7efdaf 100644
--- a/desktop/font_haru.c
+++ b/desktop/font_haru.c
@@ -77,8 +77,7 @@ const struct font_functions haru_nsfont = {
static void error_handler(HPDF_STATUS error_no, HPDF_STATUS detail_no,
void *user_data)
{
- LOG(("ERROR: in font_haru \n\terror_no=%x\n\tdetail_no=%d\n",
- (HPDF_UINT)error_no, (HPDF_UINT)detail_no));
+ LOG("ERROR: in font_haru \n\terror_no=%x\n\tdetail_no=%d\n", (HPDF_UINT)error_no, (HPDF_UINT)detail_no);
#ifdef FONT_HARU_DEBUG
exit(1);
#endif
@@ -147,7 +146,7 @@ bool haru_nsfont_width(const plot_font_style_t *fstyle,
*width = width_real;
#ifdef FONT_HARU_DEBUG
- LOG(("Measuring string: %s ; Calculated width: %f %i",string_nt, width_real, *width));
+ LOG("Measuring string: %s ; Calculated width: %f %i", string_nt, width_real, *width);
#endif
free(string_nt);
HPDF_Free(pdf);
@@ -205,8 +204,7 @@ bool haru_nsfont_position_in_string(const plot_font_style_t *fstyle,
*actual_x = real_width;
#ifdef FONT_HARU_DEBUG
- LOG(("Position in string: %s at x: %i; Calculated position: %i",
- string_nt, x, *char_offset));
+ LOG("Position in string: %s at x: %i; Calculated position: %i", string_nt, x, *char_offset);
#endif
free(string_nt);
HPDF_Free(pdf);
@@ -251,8 +249,7 @@ bool haru_nsfont_split(const plot_font_style_t *fstyle,
HPDF_TRUE, &real_width);
#ifdef FONT_HARU_DEBUG
- LOG(("Splitting string: %s for width: %i ; Calculated position: %i Calculated real_width: %f",
- string_nt, x, *char_offset, real_width));
+ LOG("Splitting string: %s for width: %i ; Calculated position: %i Calculated real_width: %f", string_nt, x, *char_offset, real_width);
#endif
*char_offset = offset - 1;
@@ -333,7 +330,7 @@ bool haru_nsfont_apply_style(const plot_font_style_t *fstyle,
strcat(font_name, "-Roman");
#ifdef FONT_HARU_DEBUG
- LOG(("Setting font: %s", font_name));
+ LOG("Setting font: %s", font_name);
#endif
size = fstyle->size;
diff --git a/desktop/frames.c b/desktop/frames.c
index 934217761..253e84225 100644
--- a/desktop/frames.c
+++ b/desktop/frames.c
@@ -354,9 +354,9 @@ void browser_window_create_frameset(struct browser_window *bw,
window->parent = bw;
if (window->name)
- LOG(("Created frame '%s'", window->name));
+ LOG("Created frame '%s'", window->name);
else
- LOG(("Created frame (unnamed)"));
+ LOG("Created frame (unnamed)");
}
}
diff --git a/desktop/global_history.c b/desktop/global_history.c
index 2cb0c91a6..9fa1d6de7 100644
--- a/desktop/global_history.c
+++ b/desktop/global_history.c
@@ -594,7 +594,7 @@ static nserror global_history_initialise_time(void)
/* get the current time */
t = time(NULL);
if (t == -1) {
- LOG(("time info unaviable"));
+ LOG("time info unaviable");
return NSERROR_UNKNOWN;
}
@@ -605,7 +605,7 @@ static nserror global_history_initialise_time(void)
full_time->tm_hour = 0;
t = mktime(full_time);
if (t == -1) {
- LOG(("mktime failed"));
+ LOG("mktime failed");
return NSERROR_UNKNOWN;
}
@@ -722,7 +722,7 @@ nserror global_history_init(struct core_window_callback_table *cw_t,
{
nserror err;
- LOG(("Loading global history"));
+ LOG("Loading global history");
/* Init. global history treeview time */
err = global_history_initialise_time();
@@ -778,7 +778,7 @@ nserror global_history_init(struct core_window_callback_table *cw_t,
/* Inform client of window height */
treeview_get_height(gh_ctx.tree);
- LOG(("Loaded global history"));
+ LOG("Loaded global history");
return NSERROR_OK;
}
@@ -790,7 +790,7 @@ nserror global_history_fini(void)
int i;
nserror err;
- LOG(("Finalising global history"));
+ LOG("Finalising global history");
gh_ctx.built = false;
@@ -802,7 +802,7 @@ nserror global_history_fini(void)
if (gh_ctx.fields[i].field != NULL)
lwc_string_unref(gh_ctx.fields[i].field);
- LOG(("Finalised global history"));
+ LOG("Finalised global history");
return err;
}
@@ -819,7 +819,7 @@ nserror global_history_add(nsurl *url)
data = urldb_get_url_data(url);
if (data == NULL) {
- LOG(("Can't add URL to history that's not present in urldb."));
+ LOG("Can't add URL to history that's not present in urldb.");
return NSERROR_BAD_PARAMETER;
}
diff --git a/desktop/hotlist.c b/desktop/hotlist.c
index 8f76c62a3..e6e11e4ba 100644
--- a/desktop/hotlist.c
+++ b/desktop/hotlist.c
@@ -534,20 +534,20 @@ static nserror hotlist_load_entry(dom_node *li, hotlist_load_ctx *ctx)
/* The li must contain an "a" element */
a = libdom_find_first_element(li, corestring_lwc_a);
if (a == NULL) {
- LOG(("Missing <a> in <li>"));
+ LOG("Missing <a> in <li>");
return NSERROR_INVALID;
}
derror = dom_node_get_text_content(a, &title1);
if (derror != DOM_NO_ERR) {
- LOG(("No title"));
+ LOG("No title");
dom_node_unref(a);
return NSERROR_INVALID;
}
derror = dom_element_get_attribute(a, corestring_dom_href, &url1);
if (derror != DOM_NO_ERR || url1 == NULL) {
- LOG(("No URL"));
+ LOG("No URL");
dom_string_unref(title1);
dom_node_unref(a);
return NSERROR_INVALID;
@@ -565,7 +565,7 @@ static nserror hotlist_load_entry(dom_node *li, hotlist_load_ctx *ctx)
dom_string_unref(url1);
if (err != NSERROR_OK) {
- LOG(("Failed normalising '%s'", dom_string_data(url1)));
+ LOG("Failed normalising '%s'", dom_string_data(url1));
if (title1 != NULL) {
dom_string_unref(title1);
@@ -645,7 +645,7 @@ nserror hotlist_load_directory_cb(dom_node *node, void *ctx)
error = dom_node_get_text_content(node, &title);
if (error != DOM_NO_ERR || title == NULL) {
- LOG(("Empty <h4> or memory exhausted."));
+ LOG("Empty <h4> or memory exhausted.");
dom_string_unref(name);
return NSERROR_DOM;
}
@@ -773,7 +773,7 @@ static nserror hotlist_load(const char *path, bool *loaded)
/* Handle no path */
if (path == NULL) {
- LOG(("No hotlist file path provided."));
+ LOG("No hotlist file path provided.");
return NSERROR_OK;
}
@@ -942,7 +942,7 @@ static nserror hotlist_save(const char *path)
/* Replace any old hotlist file with the one we just saved */
if (rename(temp_path, path) != 0) {
res = NSERROR_SAVE_FAILED;
- LOG(("Error renaming hotlist: %s.", strerror(errno)));
+ LOG("Error renaming hotlist: %s.", strerror(errno));
goto cleanup;
}
@@ -1228,7 +1228,7 @@ nserror hotlist_init(struct core_window_callback_table *cw_t,
{
nserror err;
- LOG(("Loading hotlist"));
+ LOG("Loading hotlist");
hl_ctx.tree = NULL;
hl_ctx.built = false;
@@ -1265,7 +1265,7 @@ nserror hotlist_init(struct core_window_callback_table *cw_t,
/* Inform client of window height */
treeview_get_height(hl_ctx.tree);
- LOG(("Loaded hotlist"));
+ LOG("Loaded hotlist");
return NSERROR_OK;
}
@@ -1277,12 +1277,12 @@ nserror hotlist_fini(const char *path)
int i;
nserror err;
- LOG(("Finalising hotlist"));
+ LOG("Finalising hotlist");
/* Save the hotlist */
err = hotlist_save(path);
if (err != NSERROR_OK) {
- LOG(("Problem saving the hotlist.", 0));
+ LOG("Problem saving the hotlist.");
}
/* Destroy the hotlist treeview */
@@ -1294,7 +1294,7 @@ nserror hotlist_fini(const char *path)
if (hl_ctx.fields[i].field != NULL)
lwc_string_unref(hl_ctx.fields[i].field);
- LOG(("Finalised hotlist"));
+ LOG("Finalised hotlist");
return err;
}
diff --git a/desktop/knockout.c b/desktop/knockout.c
index 303ba8f6c..b2139986a 100644
--- a/desktop/knockout.c
+++ b/desktop/knockout.c
@@ -291,10 +291,7 @@ bool knockout_plot_flush(void)
/* debugging information */
#ifdef KNOCKOUT_DEBUG
- LOG(("Entries are %i/%i, %i/%i, %i/%i",
- knockout_entry_cur, KNOCKOUT_ENTRIES,
- knockout_box_cur, KNOCKOUT_BOXES,
- knockout_polygon_cur, KNOCKOUT_POLYGONS));
+ LOG("Entries are %i/%i, %i/%i, %i/%i", knockout_entry_cur, KNOCKOUT_ENTRIES, knockout_box_cur, KNOCKOUT_BOXES, knockout_polygon_cur, KNOCKOUT_POLYGONS);
#endif
for (i = 0; i < knockout_entry_cur; i++) {
@@ -686,8 +683,7 @@ bool knockout_plot_clip(const struct rect *clip)
{
if (clip->x1 < clip->x0 || clip->y0 > clip->y1) {
#ifdef KNOCKOUT_DEBUG
- LOG(("bad clip rectangle %i %i %i %i",
- clip->x0, clip->y0, clip->x1, clip->y1));
+ LOG("bad clip rectangle %i %i %i %i", clip->x0, clip->y0, clip->x1, clip->y1);
#endif
return false;
}
diff --git a/desktop/mouse.c b/desktop/mouse.c
index c156af86d..ea627ac82 100644
--- a/desktop/mouse.c
+++ b/desktop/mouse.c
@@ -30,19 +30,5 @@
*/
void browser_mouse_state_dump(browser_mouse_state mouse)
{
- LOG(("mouse state: %s %s %s %s %s %s %s %s %s %s %s %s %s %s",
- mouse & BROWSER_MOUSE_PRESS_1 ? "P1" : " ",
- mouse & BROWSER_MOUSE_PRESS_2 ? "P2" : " ",
- mouse & BROWSER_MOUSE_CLICK_1 ? "C1" : " ",
- mouse & BROWSER_MOUSE_CLICK_2 ? "C2" : " ",
- mouse & BROWSER_MOUSE_DOUBLE_CLICK ? "DC" : " ",
- mouse & BROWSER_MOUSE_TRIPLE_CLICK ? "TC" : " ",
- mouse & BROWSER_MOUSE_DRAG_1 ? "D1" : " ",
- mouse & BROWSER_MOUSE_DRAG_2 ? "D2" : " ",
- mouse & BROWSER_MOUSE_DRAG_ON ? "DO" : " ",
- mouse & BROWSER_MOUSE_HOLDING_1 ? "H1" : " ",
- mouse & BROWSER_MOUSE_HOLDING_2 ? "H2" : " ",
- mouse & BROWSER_MOUSE_MOD_1 ? "M1" : " ",
- mouse & BROWSER_MOUSE_MOD_2 ? "M2" : " ",
- mouse & BROWSER_MOUSE_MOD_3 ? "M3" : " "));
+ LOG("mouse state: %s %s %s %s %s %s %s %s %s %s %s %s %s %s", mouse & BROWSER_MOUSE_PRESS_1 ? "P1" : " ", mouse & BROWSER_MOUSE_PRESS_2 ? "P2" : " ", mouse & BROWSER_MOUSE_CLICK_1 ? "C1" : " ", mouse & BROWSER_MOUSE_CLICK_2 ? "C2" : " ", mouse & BROWSER_MOUSE_DOUBLE_CLICK ? "DC" : " ", mouse & BROWSER_MOUSE_TRIPLE_CLICK ? "TC" : " ", mouse & BROWSER_MOUSE_DRAG_1 ? "D1" : " ", mouse & BROWSER_MOUSE_DRAG_2 ? "D2" : " ", mouse & BROWSER_MOUSE_DRAG_ON ? "DO" : " ", mouse & BROWSER_MOUSE_HOLDING_1 ? "H1" : " ", mouse & BROWSER_MOUSE_HOLDING_2 ? "H2" : " ", mouse & BROWSER_MOUSE_MOD_1 ? "M1" : " ", mouse & BROWSER_MOUSE_MOD_2 ? "M2" : " ", mouse & BROWSER_MOUSE_MOD_3 ? "M3" : " ");
}
diff --git a/desktop/netsurf.c b/desktop/netsurf.c
index cca80232b..5702ebe93 100644
--- a/desktop/netsurf.c
+++ b/desktop/netsurf.c
@@ -91,7 +91,7 @@
static void netsurf_lwc_iterator(lwc_string *str, void *pw)
{
- LOG(("[%3u] %.*s", str->refcnt, (int) lwc_string_length(str), lwc_string_data(str)));
+ LOG("[%3u] %.*s", str->refcnt, (int)lwc_string_length(str), lwc_string_data(str));
}
/**
@@ -154,14 +154,11 @@ nserror netsurf_init(const char *messages, const char *store_path)
signal(SIGPIPE, SIG_IGN);
#endif
- LOG(("NetSurf version '%s'", netsurf_version));
+ LOG("NetSurf version '%s'", netsurf_version);
if (uname(&utsname) < 0)
- LOG(("Failed to extract machine information"));
+ LOG("Failed to extract machine information");
else
- LOG(("NetSurf on <%s>, node <%s>, release <%s>, version <%s>, "
- "machine <%s>", utsname.sysname,
- utsname.nodename, utsname.release,
- utsname.version, utsname.machine));
+ LOG("NetSurf on <%s>, node <%s>, release <%s>, version <%s>, ""machine <%s>", utsname.sysname, utsname.nodename, utsname.release, utsname.version, utsname.machine);
messages_load(messages);
@@ -175,8 +172,7 @@ nserror netsurf_init(const char *messages, const char *store_path)
if (hlcache_parameters.llcache.limit < MINIMUM_MEMORY_CACHE_SIZE) {
hlcache_parameters.llcache.limit = MINIMUM_MEMORY_CACHE_SIZE;
- LOG(("Setting minimum memory cache size %d",
- hlcache_parameters.llcache.limit));
+ LOG("Setting minimum memory cache size %zd", hlcache_parameters.llcache.limit);
}
/* image cache is 25% of total memory cache size */
@@ -255,19 +251,19 @@ void netsurf_exit(void)
{
hlcache_stop();
- LOG(("Closing GUI"));
+ LOG("Closing GUI");
guit->browser->quit();
- LOG(("Finalising JavaScript"));
+ LOG("Finalising JavaScript");
js_finalise();
- LOG(("Finalising Web Search"));
+ LOG("Finalising Web Search");
search_web_finalise();
- LOG(("Finalising high-level cache"));
+ LOG("Finalising high-level cache");
hlcache_finalise();
- LOG(("Closing fetches"));
+ LOG("Closing fetches");
fetcher_quit();
mimesniff_fini();
@@ -278,18 +274,18 @@ void netsurf_exit(void)
/* Clean up after content handlers */
content_factory_fini();
- LOG(("Closing utf8"));
+ LOG("Closing utf8");
utf8_finalise();
- LOG(("Destroying URLdb"));
+ LOG("Destroying URLdb");
urldb_destroy();
- LOG(("Destroying System colours"));
+ LOG("Destroying System colours");
ns_system_colour_finalize();
corestrings_fini();
- LOG(("Remaining lwc strings:"));
+ LOG("Remaining lwc strings:");
lwc_iterate_strings(netsurf_lwc_iterator, NULL);
- LOG(("Exited successfully"));
+ LOG("Exited successfully");
}
diff --git a/desktop/print.c b/desktop/print.c
index 1f77c8ba4..f3a1a69f9 100644
--- a/desktop/print.c
+++ b/desktop/print.c
@@ -205,9 +205,7 @@ bool print_apply_settings(hlcache_handle *content,
content_reformat(content, false, page_content_width, 0);
- LOG(("New layout applied.New height = %d ; New width = %d ",
- content_get_height(content),
- content_get_width(content)));
+ LOG("New layout applied.New height = %d ; New width = %d ", content_get_height(content), content_get_width(content));
return true;
}
diff --git a/desktop/save_complete.c b/desktop/save_complete.c
index 64c769f58..58c1d210a 100644
--- a/desktop/save_complete.c
+++ b/desktop/save_complete.c
@@ -157,7 +157,7 @@ static bool save_complete_save_buffer(save_complete_ctx *ctx,
fp = fopen(fname, "wb");
if (fp == NULL) {
free(fname);
- LOG(("fopen(): errno = %i", errno));
+ LOG("fopen(): errno = %i", errno);
warn_user("SaveError", strerror(errno));
return false;
}
@@ -1032,7 +1032,7 @@ static bool save_complete_node_handler(dom_node *node,
} else if (type == DOM_DOCUMENT_NODE) {
/* Do nothing */
} else {
- LOG(("Unhandled node type: %d", type));
+ LOG("Unhandled node type: %d", type);
}
return true;
@@ -1063,7 +1063,7 @@ static bool save_complete_save_html_document(save_complete_ctx *ctx,
fp = fopen(fname, "wb");
if (fp == NULL) {
free(fname);
- LOG(("fopen(): errno = %i", errno));
+ LOG("fopen(): errno = %i", errno);
warn_user("SaveError", strerror(errno));
return false;
}
@@ -1142,7 +1142,7 @@ static bool save_complete_inventory(save_complete_ctx *ctx)
fp = fopen(fname, "w");
free(fname);
if (fp == NULL) {
- LOG(("fopen(): errno = %i", errno));
+ LOG("fopen(): errno = %i", errno);
warn_user("SaveError", strerror(errno));
return false;
}
diff --git a/desktop/save_pdf.c b/desktop/save_pdf.c
index e3f9cbc34..aeec9ce2e 100644
--- a/desktop/save_pdf.c
+++ b/desktop/save_pdf.c
@@ -170,7 +170,7 @@ bool pdf_plot_rectangle(int x0, int y0, int x1, int y1, const plot_style_t *psty
{
DashPattern_e dash;
#ifdef PDF_DEBUG
- LOG(("%d %d %d %d %f %X", x0, y0, x1, y1, page_height - y0, pstyle->fill_colour));
+ LOG("%d %d %d %d %f %X", x0, y0, x1, y1, page_height - y0, pstyle->fill_colour);
#endif
if (pstyle->fill_type != PLOT_OP_TYPE_NONE) {
@@ -261,7 +261,7 @@ bool pdf_plot_polygon(const int *p, unsigned int n, const plot_style_t *style)
#ifdef PDF_DEBUG
int pmaxx = p[0], pmaxy = p[1];
int pminx = p[0], pminy = p[1];
- LOG(("."));
+ LOG(".");
#endif
if (n == 0)
return true;
@@ -280,7 +280,7 @@ bool pdf_plot_polygon(const int *p, unsigned int n, const plot_style_t *style)
}
#ifdef PDF_DEBUG
- LOG(("%d %d %d %d %f", pminx, pminy, pmaxx, pmaxy, page_height - pminy));
+ LOG("%d %d %d %d %f", pminx, pminy, pmaxx, pmaxy, page_height - pminy);
#endif
HPDF_Page_Fill(pdf_page);
@@ -293,7 +293,7 @@ bool pdf_plot_polygon(const int *p, unsigned int n, const plot_style_t *style)
bool pdf_plot_clip(const struct rect *clip)
{
#ifdef PDF_DEBUG
- LOG(("%d %d %d %d", clip->x0, clip->y0, clip->x1, clip->y1));
+ LOG("%d %d %d %d", clip->x0, clip->y0, clip->x1, clip->y1);
#endif
/*Normalize cllipping area - to prevent overflows.
@@ -313,7 +313,7 @@ bool pdf_plot_text(int x, int y, const char *text, size_t length,
const plot_font_style_t *fstyle)
{
#ifdef PDF_DEBUG
- LOG((". %d %d %.*s", x, y, (int)length, text));
+ LOG(". %d %d %.*s", x, y, (int)length, text);
#endif
char *word;
HPDF_Font pdf_font;
@@ -346,7 +346,7 @@ bool pdf_plot_text(int x, int y, const char *text, size_t length,
bool pdf_plot_disc(int x, int y, int radius, const plot_style_t *style)
{
#ifdef PDF_DEBUG
- LOG(("."));
+ LOG(".");
#endif
if (style->fill_type != PLOT_OP_TYPE_NONE) {
apply_clip_and_mode(false,
@@ -377,7 +377,7 @@ bool pdf_plot_disc(int x, int y, int radius, const plot_style_t *style)
bool pdf_plot_arc(int x, int y, int radius, int angle1, int angle2, const plot_style_t *style)
{
#ifdef PDF_DEBUG
- LOG(("%d %d %d %d %d %X", x, y, radius, angle1, angle2, style->stroke_colour));
+ LOG("%d %d %d %d %d %X", x, y, radius, angle1, angle2, style->stroke_colour);
#endif
/* FIXME: line width 1 is ok ? */
@@ -405,8 +405,7 @@ bool pdf_plot_bitmap_tile(int x, int y, int width, int height,
HPDF_REAL max_width, max_height;
#ifdef PDF_DEBUG
- LOG(("%d %d %d %d %p 0x%x", x, y, width, height,
- bitmap, bg));
+ LOG("%d %d %d %d %p 0x%x", x, y, width, height, bitmap, bg);
#endif
if (width == 0 || height == 0)
return true;
@@ -483,7 +482,7 @@ HPDF_Image pdf_extract_image(struct bitmap *bitmap)
rgb_buffer = (unsigned char *)malloc(3 * img_width * img_height);
alpha_buffer = (unsigned char *)malloc(img_width * img_height);
if (rgb_buffer == NULL || alpha_buffer == NULL) {
- LOG(("Not enough memory to create RGB buffer"));
+ LOG("Not enough memory to create RGB buffer");
free(rgb_buffer);
free(alpha_buffer);
return NULL;
@@ -607,7 +606,7 @@ bool pdf_plot_path(const float *p, unsigned int n, colour fill, float width,
bool empty_path;
#ifdef PDF_DEBUG
- LOG(("."));
+ LOG(".");
#endif
if (n == 0)
@@ -649,7 +648,7 @@ bool pdf_plot_path(const float *p, unsigned int n, colour fill, float width,
i += 7;
empty_path = false;
} else {
- LOG(("bad path command %f", p[i]));
+ LOG("bad path command %f", p[i]);
return false;
}
}
@@ -685,7 +684,7 @@ bool pdf_begin(struct print_settings *print_settings)
HPDF_Free(pdf_doc);
pdf_doc = HPDF_New(error_handler, NULL);
if (!pdf_doc) {
- LOG(("Error creating pdf_doc"));
+ LOG("Error creating pdf_doc");
return false;
}
@@ -708,7 +707,7 @@ bool pdf_begin(struct print_settings *print_settings)
pdf_page = NULL;
#ifdef PDF_DEBUG
- LOG(("pdf_begin finishes"));
+ LOG("pdf_begin finishes");
#endif
return true;
}
@@ -717,7 +716,7 @@ bool pdf_begin(struct print_settings *print_settings)
bool pdf_next_page(void)
{
#ifdef PDF_DEBUG
- LOG(("pdf_next_page begins"));
+ LOG("pdf_next_page begins");
#endif
clip_update_needed = false;
if (pdf_page != NULL) {
@@ -745,7 +744,7 @@ bool pdf_next_page(void)
pdfw_gs_save(pdf_page);
#ifdef PDF_DEBUG
- LOG(("%f %f", page_width, page_height));
+ LOG("%f %f", page_width, page_height);
#endif
return true;
@@ -755,7 +754,7 @@ bool pdf_next_page(void)
void pdf_end(void)
{
#ifdef PDF_DEBUG
- LOG(("pdf_end begins"));
+ LOG("pdf_end begins");
#endif
clip_update_needed = false;
if (pdf_page != NULL) {
@@ -780,7 +779,7 @@ void pdf_end(void)
else
save_pdf(settings->output);
#ifdef PDF_DEBUG
- LOG(("pdf_end finishes"));
+ LOG("pdf_end finishes");
#endif
}
@@ -820,8 +819,7 @@ void save_pdf(const char *path)
static void error_handler(HPDF_STATUS error_no, HPDF_STATUS detail_no,
void *user_data)
{
- LOG(("ERROR:\n\terror_no=%x\n\tdetail_no=%d\n", (HPDF_UINT)error_no,
- (HPDF_UINT)detail_no));
+ LOG("ERROR:\n\terror_no=%x\n\tdetail_no=%d\n", (HPDF_UINT)error_no, (HPDF_UINT)detail_no);
#ifdef PDF_DEBUG
exit(1);
#endif
diff --git a/desktop/save_text.c b/desktop/save_text.c
index d19d9c783..81c3db604 100644
--- a/desktop/save_text.c
+++ b/desktop/save_text.c
@@ -76,7 +76,7 @@ void save_as_text(hlcache_handle *c, char *path)
free(save.block);
if (ret != NSERROR_OK) {
- LOG(("failed to convert to local encoding, return %d", ret));
+ LOG("failed to convert to local encoding, return %d", ret);
return;
}
@@ -85,12 +85,12 @@ void save_as_text(hlcache_handle *c, char *path)
int res = fputs(result, out);
if (res < 0) {
- LOG(("Warning: write failed"));
+ LOG("Warning: write failed");
}
res = fputs("\n", out);
if (res < 0) {
- LOG(("Warning: failed writing trailing newline"));
+ LOG("Warning: failed writing trailing newline");
}
fclose(out);
diff --git a/desktop/scrollbar.c b/desktop/scrollbar.c
index bbf9ebfab..caed13fbc 100644
--- a/desktop/scrollbar.c
+++ b/desktop/scrollbar.c
@@ -82,7 +82,7 @@ bool scrollbar_create(bool horizontal, int length, int full_size,
scrollbar = malloc(sizeof(struct scrollbar));
if (scrollbar == NULL) {
- LOG(("malloc failed"));
+ LOG("malloc failed");
warn_user("NoMemory", 0);
*s = NULL;
return false;
diff --git a/desktop/searchweb.c b/desktop/searchweb.c
index 64d9d40b4..4033f8ef0 100644
--- a/desktop/searchweb.c
+++ b/desktop/searchweb.c
@@ -285,16 +285,13 @@ search_web_ico_callback(hlcache_handle *ico,
switch (event->type) {
case CONTENT_MSG_DONE:
- LOG(("icon '%s' retrived",
- nsurl_access(hlcache_handle_get_url(ico))));
+ LOG("icon '%s' retrived", nsurl_access(hlcache_handle_get_url(ico)));
guit->search_web->provider_update(provider->name,
content_get_bitmap(ico));
break;
case CONTENT_MSG_ERROR:
- LOG(("icon %s error: %s",
- nsurl_access(hlcache_handle_get_url(ico)),
- event->data.error));
+ LOG("icon %s error: %s", nsurl_access(hlcache_handle_get_url(ico)), event->data.error);
hlcache_handle_release(ico);
/* clear reference to released handle */
provider->ico_handle = NULL;
@@ -437,8 +434,7 @@ default_ico_callback(hlcache_handle *ico,
switch (event->type) {
case CONTENT_MSG_DONE:
- LOG(("default icon '%s' retrived",
- nsurl_access(hlcache_handle_get_url(ico))));
+ LOG("default icon '%s' retrived", nsurl_access(hlcache_handle_get_url(ico)));
/* only set to default icon if providers icon has no handle */
if (ctx->providers[search_web_ctx.current].ico_handle == NULL) {
@@ -449,9 +445,7 @@ default_ico_callback(hlcache_handle *ico,
break;
case CONTENT_MSG_ERROR:
- LOG(("icon %s error: %s",
- nsurl_access(hlcache_handle_get_url(ico)),
- event->data.error));
+ LOG("icon %s error: %s", nsurl_access(hlcache_handle_get_url(ico)), event->data.error);
hlcache_handle_release(ico);
/* clear reference to released handle */
ctx->default_ico_handle = NULL;
diff --git a/desktop/sslcert_viewer.c b/desktop/sslcert_viewer.c
index 5280e094a..f3eb1694d 100644
--- a/desktop/sslcert_viewer.c
+++ b/desktop/sslcert_viewer.c
@@ -353,7 +353,7 @@ nserror sslcert_viewer_init(struct core_window_callback_table *cw_t,
assert(ssl_d != NULL);
- LOG(("Building certificate viewer"));
+ LOG("Building certificate viewer");
/* Init. certificate chain treeview entry fields */
err = sslcert_init_entry_fields(ssl_d);
@@ -379,7 +379,7 @@ nserror sslcert_viewer_init(struct core_window_callback_table *cw_t,
}
}
- LOG(("Built certificate viewer"));
+ LOG("Built certificate viewer");
return NSERROR_OK;
}
@@ -414,7 +414,7 @@ nserror sslcert_viewer_fini(struct sslcert_session_data *ssl_d)
int i;
nserror err;
- LOG(("Finalising ssl certificate viewer"));
+ LOG("Finalising ssl certificate viewer");
/* Destroy the treeview */
err = treeview_destroy(ssl_d->tree);
@@ -427,7 +427,7 @@ nserror sslcert_viewer_fini(struct sslcert_session_data *ssl_d)
/* Destroy the sslcert_session_data */
sslcert_cleanup_session(ssl_d);
- LOG(("Finalised ssl certificate viewer"));
+ LOG("Finalised ssl certificate viewer");
return err;
}
diff --git a/desktop/textarea.c b/desktop/textarea.c
index a2e6c167b..9970bd6ab 100644
--- a/desktop/textarea.c
+++ b/desktop/textarea.c
@@ -828,7 +828,7 @@ static bool textarea_reflow_singleline(struct textarea *ta, size_t b_off,
ta->lines =
malloc(LINE_CHUNK_SIZE * sizeof(struct line_info));
if (ta->lines == NULL) {
- LOG(("malloc failed"));
+ LOG("malloc failed");
return false;
}
ta->lines_alloc_size = LINE_CHUNK_SIZE;
@@ -852,7 +852,7 @@ static bool textarea_reflow_singleline(struct textarea *ta, size_t b_off,
char *temp = realloc(ta->password.data,
b_len + TA_ALLOC_STEP);
if (temp == NULL) {
- LOG(("realloc failed"));
+ LOG("realloc failed");
return false;
}
@@ -936,7 +936,7 @@ static bool textarea_reflow_multiline(struct textarea *ta,
if (ta->lines == NULL) {
ta->lines = calloc(sizeof(struct line_info), LINE_CHUNK_SIZE);
if (ta->lines == NULL) {
- LOG(("Failed to allocate memory for textarea lines"));
+ LOG("Failed to allocate memory for textarea lines");
return false;
}
ta->lines_alloc_size = LINE_CHUNK_SIZE;
@@ -1052,7 +1052,7 @@ static bool textarea_reflow_multiline(struct textarea *ta,
(line + 2 + LINE_CHUNK_SIZE) *
sizeof(struct line_info));
if (temp == NULL) {
- LOG(("realloc failed"));
+ LOG("realloc failed");
return false;
}
@@ -1332,7 +1332,7 @@ static bool textarea_insert_text(struct textarea *ta, const char *text,
char *temp = realloc(ta->text.data, b_len + ta->text.len +
TA_ALLOC_STEP);
if (temp == NULL) {
- LOG(("realloc failed"));
+ LOG("realloc failed");
return false;
}
@@ -1482,7 +1482,7 @@ static bool textarea_replace_text_internal(struct textarea *ta, size_t b_start,
rep_len + ta->text.len - (b_end - b_start) +
TA_ALLOC_STEP);
if (temp == NULL) {
- LOG(("realloc failed"));
+ LOG("realloc failed");
return false;
}
@@ -1559,7 +1559,7 @@ static bool textarea_copy_to_undo_buffer(struct textarea *ta,
char *temp = realloc(undo->text.data,
b_offset + len + TA_ALLOC_STEP);
if (temp == NULL) {
- LOG(("realloc failed"));
+ LOG("realloc failed");
return false;
}
@@ -1573,7 +1573,7 @@ static bool textarea_copy_to_undo_buffer(struct textarea *ta,
(undo->next_detail + 128) *
sizeof(struct textarea_undo_detail));
if (temp == NULL) {
- LOG(("realloc failed"));
+ LOG("realloc failed");
return false;
}
@@ -1833,13 +1833,13 @@ struct textarea *textarea_create(const textarea_flags flags,
flags & TEXTAREA_PASSWORD));
if (callback == NULL) {
- LOG(("no callback provided"));
+ LOG("no callback provided");
return NULL;
}
ret = malloc(sizeof(struct textarea));
if (ret == NULL) {
- LOG(("malloc failed"));
+ LOG("malloc failed");
return NULL;
}
@@ -1886,7 +1886,7 @@ struct textarea *textarea_create(const textarea_flags flags,
ret->text.data = malloc(TA_ALLOC_STEP);
if (ret->text.data == NULL) {
- LOG(("malloc failed"));
+ LOG("malloc failed");
free(ret);
return NULL;
}
@@ -1898,7 +1898,7 @@ struct textarea *textarea_create(const textarea_flags flags,
if (flags & TEXTAREA_PASSWORD) {
ret->password.data = malloc(TA_ALLOC_STEP);
if (ret->password.data == NULL) {
- LOG(("malloc failed"));
+ LOG("malloc failed");
free(ret->text.data);
free(ret);
return NULL;
@@ -1973,7 +1973,7 @@ bool textarea_set_text(struct textarea *ta, const char *text)
if (len >= ta->text.alloc) {
char *temp = realloc(ta->text.data, len + TA_ALLOC_STEP);
if (temp == NULL) {
- LOG(("realloc failed"));
+ LOG("realloc failed");
return false;
}
ta->text.data = temp;
@@ -2060,7 +2060,7 @@ int textarea_get_text(struct textarea *ta, char *buf, unsigned int len)
}
if (len < ta->text.len) {
- LOG(("buffer too small"));
+ LOG("buffer too small");
return -1;
}
diff --git a/desktop/tree.c b/desktop/tree.c
index 975f74409..eac9201cf 100644
--- a/desktop/tree.c
+++ b/desktop/tree.c
@@ -286,7 +286,7 @@ struct tree *tree_create(unsigned int flags,
tree = calloc(sizeof(struct tree), 1);
if (tree == NULL) {
- LOG(("calloc failed"));
+ LOG("calloc failed");
warn_user(messages_get_errorcode(NSERROR_NOMEM), 0);
return NULL;
}
diff --git a/desktop/treeview.c b/desktop/treeview.c
index 35458f7fb..210c6f97e 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -1396,7 +1396,7 @@ static nserror treeview_node_expand_internal(treeview *tree,
if (node->flags & TV_NFLAGS_EXPANDED) {
/* What madness is this? */
- LOG(("Tried to expand an expanded node."));
+ LOG("Tried to expand an expanded node.");
return NSERROR_OK;
}
@@ -1540,7 +1540,7 @@ static nserror treeview_node_contract_internal(treeview *tree,
if ((node->flags & TV_NFLAGS_EXPANDED) == false) {
/* What madness is this? */
- LOG(("Tried to contract a contracted node."));
+ LOG("Tried to contract a contracted node.");
return NSERROR_OK;
}
@@ -2434,7 +2434,7 @@ static nserror treeview_move_selection(treeview *tree, struct rect *rect)
break;
default:
- LOG(("Bad drop target for move."));
+ LOG("Bad drop target for move.");
return NSERROR_BAD_PARAMETER;
}
@@ -3950,7 +3950,7 @@ nserror treeview_init(int font_pt_size)
if (tree_g.initialised == true)
return NSERROR_OK;
- LOG(("Initialising treeview module"));
+ LOG("Initialising treeview module");
if (font_pt_size <= 0)
font_pt_size = 11;
@@ -3972,7 +3972,7 @@ nserror treeview_init(int font_pt_size)
tree_g.initialised = true;
- LOG(("Initialised treeview module"));
+ LOG("Initialised treeview module");
return NSERROR_OK;
}
@@ -3983,7 +3983,7 @@ nserror treeview_fini(void)
{
int i;
- LOG(("Finalising treeview module"));
+ LOG("Finalising treeview module");
for (i = 0; i < TREE_RES_LAST; i++) {
hlcache_handle_release(treeview_res[i].c);
@@ -4000,7 +4000,7 @@ nserror treeview_fini(void)
tree_g.initialised = false;
- LOG(("Finalised treeview module"));
+ LOG("Finalised treeview module");
return NSERROR_OK;
}