summaryrefslogtreecommitdiff
path: root/desktop/hotlist.c
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/hotlist.c
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/hotlist.c')
-rw-r--r--desktop/hotlist.c24
1 files changed, 12 insertions, 12 deletions
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;
}