summaryrefslogtreecommitdiff
path: root/beos
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 /beos
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 'beos')
-rw-r--r--beos/bitmap.cpp6
-rw-r--r--beos/fetch_rsrc.cpp9
-rw-r--r--beos/gui.cpp14
-rw-r--r--beos/scaffolding.cpp4
-rw-r--r--beos/schedule.cpp5
-rw-r--r--beos/window.cpp10
6 files changed, 23 insertions, 25 deletions
diff --git a/beos/bitmap.cpp b/beos/bitmap.cpp
index 2ed73a4c1..3228770a4 100644
--- a/beos/bitmap.cpp
+++ b/beos/bitmap.cpp
@@ -377,7 +377,7 @@ nsbeos_bitmap_get_pretile_x(struct bitmap* bitmap)
if (!bitmap->pretile_x) {
int width = bitmap->primary->Bounds().Width() + 1;
int xmult = (MIN_PRETILE_WIDTH + width - 1)/width;
- LOG(("Pretiling %p for X*%d", bitmap, xmult));
+ LOG("Pretiling %p for X*%d", bitmap, xmult);
bitmap->pretile_x = nsbeos_bitmap_generate_pretile(bitmap->primary, xmult, 1);
}
return bitmap->pretile_x;
@@ -396,7 +396,7 @@ nsbeos_bitmap_get_pretile_y(struct bitmap* bitmap)
if (!bitmap->pretile_y) {
int height = bitmap->primary->Bounds().Height() + 1;
int ymult = (MIN_PRETILE_HEIGHT + height - 1)/height;
- LOG(("Pretiling %p for Y*%d", bitmap, ymult));
+ LOG("Pretiling %p for Y*%d", bitmap, ymult);
bitmap->pretile_y = nsbeos_bitmap_generate_pretile(bitmap->primary, 1, ymult);
}
return bitmap->pretile_y;
@@ -416,7 +416,7 @@ nsbeos_bitmap_get_pretile_xy(struct bitmap* bitmap)
int height = bitmap->primary->Bounds().Height() + 1;
int xmult = (MIN_PRETILE_WIDTH + width - 1)/width;
int ymult = (MIN_PRETILE_HEIGHT + height - 1)/height;
- LOG(("Pretiling %p for X*%d Y*%d", bitmap, xmult, ymult));
+ LOG("Pretiling %p for X*%d Y*%d", bitmap, xmult, ymult);
bitmap->pretile_xy = nsbeos_bitmap_generate_pretile(bitmap->primary, xmult, ymult);
}
return bitmap->pretile_xy;
diff --git a/beos/fetch_rsrc.cpp b/beos/fetch_rsrc.cpp
index 67d0f3555..ceed7d25e 100644
--- a/beos/fetch_rsrc.cpp
+++ b/beos/fetch_rsrc.cpp
@@ -70,13 +70,13 @@ BResources *gAppResources = NULL;
static bool fetch_rsrc_initialise(lwc_string *scheme)
{
- LOG(("fetch_rsrc_initialise called for %s", lwc_string_data(scheme)));
+ LOG("fetch_rsrc_initialise called for %s", lwc_string_data(scheme));
return true;
}
static void fetch_rsrc_finalise(lwc_string *scheme)
{
- LOG(("fetch_rsrc_finalise called for %s", lwc_string_data(scheme)));
+ LOG("fetch_rsrc_finalise called for %s", lwc_string_data(scheme));
}
static bool fetch_rsrc_can_fetch(const nsurl *url)
@@ -277,8 +277,7 @@ static void fetch_rsrc_poll(lwc_string *scheme)
char header[64];
fetch_set_http_code(c->parent_fetch, 200);
- LOG(("setting rsrc: MIME type to %s, length to %zd",
- c->mimetype, c->datalen));
+ LOG("setting rsrc: MIME type to %s, length to %zd", c->mimetype, c->datalen);
/* Any callback can result in the fetch being aborted.
* Therefore, we _must_ check for this after _every_
* call to fetch_rsrc_send_callback().
@@ -308,7 +307,7 @@ static void fetch_rsrc_poll(lwc_string *scheme)
fetch_rsrc_send_callback(&msg, c);
}
} else {
- LOG(("Processing of %s failed!", c->url));
+ LOG("Processing of %s failed!", c->url);
/* Ensure that we're unlocked here. If we aren't,
* then fetch_rsrc_process() is broken.
diff --git a/beos/gui.cpp b/beos/gui.cpp
index 7c5d9e039..716a4480d 100644
--- a/beos/gui.cpp
+++ b/beos/gui.cpp
@@ -338,14 +338,14 @@ static void check_homedir(void)
if (err < B_OK) {
/* we really can't continue without a home directory. */
- LOG(("Can't find user settings directory - nowhere to store state!"));
+ LOG("Can't find user settings directory - nowhere to store state!");
die("NetSurf needs to find the user settings directory in order to run.\n");
}
path.Append("NetSurf");
err = create_directory(path.Path(), 0644);
if (err < B_OK) {
- LOG(("Unable to create %s", path.Path()));
+ LOG("Unable to create %s", path.Path());
die("NetSurf could not create its settings directory.\n");
}
}
@@ -572,7 +572,7 @@ static void gui_init(int argc, char** argv)
die("Unable to load throbber image.\n");
find_resource(buf, "Choices", "%/Choices");
- LOG(("Using '%s' as Preferences file", buf));
+ LOG("Using '%s' as Preferences file", buf);
options_file_location = strdup(buf);
nsoption_read(buf, NULL);
@@ -611,12 +611,12 @@ static void gui_init(int argc, char** argv)
if (nsoption_charp(cookie_file) == NULL) {
find_resource(buf, "Cookies", "%/Cookies");
- LOG(("Using '%s' as Cookies file", buf));
+ LOG("Using '%s' as Cookies file", buf);
nsoption_set_charp(cookie_file, strdup(buf));
}
if (nsoption_charp(cookie_jar) == NULL) {
find_resource(buf, "Cookies", "%/Cookies");
- LOG(("Using '%s' as Cookie Jar file", buf));
+ LOG("Using '%s' as Cookie Jar file", buf);
nsoption_set_charp(cookie_jar, strdup(buf));
}
if ((nsoption_charp(cookie_file) == NULL) ||
@@ -625,13 +625,13 @@ static void gui_init(int argc, char** argv)
if (nsoption_charp(url_file) == NULL) {
find_resource(buf, "URLs", "%/URLs");
- LOG(("Using '%s' as URL file", buf));
+ LOG("Using '%s' as URL file", buf);
nsoption_set_charp(url_file, strdup(buf));
}
if (nsoption_charp(ca_path) == NULL) {
find_resource(buf, "certs", "/etc/ssl/certs");
- LOG(("Using '%s' as certificate path", buf));
+ LOG("Using '%s' as certificate path", buf);
nsoption_set_charp(ca_path, strdup(buf));
}
diff --git a/beos/scaffolding.cpp b/beos/scaffolding.cpp
index 49e1cd486..83f313dd6 100644
--- a/beos/scaffolding.cpp
+++ b/beos/scaffolding.cpp
@@ -771,7 +771,7 @@ int32 nsbeos_replicant_main_thread(void *_arg)
static void nsbeos_window_destroy_event(NSBrowserWindow *window, nsbeos_scaffolding *g, BMessage *event)
{
- LOG(("Being Destroyed = %d", g->being_destroyed));
+ LOG("Being Destroyed = %d", g->being_destroyed);
if (--open_windows == 0)
nsbeos_done = true;
@@ -1289,7 +1289,7 @@ void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *m
void nsbeos_scaffolding_destroy(nsbeos_scaffolding *scaffold)
{
- LOG(("Being Destroyed = %d", scaffold->being_destroyed));
+ LOG("Being Destroyed = %d", scaffold->being_destroyed);
if (scaffold->being_destroyed) return;
scaffold->being_destroyed = 1;
nsbeos_window_destroy_event(scaffold->window, scaffold, NULL);
diff --git a/beos/schedule.cpp b/beos/schedule.cpp
index bcfb9632d..c00f68942 100644
--- a/beos/schedule.cpp
+++ b/beos/schedule.cpp
@@ -58,8 +58,7 @@ nsbeos_schedule_kill_callback(void *_target, void *_match)
_nsbeos_callback_t *match = (_nsbeos_callback_t *)_match;
if ((target->callback == match->callback) &&
(target->context == match->context)) {
- LOG(("Found match for %p(%p), killing.",
- target->callback, target->context));
+ LOG("Found match for %p(%p), killing.", target->callback, target->context);
target->callback = NULL;
target->context = NULL;
target->callback_killed = true;
@@ -70,7 +69,7 @@ nsbeos_schedule_kill_callback(void *_target, void *_match)
static void
schedule_remove(void (*callback)(void *p), void *p)
{
- LOG(("schedule_remove() for %p(%p)", cb->callback, cb->context));
+ LOG("schedule_remove() for %p(%p)", cb->callback, cb->context);
if (callbacks == NULL)
return;
_nsbeos_callback_t cb_match;
diff --git a/beos/window.cpp b/beos/window.cpp
index b85d07d81..9d7d6f230 100644
--- a/beos/window.cpp
+++ b/beos/window.cpp
@@ -433,19 +433,19 @@ void nsbeos_dispatch_event(BMessage *message)
continue;
if (gui && gui != z) {
- LOG(("discarding event for destroyed gui_window"));
+ LOG("discarding event for destroyed gui_window");
delete message;
return;
}
if (scaffold && (!y || scaffold != y->scaffold)) {
- LOG(("discarding event for destroyed scaffolding"));
+ LOG("discarding event for destroyed scaffolding");
delete message;
return;
}
// messages for top-level
if (scaffold) {
- LOG(("dispatching to top-level"));
+ LOG("dispatching to top-level");
nsbeos_scaffolding_dispatch_event(scaffold, message);
delete message;
return;
@@ -761,7 +761,7 @@ void nsbeos_window_keypress_event(BView *view, gui_window *g, BMessage *event)
if (!numbytes)
numbytes = strlen(bytes);
- LOG(("mods 0x%08lx key %ld raw %ld byte[0] %d", mods, key, raw_char, buff[0]));
+ LOG("mods 0x%08lx key %ld raw %ld byte[0] %d", mods, key, raw_char, buff[0]);
char byte;
if (numbytes == 1) {
@@ -1091,7 +1091,7 @@ static void gui_window_update_extent(struct gui_window *g)
float y_prop = g->view->Bounds().Height() / y_max;
x_max -= g->view->Bounds().Width() + 1;
y_max -= g->view->Bounds().Height() + 1;
- LOG(("x_max = %f y_max = %f x_prop = %f y_prop = %f\n", x_max, y_max, x_prop, y_prop));
+ LOG("x_max = %f y_max = %f x_prop = %f y_prop = %f\n", x_max, y_max, x_prop, y_prop);
if (g->view->ScrollBar(B_HORIZONTAL)) {
g->view->ScrollBar(B_HORIZONTAL)->SetRange(0, x_max);
g->view->ScrollBar(B_HORIZONTAL)->SetProportion(x_prop);