diff options
author | Vincent Sanders <vince@kyllikki.org> | 2015-05-28 16:08:46 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2015-05-28 16:08:46 +0100 |
commit | c105738fa36bb2400adc47399c5b878d252d1c86 (patch) | |
tree | 138eeb449e1bf51ee1726b5f820740aada0ccd0b /gtk/viewdata.c | |
parent | 20f2c86a511f7913cf858e7bd3668b0b59663ba0 (diff) | |
download | netsurf-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 'gtk/viewdata.c')
-rw-r--r-- | gtk/viewdata.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/gtk/viewdata.c b/gtk/viewdata.c index bde87a70a..94dc5c573 100644 --- a/gtk/viewdata.c +++ b/gtk/viewdata.c @@ -376,7 +376,7 @@ window_init(const char *title, if (!gtk_builder_add_from_file(newctx->builder, glade_file_location->viewdata, &error)) { - LOG(("Couldn't load builder file: %s", error->message)); + LOG("Couldn't load builder file: %s", error->message); g_error_free(error); free(newctx); return NSERROR_INIT_FAILED; @@ -386,7 +386,7 @@ window_init(const char *title, window = GTK_WINDOW(gtk_builder_get_object(newctx->builder, "ViewDataWindow")); if (window == NULL) { - LOG(("Unable to find window in builder ")); + LOG("Unable to find window in builder "); /* free the builder */ g_object_unref(G_OBJECT(newctx->builder)); @@ -621,7 +621,7 @@ static char** xdg_data_strvec(void) xdg_data_home, xdg_data_dirs); } - LOG(("%s", xdg_data_path)); + LOG("%s", xdg_data_path); svec = filepath_path_to_strvec(xdg_data_path); free(xdg_data_path); @@ -656,7 +656,7 @@ static char *xdg_get_default_app(const char *path, const char *mimetype) fname = malloc(fname_len); snprintf(fname, fname_len, "%s/applications/defaults.list", path); - LOG(("Checking %s", fname)); + LOG("Checking %s", fname); fp = fopen(fname, "r"); free(fname); @@ -679,8 +679,8 @@ static char *xdg_get_default_app(const char *path, const char *mimetype) ret = strdup(line + mimetype_len + 1); - LOG(("Found line match for %s length %zu\n", mimetype, rd)); - LOG(("Result %s", ret)); + LOG("Found line match for %s length %zu\n", mimetype, rd); + LOG("Result %s", ret); break; } @@ -719,7 +719,7 @@ static char *xdg_get_exec_cmd(const char *path, const char *desktop) fname = malloc(fname_len); snprintf(fname, fname_len, "%s/applications/%s", path, desktop); - LOG(("Checking %s", fname)); + LOG("Checking %s", fname); fp = fopen(fname, "r"); free(fname); @@ -740,8 +740,8 @@ static char *xdg_get_exec_cmd(const char *path, const char *desktop) ret = strdup(line + SLEN("Exec=")); - LOG(("Found Exec length %zu", rd)); - LOG(("Result %s", ret)); + LOG("Found Exec length %zu", rd); + LOG("Result %s", ret); break; } @@ -806,7 +806,7 @@ static char **build_exec_argv(const char *fname, const char *exec_cmd) argv[aidx] = exec_arg(start, cur - start, fname); if (argv[aidx] != NULL) { - LOG(("adding \"%s\"", argv[aidx])); + LOG("adding \"%s\"", argv[aidx]); aidx++; } } |