summaryrefslogtreecommitdiff
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
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.
-rw-r--r--amiga/arexx.c2
-rw-r--r--amiga/drag.c2
-rw-r--r--amiga/dt_anim.c14
-rw-r--r--amiga/dt_picture.c6
-rw-r--r--amiga/dt_sound.c16
-rw-r--r--amiga/filetype.c8
-rw-r--r--amiga/font.c26
-rw-r--r--amiga/font_bitmap.c2
-rw-r--r--amiga/font_scan.c16
-rw-r--r--amiga/fs_backing_store.c6
-rw-r--r--amiga/gui.c59
-rwxr-xr-xamiga/misc.c2
-rw-r--r--amiga/os3support.c12
-rw-r--r--amiga/plotters.c44
-rw-r--r--amiga/plugin_hack.c18
-rwxr-xr-xamiga/schedule.c4
-rw-r--r--atari/bitmap.c29
-rw-r--r--atari/certview.c16
-rw-r--r--atari/cookies.c14
-rw-r--r--atari/ctxmenu.c4
-rw-r--r--atari/deskmenu.c8
-rw-r--r--atari/download.c14
-rw-r--r--atari/filetype.c4
-rw-r--r--atari/findfile.c18
-rw-r--r--atari/gui.c52
-rw-r--r--atari/history.c14
-rw-r--r--atari/hotlist.c20
-rw-r--r--atari/osspec.c6
-rw-r--r--atari/plot/font_freetype.c16
-rw-r--r--atari/plot/font_internal.c2
-rw-r--r--atari/plot/font_vdi.c2
-rw-r--r--atari/plot/plot.c2
-rw-r--r--atari/rootwin.c39
-rw-r--r--atari/schedule.c21
-rw-r--r--atari/search.c12
-rw-r--r--atari/settings.c6
-rw-r--r--atari/statusbar.c4
-rw-r--r--atari/toolbar.c13
-rw-r--r--atari/treeview.c5
-rw-r--r--atari/verify_ssl.c4
-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
-rw-r--r--cocoa/DownloadWindowController.m2
-rw-r--r--cocoa/fetch.m10
-rw-r--r--cocoa/plotter.m4
-rw-r--r--content/content.c31
-rw-r--r--content/fetch.c12
-rw-r--r--content/fetchers/curl.c59
-rw-r--r--content/fetchers/data.c11
-rw-r--r--content/fs_backing_store.c173
-rw-r--r--content/hlcache.c17
-rw-r--r--content/llcache.c35
-rw-r--r--content/urldb.c41
-rw-r--r--css/css.c12
-rw-r--r--css/select.c14
-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
-rw-r--r--framebuffer/bitmap.c10
-rw-r--r--framebuffer/clipboard.c4
-rw-r--r--framebuffer/fbtk/event.c4
-rw-r--r--framebuffer/fbtk/fbtk.c23
-rw-r--r--framebuffer/fbtk/scroll.c4
-rw-r--r--framebuffer/fetch.c2
-rw-r--r--framebuffer/font_freetype.c14
-rw-r--r--framebuffer/framebuffer.c14
-rw-r--r--framebuffer/gui.c34
-rw-r--r--framebuffer/misc.c2
-rw-r--r--framebuffer/schedule.c5
-rw-r--r--gtk/cookies.c2
-rw-r--r--gtk/fetch.c2
-rw-r--r--gtk/font_pango.c4
-rw-r--r--gtk/gdk.c2
-rw-r--r--gtk/gui.c36
-rw-r--r--gtk/history.c2
-rw-r--r--gtk/hotlist.c2
-rw-r--r--gtk/plotters.c4
-rw-r--r--gtk/preferences.c10
-rw-r--r--gtk/print.c21
-rw-r--r--gtk/scaffolding.c21
-rw-r--r--gtk/schedule.c9
-rw-r--r--gtk/tabs.c4
-rw-r--r--gtk/theme.c2
-rw-r--r--gtk/throbber.c8
-rw-r--r--gtk/toolbar.c2
-rw-r--r--gtk/treeview.c2
-rw-r--r--gtk/viewdata.c20
-rw-r--r--gtk/window.c34
-rw-r--r--image/ico.c8
-rw-r--r--image/image_cache.c93
-rw-r--r--image/jpeg.c4
-rw-r--r--image/png.c11
-rw-r--r--image/rsvg.c12
-rw-r--r--javascript/jsapi.c2
-rw-r--r--monkey/browser.c2
-rw-r--r--monkey/dispatch.c2
-rw-r--r--monkey/filetype.c2
-rw-r--r--monkey/poll.c10
-rw-r--r--monkey/schedule.c17
-rw-r--r--render/box.c4
-rw-r--r--render/box_construct.c2
-rw-r--r--render/box_normalise.c24
-rw-r--r--render/box_textarea.c3
-rw-r--r--render/form.c98
-rw-r--r--render/html.c40
-rw-r--r--render/html_css.c37
-rw-r--r--render/html_css_fetcher.c9
-rw-r--r--render/html_interaction.c2
-rw-r--r--render/html_object.c14
-rw-r--r--render/html_script.c47
-rw-r--r--render/imagemap.c21
-rw-r--r--render/layout.c113
-rw-r--r--render/table.c11
-rw-r--r--render/textplain.c4
-rw-r--r--riscos/401login.c5
-rw-r--r--riscos/bitmap.c26
-rw-r--r--riscos/buffer.c18
-rw-r--r--riscos/configure.c28
-rw-r--r--riscos/configure/con_language.c4
-rw-r--r--riscos/configure/con_theme.c22
-rw-r--r--riscos/content-handlers/artworks.c30
-rw-r--r--riscos/content-handlers/draw.c6
-rw-r--r--riscos/content-handlers/sprite.c3
-rw-r--r--riscos/cookies.c2
-rw-r--r--riscos/dialog.c49
-rw-r--r--riscos/download.c128
-rw-r--r--riscos/filetype.c36
-rw-r--r--riscos/font.c67
-rw-r--r--riscos/global_history.c2
-rw-r--r--riscos/gui.c102
-rw-r--r--riscos/gui/button_bar.c22
-rw-r--r--riscos/gui/progress_bar.c17
-rw-r--r--riscos/gui/status_bar.c53
-rw-r--r--riscos/gui/throbber.c11
-rw-r--r--riscos/gui/url_bar.c45
-rw-r--r--riscos/help.c18
-rw-r--r--riscos/history.c44
-rw-r--r--riscos/hotlist.c4
-rw-r--r--riscos/iconbar.c5
-rw-r--r--riscos/image.c14
-rw-r--r--riscos/menus.c31
-rw-r--r--riscos/message.c6
-rw-r--r--riscos/mouse.c5
-rw-r--r--riscos/plotters.c70
-rw-r--r--riscos/print.c65
-rw-r--r--riscos/query.c19
-rw-r--r--riscos/save.c85
-rw-r--r--riscos/save_draw.c11
-rw-r--r--riscos/schedule.c2
-rw-r--r--riscos/sslcert.c33
-rw-r--r--riscos/textarea.c113
-rw-r--r--riscos/textselection.c37
-rw-r--r--riscos/theme.c34
-rw-r--r--riscos/theme_install.c5
-rw-r--r--riscos/toolbar.c40
-rw-r--r--riscos/treeview.c71
-rw-r--r--riscos/ucstables.c6
-rw-r--r--riscos/uri.c4
-rw-r--r--riscos/url_complete.c61
-rw-r--r--riscos/url_protocol.c17
-rw-r--r--riscos/wimp.c115
-rw-r--r--riscos/wimp_event.c55
-rw-r--r--riscos/window.c163
-rw-r--r--test/nsurl.c108
-rw-r--r--test/urldbtest.c26
-rw-r--r--utils/container.c52
-rw-r--r--utils/filename.c25
-rw-r--r--utils/hashtable.c8
-rw-r--r--utils/idna.c22
-rw-r--r--utils/log.h9
-rw-r--r--utils/messages.c12
-rw-r--r--utils/nsoption.c8
-rw-r--r--utils/nsurl.c49
-rw-r--r--utils/useragent.c2
-rw-r--r--utils/utf8.c4
-rw-r--r--utils/utils.c2
-rw-r--r--windows/about.c8
-rw-r--r--windows/bitmap.c29
-rw-r--r--windows/download.c7
-rw-r--r--windows/drawable.c22
-rw-r--r--windows/filetype.c2
-rw-r--r--windows/findfile.c4
-rw-r--r--windows/gui.c4
-rw-r--r--windows/localhistory.c12
-rw-r--r--windows/main.c4
-rw-r--r--windows/plot.c18
-rw-r--r--windows/schedule.c5
-rw-r--r--windows/window.c65
209 files changed, 1921 insertions, 2617 deletions
diff --git a/amiga/arexx.c b/amiga/arexx.c
index 3b386d3ad..45f35f051 100644
--- a/amiga/arexx.c
+++ b/amiga/arexx.c
@@ -147,7 +147,7 @@ void ami_arexx_execute(char *script)
if(lock = Lock(script, ACCESS_READ)) {
DevNameFromLock(lock, full_script_path, 1024, DN_FULLPATH);
- LOG(("Executing script: %s", full_script_path));
+ LOG("Executing script: %s", full_script_path);
IDoMethod(arexx_obj, AM_EXECUTE, full_script_path, NULL, NULL, NULL, NULL, NULL);
UnLock(lock);
}
diff --git a/amiga/drag.c b/amiga/drag.c
index 924deed4f..7aef426d0 100644
--- a/amiga/drag.c
+++ b/amiga/drag.c
@@ -183,7 +183,7 @@ void ami_drag_save(struct Window *win)
break;
default:
- LOG(("Unsupported drag save operation %ld",drag_save));
+ LOG("Unsupported drag save operation %ld", drag_save);
break;
}
diff --git a/amiga/dt_anim.c b/amiga/dt_anim.c
index 723bd1348..d6f1f3652 100644
--- a/amiga/dt_anim.c
+++ b/amiga/dt_anim.c
@@ -160,7 +160,7 @@ nserror amiga_dt_anim_create(const content_handler *handler,
bool amiga_dt_anim_convert(struct content *c)
{
- LOG(("amiga_dt_anim_convert"));
+ LOG("amiga_dt_anim_convert");
amiga_dt_anim_content *plugin = (amiga_dt_anim_content *) c;
union content_msg_data msg_data;
@@ -244,7 +244,7 @@ void amiga_dt_anim_destroy(struct content *c)
{
amiga_dt_anim_content *plugin = (amiga_dt_anim_content *) c;
- LOG(("amiga_dt_anim_destroy"));
+ LOG("amiga_dt_anim_destroy");
if (plugin->bitmap != NULL)
amiga_bitmap_destroy(plugin->bitmap);
@@ -261,7 +261,7 @@ bool amiga_dt_anim_redraw(struct content *c,
amiga_dt_anim_content *plugin = (amiga_dt_anim_content *) c;
bitmap_flags_t flags = BITMAPF_NONE;
- LOG(("amiga_dt_anim_redraw"));
+ LOG("amiga_dt_anim_redraw");
if (data->repeat_x)
flags |= BITMAPF_REPEAT_X;
@@ -285,20 +285,20 @@ bool amiga_dt_anim_redraw(struct content *c,
void amiga_dt_anim_open(struct content *c, struct browser_window *bw,
struct content *page, struct object_params *params)
{
- LOG(("amiga_dt_anim_open"));
+ LOG("amiga_dt_anim_open");
return;
}
void amiga_dt_anim_close(struct content *c)
{
- LOG(("amiga_dt_anim_close"));
+ LOG("amiga_dt_anim_close");
return;
}
void amiga_dt_anim_reformat(struct content *c, int width, int height)
{
- LOG(("amiga_dt_anim_reformat"));
+ LOG("amiga_dt_anim_reformat");
return;
}
@@ -307,7 +307,7 @@ nserror amiga_dt_anim_clone(const struct content *old, struct content **newc)
amiga_dt_anim_content *plugin;
nserror error;
- LOG(("amiga_dt_anim_clone"));
+ LOG("amiga_dt_anim_clone");
plugin = calloc(1, sizeof(amiga_dt_anim_content));
if (plugin == NULL)
diff --git a/amiga/dt_picture.c b/amiga/dt_picture.c
index b5c3ba5d0..b3dbb3481 100644
--- a/amiga/dt_picture.c
+++ b/amiga/dt_picture.c
@@ -172,7 +172,7 @@ static char *amiga_dt_picture_datatype(struct content *c)
static struct bitmap *amiga_dt_picture_cache_convert(struct content *c)
{
- LOG(("amiga_dt_picture_cache_convert"));
+ LOG("amiga_dt_picture_cache_convert");
union content_msg_data msg_data;
UBYTE *bm_buffer;
@@ -208,7 +208,7 @@ static struct bitmap *amiga_dt_picture_cache_convert(struct content *c)
bool amiga_dt_picture_convert(struct content *c)
{
- LOG(("amiga_dt_picture_convert"));
+ LOG("amiga_dt_picture_convert");
int width, height;
char *title;
@@ -254,7 +254,7 @@ nserror amiga_dt_picture_clone(const struct content *old, struct content **newc)
struct content *adt;
nserror error;
- LOG(("amiga_dt_picture_clone"));
+ LOG("amiga_dt_picture_clone");
adt = calloc(1, sizeof(struct content));
if (adt == NULL)
diff --git a/amiga/dt_sound.c b/amiga/dt_sound.c
index 2823178e2..6c49f0960 100644
--- a/amiga/dt_sound.c
+++ b/amiga/dt_sound.c
@@ -72,7 +72,7 @@ static const content_handler amiga_dt_sound_content_handler = {
static void amiga_dt_sound_play(Object *dto)
{
- LOG(("Playing..."));
+ LOG("Playing...");
IDoMethod(dto, DTM_TRIGGER, NULL, STM_PLAY, NULL);
}
@@ -122,7 +122,7 @@ nserror amiga_dt_sound_create(const content_handler *handler,
amiga_dt_sound_content *plugin;
nserror error;
- LOG(("amiga_dt_sound_create"));
+ LOG("amiga_dt_sound_create");
plugin = calloc(1, sizeof(amiga_dt_sound_content));
if (plugin == NULL)
@@ -142,7 +142,7 @@ nserror amiga_dt_sound_create(const content_handler *handler,
bool amiga_dt_sound_convert(struct content *c)
{
- LOG(("amiga_dt_sound_convert"));
+ LOG("amiga_dt_sound_convert");
amiga_dt_sound_content *plugin = (amiga_dt_sound_content *) c;
int width = 50, height = 50;
@@ -176,7 +176,7 @@ void amiga_dt_sound_destroy(struct content *c)
{
amiga_dt_sound_content *plugin = (amiga_dt_sound_content *) c;
- LOG(("amiga_dt_sound_destroy"));
+ LOG("amiga_dt_sound_destroy");
DisposeDTObject(plugin->dto);
@@ -194,7 +194,7 @@ bool amiga_dt_sound_redraw(struct content *c,
.stroke_width = 1,
};
- LOG(("amiga_dt_sound_redraw"));
+ LOG("amiga_dt_sound_redraw");
/* this should be some sort of play/stop control */
@@ -215,7 +215,7 @@ void amiga_dt_sound_open(struct content *c, struct browser_window *bw,
amiga_dt_sound_content *plugin = (amiga_dt_sound_content *) c;
struct object_param *param;
- LOG(("amiga_dt_sound_open"));
+ LOG("amiga_dt_sound_open");
plugin->immediate = false;
@@ -223,7 +223,7 @@ void amiga_dt_sound_open(struct content *c, struct browser_window *bw,
{
do
{
- LOG(("%s = %s", param->name, param->value));
+ LOG("%s = %s", param->name, param->value);
if((strcmp(param->name, "autoplay") == 0) &&
(strcmp(param->value, "true") == 0)) plugin->immediate = true;
if((strcmp(param->name, "autoStart") == 0) &&
@@ -244,7 +244,7 @@ nserror amiga_dt_sound_clone(const struct content *old, struct content **newc)
amiga_dt_sound_content *plugin;
nserror error;
- LOG(("amiga_dt_sound_clone"));
+ LOG("amiga_dt_sound_clone");
plugin = calloc(1, sizeof(amiga_dt_sound_content));
if (plugin == NULL)
diff --git a/amiga/filetype.c b/amiga/filetype.c
index aa3e29620..4419d712f 100644
--- a/amiga/filetype.c
+++ b/amiga/filetype.c
@@ -176,7 +176,7 @@ nserror ami_mime_init(const char *mimefile)
struct nsObject *node;
struct ami_mime_entry *mimeentry;
- LOG(("mimetypes file: %s", mimefile));
+ LOG("mimetypes file: %s", mimefile);
if(ami_mime_list == NULL)
ami_mime_list = NewObjList();
@@ -635,10 +635,6 @@ void ami_mime_dump(void)
struct ami_mime_entry *mimeentry;
while((mimeentry = ami_mime_entry_locate(NULL, AMI_MIME_MIMETYPE, &node))) {
- LOG(("%s DT=\"%s\" TYPE=\"%s\" CMD=\"%s\"",
- mimeentry->mimetype ? lwc_string_data(mimeentry->mimetype) : "",
- mimeentry->datatype ? lwc_string_data(mimeentry->datatype) : "",
- mimeentry->filetype ? lwc_string_data(mimeentry->filetype) : "",
- mimeentry->plugincmd ? lwc_string_data(mimeentry->plugincmd) : ""));
+ LOG("%s DT=\"%s\" TYPE=\"%s\" CMD=\"%s\"", mimeentry->mimetype ? lwc_string_data(mimeentry->mimetype) : "", mimeentry->datatype ? lwc_string_data(mimeentry->datatype) : "", mimeentry->filetype ? lwc_string_data(mimeentry->filetype) : "", mimeentry->plugincmd ? lwc_string_data(mimeentry->plugincmd) : "");
};
}
diff --git a/amiga/font.c b/amiga/font.c
index 32f12f272..6d5200f2f 100644
--- a/amiga/font.c
+++ b/amiga/font.c
@@ -361,14 +361,14 @@ static struct ami_font_node *ami_font_open(const char *font)
return nodedata;
}
- LOG(("Font cache miss: %s", font));
+ LOG("Font cache miss: %s", font);
nodedata = AllocVecTagList(sizeof(struct ami_font_node), NULL);
nodedata->font = OpenOutlineFont(font, &ami_diskfontlib_list, OFF_OPEN);
if(!nodedata->font)
{
- LOG(("Requested font not found: %s", font));
+ LOG("Requested font not found: %s", font);
warn_user("CompError", font);
FreeVec(nodedata);
return NULL;
@@ -376,21 +376,21 @@ static struct ami_font_node *ami_font_open(const char *font)
nodedata->bold = (char *)GetTagData(OT_BName, 0, nodedata->font->olf_OTagList);
if(nodedata->bold)
- LOG(("Bold font defined for %s is %s", font, nodedata->bold));
+ LOG("Bold font defined for %s is %s", font, nodedata->bold);
else
- LOG(("Warning: No designed bold font defined for %s", font));
+ LOG("Warning: No designed bold font defined for %s", font);
nodedata->italic = (char *)GetTagData(OT_IName, 0, nodedata->font->olf_OTagList);
if(nodedata->italic)
- LOG(("Italic font defined for %s is %s", font, nodedata->italic));
+ LOG("Italic font defined for %s is %s", font, nodedata->italic);
else
- LOG(("Warning: No designed italic font defined for %s", font));
+ LOG("Warning: No designed italic font defined for %s", font);
nodedata->bolditalic = (char *)GetTagData(OT_BIName, 0, nodedata->font->olf_OTagList);
if(nodedata->bolditalic)
- LOG(("Bold-italic font defined for %s is %s", font, nodedata->bolditalic));
+ LOG("Bold-italic font defined for %s is %s", font, nodedata->bolditalic);
else
- LOG(("Warning: No designed bold-italic font defined for %s", font));
+ LOG("Warning: No designed bold-italic font defined for %s", font);
GetSysTime(&nodedata->lastused);
@@ -883,7 +883,7 @@ void ami_init_fonts(void)
void ami_close_fonts(void)
{
- LOG(("Cleaning up font cache"));
+ LOG("Cleaning up font cache");
FreeObjList(ami_font_list);
ami_font_list = NULL;
ami_font_finiscanner();
@@ -915,8 +915,7 @@ static void ami_font_cleanup(struct MinList *ami_font_list)
SubTime(&curtime, &fnode->lastused);
if(curtime.Seconds > 300)
{
- LOG(("Freeing %s not used for %d seconds",
- node->dtz_Node.ln_Name, curtime.Seconds));
+ LOG("Freeing %s not used for %d seconds", node->dtz_Node.ln_Name, curtime.Seconds);
DelObject(node);
}
} while((node=nnode));
@@ -933,7 +932,7 @@ void ami_font_setdevicedpi(int id)
ULONG xdpi = nsoption_int(screen_ydpi);
if(nsoption_bool(use_diskfont) == true) {
- LOG(("WARNING: Using diskfont.library for text. Forcing DPI to 72."));
+ LOG("WARNING: Using diskfont.library for text. Forcing DPI to 72.");
nsoption_int(screen_ydpi) = 72;
}
@@ -959,8 +958,7 @@ void ami_font_setdevicedpi(int id)
xdpi = (yres * ydpi) / xres;
- LOG(("XDPI = %ld, YDPI = %ld (DisplayInfo resolution %ld x %ld, corrected %ld x %ld)",
- xdpi, ydpi, dinfo.Resolution.x, dinfo.Resolution.y, xres, yres));
+ LOG("XDPI = %ld, YDPI = %ld (DisplayInfo resolution %ld x %ld, corrected %ld x %ld)", xdpi, ydpi, dinfo.Resolution.x, dinfo.Resolution.y, xres, yres);
}
}
}
diff --git a/amiga/font_bitmap.c b/amiga/font_bitmap.c
index 8f142ae6b..90277d6e7 100644
--- a/amiga/font_bitmap.c
+++ b/amiga/font_bitmap.c
@@ -84,7 +84,7 @@ static struct TextFont *ami_font_bm_open(struct RastPort *rp, const plot_font_st
if((font = ASPrintf("%s.font", fontname))) {
tattr.ta_Name = font;
tattr.ta_YSize = fstyle->size / FONT_SIZE_SCALE;
- LOG(("font: %s/%d", tattr.ta_Name, tattr.ta_YSize));
+ LOG("font: %s/%d", tattr.ta_Name, tattr.ta_YSize);
if((bmfont = OpenDiskFont(&tattr))) {
SetRPAttrs(rp, RPTAG_Font, bmfont, TAG_DONE);
}
diff --git a/amiga/font_scan.c b/amiga/font_scan.c
index 95eacaadb..930a15020 100644
--- a/amiga/font_scan.c
+++ b/amiga/font_scan.c
@@ -254,7 +254,7 @@ static ULONG ami_font_scan_font(const char *fontname, lwc_string **glypharray)
}
#ifdef __amigaos4__
if(EObtainInfo(AMI_OFONT_ENGINE, OT_UnicodeRanges, &unicoderanges, TAG_END) == 0) {
- if(unicoderanges & UCR_SURROGATES) LOG(("%s supports UTF-16 surrogates", fontname));
+ if(unicoderanges & UCR_SURROGATES) LOG("%s supports UTF-16 surrogates", fontname);
EReleaseInfo(AMI_OFONT_ENGINE,
OT_UnicodeRanges, unicoderanges,
TAG_END);
@@ -287,10 +287,10 @@ static ULONG ami_font_scan_fonts(struct MinList *list,
do {
nnode = (struct nsObject *)GetSucc((struct Node *)node);
ami_font_scan_gui_update(win, node->dtz_Node.ln_Name, font_num, total);
- LOG(("Scanning %s", node->dtz_Node.ln_Name));
+ LOG("Scanning %s", node->dtz_Node.ln_Name);
found = ami_font_scan_font(node->dtz_Node.ln_Name, glypharray);
total += found;
- LOG(("Found %ld new glyphs (total = %ld)", found, total));
+ LOG("Found %ld new glyphs (total = %ld)", found, total);
font_num++;
} while((node = nnode));
@@ -339,7 +339,7 @@ static ULONG ami_font_scan_list(struct MinList *list)
if(node) {
node->dtz_Node.ln_Name = strdup(af[i].af_Attr.ta_Name);
found++;
- LOG(("Added %s", af[i].af_Attr.ta_Name));
+ LOG("Added %s", af[i].af_Attr.ta_Name);
}
}
}
@@ -377,7 +377,7 @@ static ULONG ami_font_scan_load(const char *filename, lwc_string **glypharray)
rargs = AllocDosObjectTags(DOS_RDARGS, TAG_DONE);
if((fh = FOpen(filename, MODE_OLDFILE, 0))) {
- LOG(("Loading font glyph cache from %s", filename));
+ LOG("Loading font glyph cache from %s", filename);
while(FGets(fh, (STRPTR)&buffer, 256) != 0)
{
@@ -418,7 +418,7 @@ void ami_font_scan_save(const char *filename, lwc_string **glypharray)
BPTR fh = 0;
if((fh = FOpen(filename, MODE_NEWFILE, 0))) {
- LOG(("Writing font glyph cache to %s", filename));
+ LOG("Writing font glyph cache to %s", filename);
FPrintf(fh, "; This file is auto-generated. To re-create the cache, delete this file.\n");
FPrintf(fh, "; This file is parsed using ReadArgs() with the following template:\n");
FPrintf(fh, "; CODE/A,FONT/A\n;\n");
@@ -498,7 +498,7 @@ void ami_font_scan_init(const char *filename, bool force_scan, bool save,
if(nsoption_bool(font_unicode_only) == false)
entries += ami_font_scan_list(list);
- LOG(("Found %ld fonts", entries));
+ LOG("Found %ld fonts", entries);
win = ami_font_scan_gui_open(entries);
found = ami_font_scan_fonts(list, win, glypharray);
@@ -511,6 +511,6 @@ void ami_font_scan_init(const char *filename, bool force_scan, bool save,
}
}
- LOG(("Initialised with %ld glyphs", found));
+ LOG("Initialised with %ld glyphs", found);
}
diff --git a/amiga/fs_backing_store.c b/amiga/fs_backing_store.c
index b6bd54c2b..9e7672eb1 100644
--- a/amiga/fs_backing_store.c
+++ b/amiga/fs_backing_store.c
@@ -310,7 +310,7 @@ static nserror ami_backing_store_finalise(void)
nserror error = ami_backing_store_send_reply(AMI_BSM_FINALISE, NULL, tempmsgport);
if(error != NSERROR_OK) return error;
- LOG(("Waiting for backing store process to exit..."));
+ LOG("Waiting for backing store process to exit...");
WaitPort(tempmsgport);
@@ -355,7 +355,7 @@ ami_backing_store_initialise(const struct llcache_store_parameters *parameters)
return NSERROR_NOMEM;
}
- LOG(("Waiting for backing store process to start up..."));
+ LOG("Waiting for backing store process to start up...");
WaitPort(tempmsgport);
@@ -365,7 +365,7 @@ ami_backing_store_initialise(const struct llcache_store_parameters *parameters)
ReplyMsg((struct Message *)msg);
FreeSysObject(ASOT_PORT, tempmsgport);
- LOG(("Backing store process started. Error code: %d", error));
+ LOG("Backing store process started. Error code: %d", error);
return error;
}
diff --git a/amiga/gui.c b/amiga/gui.c
index 41ecd3399..7f4677ece 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -304,7 +304,7 @@ bool ami_gui_map_filename(char **remapped, const char *path, const char *file, c
}
if(found == false) *remapped = strdup(file);
- else LOG(("Remapped %s to %s in path %s using %s", file, *remapped, path, map));
+ else LOG("Remapped %s to %s in path %s using %s", file, *remapped, path, map);
free(mapfile);
@@ -321,7 +321,7 @@ static bool ami_gui_check_resource(char *fullpath, const char *file)
ami_gui_map_filename(&remapped, fullpath, file, "Resource.map");
netsurf_mkpath(&fullpath, &fullpath_len, 2, fullpath, remapped);
- LOG(("Checking for %s", fullpath));
+ LOG("Checking for %s", fullpath);
lock = Lock(fullpath, ACCESS_READ);
if(lock)
@@ -330,7 +330,7 @@ static bool ami_gui_check_resource(char *fullpath, const char *file)
found = true;
}
- if(found) LOG(("Found %s", fullpath));
+ if(found) LOG("Found %s", fullpath);
free(remapped);
return found;
@@ -727,7 +727,7 @@ static void ami_openscreen(void)
}
if(screen_signal == -1) screen_signal = AllocSignal(-1);
- LOG(("Screen signal %d", screen_signal));
+ LOG("Screen signal %d", screen_signal);
scrn = OpenScreenTags(NULL,
SA_DisplayID, id,
SA_Title, ami_gui_get_screen_title(),
@@ -800,12 +800,12 @@ static void ami_gui_commandline(int *argc, char **argv)
if((args = ReadArgs(template, rarray, NULL))) {
if(rarray[A_URL]) {
- LOG(("URL %s specified on command line", rarray[A_URL]));
+ LOG("URL %s specified on command line", rarray[A_URL]);
temp_homepage_url = ami_to_utf8_easy((char *)rarray[A_URL]);
}
if(rarray[A_FORCE]) {
- LOG(("FORCE specified on command line"));
+ LOG("FORCE specified on command line");
cli_force = true;
}
@@ -823,7 +823,7 @@ static void ami_gui_commandline(int *argc, char **argv)
char **p = (char **)rarray[A_NSOPTS];
do {
- LOG(("Arg [%d] assigned to NSOPTS/M by ReadArgs: %s", new_argc, *p));
+ LOG("Arg [%d] assigned to NSOPTS/M by ReadArgs: %s", new_argc, *p);
new_argc++;
p++;
} while(*p != NULL);
@@ -844,7 +844,7 @@ static void ami_gui_commandline(int *argc, char **argv)
FreeArgs(args);
} else {
- LOG(("ReadArgs failed to parse command line"));
+ LOG("ReadArgs failed to parse command line");
}
}
@@ -2731,7 +2731,7 @@ static void ami_handle_applib(void)
{
struct ApplicationCustomMsg *applibcustmsg =
(struct ApplicationCustomMsg *)applibmsg;
- LOG(("Ringhio BackMsg received: %s", applibcustmsg->customMsg));
+ LOG("Ringhio BackMsg received: %s", applibcustmsg->customMsg);
OpenWorkbenchObjectA(applibcustmsg->customMsg, NULL);
}
break;
@@ -2765,7 +2765,7 @@ void ami_get_msg(void)
NULL, (unsigned int *)&signalmask) != -1) {
signal = signalmask;
} else {
- LOG(("waitselect() returned error"));
+ LOG("waitselect() returned error");
/* \todo Fix Ctrl-C handling.
* WaitSelect() from bsdsocket.library returns -1 if the task was
* signalled with a Ctrl-C. waitselect() from newlib.library does not.
@@ -2975,12 +2975,12 @@ static void ami_gui_close_screen(struct Screen *scrn, BOOL locked_screen, BOOL d
/* If this is our own screen, wait for visitor windows to close */
if(screen_signal != -1) {
ULONG scrnsig = 1 << screen_signal;
- LOG(("Waiting for visitor windows to close... (signal)"));
+ LOG("Waiting for visitor windows to close... (signal)");
Wait(scrnsig);
}
while (CloseScreen(scrn) == FALSE) {
- LOG(("Waiting for visitor windows to close... (polling)"));
+ LOG("Waiting for visitor windows to close... (polling)");
Delay(50);
}
@@ -3024,19 +3024,19 @@ static void gui_quit(void)
ami_close_fonts();
ami_help_free();
- LOG(("Closing screen"));
+ LOG("Closing screen");
ami_gui_close_screen(scrn, locked_screen, FALSE);
if(nsscreentitle) FreeVec(nsscreentitle);
- LOG(("Freeing menu items"));
+ LOG("Freeing menu items");
ami_context_menu_free();
ami_menu_free_glyphs();
- LOG(("Freeing mouse pointers"));
+ LOG("Freeing mouse pointers");
ami_mouse_pointers_free();
- LOG(("Freeing clipboard"));
+ LOG("Freeing clipboard");
ami_clipboard_free();
- LOG(("Removing scheduler process"));
+ LOG("Removing scheduler process");
ami_scheduler_process_delete();
FreeSysObject(ASOT_PORT, appport);
@@ -3063,7 +3063,7 @@ char *ami_gui_get_cache_favicon_name(nsurl *url, bool only_if_avail)
BPTR lock = 0;
if ((filename = ASPrintf("%s/%x", current_user_faviconcache, nsurl_hash(url)))) {
- LOG(("favicon cache location: %s", filename));
+ LOG("favicon cache location: %s", filename);
if (only_if_avail == true) {
if((lock = Lock(filename, ACCESS_READ))) {
@@ -3999,7 +3999,7 @@ gui_window_create(struct browser_window *bw,
BitMapEnd;
}
- LOG(("Creating window object"));
+ LOG("Creating window object");
g->shared->objects[OID_MAIN] = WindowObj,
WA_ScreenTitle, ami_gui_get_screen_title(),
@@ -4266,11 +4266,11 @@ gui_window_create(struct browser_window *bw,
EndWindow;
}
- LOG(("Opening window"));
+ LOG("Opening window");
g->shared->win = (struct Window *)RA_OpenWindow(g->shared->objects[OID_MAIN]);
- LOG(("Window opened, adding border gadgets"));
+ LOG("Window opened, adding border gadgets");
if(!g->shared->win)
{
@@ -4609,7 +4609,7 @@ static void ami_gui_window_update_box_deferred(struct gui_window *g, bool draw)
if(draw == true) {
ami_set_pointer(g->shared, GUI_POINTER_WAIT, false);
} else {
- LOG(("Ignoring deferred box redraw queue"));
+ LOG("Ignoring deferred box redraw queue");
}
node = (struct nsObject *)GetHead((struct List *)g->deferred_rects);
@@ -4653,7 +4653,7 @@ struct nsObject *nnode;
(new_rect->y0 <= rect->y0) &&
(new_rect->x1 >= rect->x1) &&
(new_rect->y1 >= rect->y1)) {
- LOG(("Removing queued redraw that is a subset of new box redraw"));
+ LOG("Removing queued redraw that is a subset of new box redraw");
DelObject(node);
/* Don't return - we might find more */
}
@@ -4674,7 +4674,7 @@ static void gui_window_update_box(struct gui_window *g, const struct rect *rect)
nsobj = AddObject(g->deferred_rects, AMINS_RECT);
nsobj->objstruct = deferred_rect;
} else {
- LOG(("Ignoring duplicate or subset of queued box redraw"));
+ LOG("Ignoring duplicate or subset of queued box redraw");
}
ami_schedule_redraw(g->shared, false);
}
@@ -5243,7 +5243,7 @@ Object *ami_gui_splash_open(void)
LayoutEnd,
EndWindow;
- LOG(("Attempting to open splash window..."));
+ LOG("Attempting to open splash window...");
win = RA_OpenWindow(win_obj);
GetAttrs(bm_obj, IA_Top, &top,
@@ -5307,14 +5307,14 @@ void ami_gui_splash_close(Object *win_obj)
{
if(win_obj == NULL) return;
- LOG(("Closing splash window"));
+ LOG("Closing splash window");
DisposeObject(win_obj);
}
static void gui_file_gadget_open(struct gui_window *g, hlcache_handle *hl,
struct form_control *gadget)
{
- LOG(("File open dialog request for %p/%p", g, gadget));
+ LOG("File open dialog request for %p/%p", g, gadget);
if(AslRequestTags(filereq,
ASLFR_Window, g->shared->win,
@@ -5445,8 +5445,7 @@ int main(int argc, char** argv)
popupmenu_lib_ok = FALSE;
#ifdef __amigaos4__
if((PopupMenuBase = OpenLibrary("popupmenu.library", 53))) {
- LOG(("popupmenu.library v%d.%d",
- PopupMenuBase->lib_Version, PopupMenuBase->lib_Revision));
+ LOG("popupmenu.library v%d.%d", PopupMenuBase->lib_Version, PopupMenuBase->lib_Revision);
if(LIB_IS_AT_LEAST((struct Library *)PopupMenuBase, 53, 11))
popupmenu_lib_ok = TRUE;
CloseLibrary(PopupMenuBase);
@@ -5464,7 +5463,7 @@ int main(int argc, char** argv)
user = GetVar("user", temp, 1024, GVF_GLOBAL_ONLY);
current_user = ASPrintf("%s", (user == -1) ? "Default" : temp);
- LOG(("User: %s", current_user));
+ LOG("User: %s", current_user);
current_user_dir = ASPrintf("PROGDIR:Users/%s", current_user);
if((lock = CreateDirTree(current_user_dir)))
diff --git a/amiga/misc.c b/amiga/misc.c
index 850382617..141994a31 100755
--- a/amiga/misc.c
+++ b/amiga/misc.c
@@ -51,7 +51,7 @@ static LONG ami_misc_req(const char *message, uint32 type)
{
LONG ret = 0;
- LOG(("%s", message));
+ LOG("%s", message);
#ifdef __amigaos4__
ret = TimedDosRequesterTags(
TDR_TitleString, messages_get("NetSurf"),
diff --git a/amiga/os3support.c b/amiga/os3support.c
index 243578540..cea466c94 100644
--- a/amiga/os3support.c
+++ b/amiga/os3support.c
@@ -67,7 +67,7 @@ struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG fl
/*\todo we should be opening the .font file too and checking
* for the magic bytes to indicate this is an outline font.
*/
- LOG(("Unable to open %s", otagpath));
+ LOG("Unable to open %s", otagpath);
FreeVec(otagpath);
return NULL;
}
@@ -75,7 +75,7 @@ struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG fl
size = GetFileSize(fh);
buffer = (struct TagItem *)AllocVec(size, MEMF_ANY);
if(buffer == NULL) {
- LOG(("Unable to allocate memory"));
+ LOG("Unable to allocate memory");
Close(fh);
FreeVec(otagpath);
return NULL;
@@ -87,7 +87,7 @@ struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG fl
/* The first tag is supposed to be OT_FileIdent and should equal 'size' */
struct TagItem *tag = (struct TagItem *)buffer;
if((tag->ti_Tag != OT_FileIdent) || (tag->ti_Data != (ULONG)size)) {
- LOG(("Invalid OTAG file"));
+ LOG("Invalid OTAG file");
FreeVec(buffer);
FreeVec(otagpath);
return NULL;
@@ -102,10 +102,10 @@ struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG fl
/* Find OT_Engine and open the font engine */
if(ti = FindTagItem(OT_Engine, buffer)) {
- LOG(("Using font engine %s", ti->ti_Data));
+ LOG("Using font engine %s", ti->ti_Data);
fname = ASPrintf("%s.library", ti->ti_Data);
} else {
- LOG(("Cannot find OT_Engine tag"));
+ LOG("Cannot find OT_Engine tag");
FreeVec(buffer);
FreeVec(otagpath);
return NULL;
@@ -114,7 +114,7 @@ struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG fl
BulletBase = OpenLibrary(fname, 0L);
if(BulletBase == NULL) {
- LOG(("Unable to open %s", fname));
+ LOG("Unable to open %s", fname);
FreeVec(buffer);
FreeVec(fname);
FreeVec(otagpath);
diff --git a/amiga/plotters.c b/amiga/plotters.c
index fa5f661d4..202d1b879 100644
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -99,7 +99,7 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height)
struct BitMap *friend = NULL;
depth = GetBitMapAttr(scrn->RastPort.BitMap, BMA_DEPTH);
- LOG(("Screen depth = %d", depth));
+ LOG("Screen depth = %d", depth);
if(depth < 16) {
palette_mapped = true;
@@ -207,7 +207,7 @@ static ULONG ami_plot_obtain_pen(struct MinList *shared_pens, ULONG colr)
(colr & 0x00ff0000) << 8,
NULL);
- if(pen == -1) LOG(("WARNING: Cannot allocate pen for ABGR:%lx", colr));
+ if(pen == -1) LOG("WARNING: Cannot allocate pen for ABGR:%lx", colr);
if(shared_pens != NULL) {
if((node = (struct ami_plot_pen *)AllocVecTagList(sizeof(struct ami_plot_pen), NULL))) {
@@ -280,7 +280,7 @@ void ami_plot_clear_bbox(struct RastPort *rp, struct IBox *bbox)
static bool ami_rectangle(int x0, int y0, int x1, int y1, const plot_style_t *style)
{
#ifdef AMI_PLOTTER_DEBUG
- LOG(("[ami_plotter] Entered ami_rectangle()"));
+ LOG("[ami_plotter] Entered ami_rectangle()");
#endif
if (style->fill_type != PLOT_OP_TYPE_NONE) {
@@ -325,7 +325,7 @@ static bool ami_rectangle(int x0, int y0, int x1, int y1, const plot_style_t *st
static bool ami_line(int x0, int y0, int x1, int y1, const plot_style_t *style)
{
#ifdef AMI_PLOTTER_DEBUG
- LOG(("[ami_plotter] Entered ami_line()"));
+ LOG("[ami_plotter] Entered ami_line()");
#endif
glob->rp->PenWidth = style->stroke_width;
@@ -360,21 +360,21 @@ static bool ami_line(int x0, int y0, int x1, int y1, const plot_style_t *style)
static bool ami_polygon(const int *p, unsigned int n, const plot_style_t *style)
{
#ifdef AMI_PLOTTER_DEBUG
- LOG(("[ami_plotter] Entered ami_polygon()"));
+ LOG("[ami_plotter] Entered ami_polygon()");
#endif
ami_plot_setapen(glob->rp, style->fill_colour);
if(AreaMove(glob->rp,p[0],p[1]) == -1)
- LOG(("AreaMove: vector list full"));
+ LOG("AreaMove: vector list full");
for(uint32 k = 1; k < n; k++) {
if(AreaDraw(glob->rp,p[k*2],p[(k*2)+1]) == -1)
- LOG(("AreaDraw: vector list full"));
+ LOG("AreaDraw: vector list full");
}
if(AreaEnd(glob->rp) == -1)
- LOG(("AreaEnd: error"));
+ LOG("AreaEnd: error");
return true;
}
@@ -383,7 +383,7 @@ static bool ami_polygon(const int *p, unsigned int n, const plot_style_t *style)
static bool ami_clip(const struct rect *clip)
{
#ifdef AMI_PLOTTER_DEBUG
- LOG(("[ami_plotter] Entered ami_clip()"));
+ LOG("[ami_plotter] Entered ami_clip()");
#endif
struct Region *reg = NULL;
@@ -411,7 +411,7 @@ static bool ami_text(int x, int y, const char *text, size_t length,
const plot_font_style_t *fstyle)
{
#ifdef AMI_PLOTTER_DEBUG
- LOG(("[ami_plotter] Entered ami_text()"));
+ LOG("[ami_plotter] Entered ami_text()");
#endif
bool aa = true;
@@ -428,7 +428,7 @@ static bool ami_text(int x, int y, const char *text, size_t length,
static bool ami_disc(int x, int y, int radius, const plot_style_t *style)
{
#ifdef AMI_PLOTTER_DEBUG
- LOG(("[ami_plotter] Entered ami_disc()"));
+ LOG("[ami_plotter] Entered ami_disc()");
#endif
if (style->fill_type != PLOT_OP_TYPE_NONE) {
@@ -473,7 +473,7 @@ static void ami_arc_gfxlib(int x, int y, int radius, int angle1, int angle2)
static bool ami_arc(int x, int y, int radius, int angle1, int angle2, const plot_style_t *style)
{
#ifdef AMI_PLOTTER_DEBUG
- LOG(("[ami_plotter] Entered ami_arc()"));
+ LOG("[ami_plotter] Entered ami_arc()");
#endif
if (angle2 < angle1) angle2 += 360;
@@ -487,7 +487,7 @@ static bool ami_arc(int x, int y, int radius, int angle1, int angle2, const plot
static bool ami_bitmap(int x, int y, int width, int height, struct bitmap *bitmap)
{
#ifdef AMI_PLOTTER_DEBUG
- LOG(("[ami_plotter] Entered ami_bitmap()"));
+ LOG("[ami_plotter] Entered ami_bitmap()");
#endif
struct BitMap *tbm;
@@ -504,7 +504,7 @@ static bool ami_bitmap(int x, int y, int width, int height, struct bitmap *bitma
if(!tbm) return true;
#ifdef AMI_PLOTTER_DEBUG
- LOG(("[ami_plotter] ami_bitmap() got native bitmap"));
+ LOG("[ami_plotter] ami_bitmap() got native bitmap");
#endif
#ifdef __amigaos4__
@@ -577,7 +577,7 @@ static bool ami_bitmap_tile(int x, int y, int width, int height,
bitmap_flags_t flags)
{
#ifdef AMI_PLOTTER_DEBUG
- LOG(("[ami_plotter] Entered ami_bitmap_tile()"));
+ LOG("[ami_plotter] Entered ami_bitmap_tile()");
#endif
int xf,yf,xm,ym,oy,ox;
@@ -776,14 +776,14 @@ static bool ami_path(const float *p, unsigned int n, colour fill, float width,
struct bez_point start_p = {0, 0}, cur_p = {0, 0}, p_a, p_b, p_c, p_r;
#ifdef AMI_PLOTTER_DEBUG
- LOG(("[ami_plotter] Entered ami_path()"));
+ LOG("[ami_plotter] Entered ami_path()");
#endif
if (n == 0)
return true;
if (p[0] != PLOTTER_PATH_MOVE) {
- LOG(("Path does not start with move"));
+ LOG("Path does not start with move");
return false;
}
@@ -804,7 +804,7 @@ static bool ami_path(const float *p, unsigned int n, colour fill, float width,
if (p[i] == PLOTTER_PATH_MOVE) {
if (fill != NS_TRANSPARENT) {
if(AreaMove(glob->rp, p[i+1], p[i+2]) == -1)
- LOG(("AreaMove: vector list full"));
+ LOG("AreaMove: vector list full");
} else {
Move(glob->rp, p[i+1], p[i+2]);
}
@@ -817,7 +817,7 @@ static bool ami_path(const float *p, unsigned int n, colour fill, float width,
} else if (p[i] == PLOTTER_PATH_CLOSE) {
if (fill != NS_TRANSPARENT) {
if(AreaEnd(glob->rp) == -1)
- LOG(("AreaEnd: error"));
+ LOG("AreaEnd: error");
} else {
Draw(glob->rp, start_p.x, start_p.y);
}
@@ -825,7 +825,7 @@ static bool ami_path(const float *p, unsigned int n, colour fill, float width,
} else if (p[i] == PLOTTER_PATH_LINE) {
if (fill != NS_TRANSPARENT) {
if(AreaDraw(glob->rp, p[i+1], p[i+2]) == -1)
- LOG(("AreaDraw: vector list full"));
+ LOG("AreaDraw: vector list full");
} else {
Draw(glob->rp, p[i+1], p[i+2]);
}
@@ -844,7 +844,7 @@ static bool ami_path(const float *p, unsigned int n, colour fill, float width,
ami_bezier(&cur_p, &p_a, &p_b, &p_c, t, &p_r);
if (fill != NS_TRANSPARENT) {
if(AreaDraw(glob->rp, p_r.x, p_r.y) == -1)
- LOG(("AreaDraw: vector list full"));
+ LOG("AreaDraw: vector list full");
} else {
Draw(glob->rp, p_r.x, p_r.y);
}
@@ -853,7 +853,7 @@ static bool ami_path(const float *p, unsigned int n, colour fill, float width,
cur_p.y = p_c.y;
i += 7;
} else {
- LOG(("bad path command %f", p[i]));
+ LOG("bad path command %f", p[i]);
/* End path for safety if using Area commands */
if (fill != NS_TRANSPARENT) {
AreaEnd(glob->rp);
diff --git a/amiga/plugin_hack.c b/amiga/plugin_hack.c
index 23f4d3454..ad4bfaa3e 100644
--- a/amiga/plugin_hack.c
+++ b/amiga/plugin_hack.c
@@ -79,7 +79,7 @@ nserror amiga_plugin_hack_init(void)
if(node)
{
- LOG(("plugin_hack registered %s",lwc_string_data(type)));
+ LOG("plugin_hack registered %s", lwc_string_data(type));
error = content_factory_register_handler(
lwc_string_data(type),
@@ -120,7 +120,7 @@ nserror amiga_plugin_hack_create(const content_handler *handler,
bool amiga_plugin_hack_convert(struct content *c)
{
- LOG(("amiga_plugin_hack_convert"));
+ LOG("amiga_plugin_hack_convert");
content_set_ready(c);
content_set_done(c);
@@ -134,7 +134,7 @@ void amiga_plugin_hack_destroy(struct content *c)
{
amiga_plugin_hack_content *plugin = (amiga_plugin_hack_content *) c;
- LOG(("amiga_plugin_hack_destroy %p", plugin));
+ LOG("amiga_plugin_hack_destroy %p", plugin);
return;
}
@@ -150,7 +150,7 @@ bool amiga_plugin_hack_redraw(struct content *c,
.stroke_width = 1,
};
- LOG(("amiga_plugin_hack_redraw"));
+ LOG("amiga_plugin_hack_redraw");
ctx->plot->rectangle(data->x, data->y, data->x + data->width,
data->y + data->height, &pstyle);
@@ -173,7 +173,7 @@ bool amiga_plugin_hack_redraw(struct content *c,
void amiga_plugin_hack_open(struct content *c, struct browser_window *bw,
struct content *page, struct object_params *params)
{
- LOG(("amiga_plugin_hack_open %s", nsurl_access(content_get_url(c))));
+ LOG("amiga_plugin_hack_open %s", nsurl_access(content_get_url(c)));
if(c)
{
@@ -187,13 +187,13 @@ void amiga_plugin_hack_open(struct content *c, struct browser_window *bw,
void amiga_plugin_hack_close(struct content *c)
{
- LOG(("amiga_plugin_hack_close"));
+ LOG("amiga_plugin_hack_close");
return;
}
void amiga_plugin_hack_reformat(struct content *c, int width, int height)
{
- LOG(("amiga_plugin_hack_reformat"));
+ LOG("amiga_plugin_hack_reformat");
c->width = width;
c->height = height;
@@ -206,7 +206,7 @@ nserror amiga_plugin_hack_clone(const struct content *old, struct content **newc
amiga_plugin_hack_content *plugin;
nserror error;
- LOG(("amiga_plugin_hack_clone"));
+ LOG("amiga_plugin_hack_clone");
plugin = calloc(1, sizeof(amiga_plugin_hack_content));
if (plugin == NULL)
@@ -253,7 +253,7 @@ void amiga_plugin_hack_execute(struct hlcache_handle *c)
if(full_cmd)
{
#ifdef __amigaos4__
- LOG(("Attempting to execute %s", full_cmd));
+ LOG("Attempting to execute %s", full_cmd);
in = Open("NIL:", MODE_OLDFILE);
out = Open("NIL:", MODE_NEWFILE);
diff --git a/amiga/schedule.c b/amiga/schedule.c
index 494b8b027..39b4fd9b6 100755
--- a/amiga/schedule.c
+++ b/amiga/schedule.c
@@ -554,7 +554,7 @@ nserror ami_scheduler_process_create(struct MsgPort *nsmsgport)
return NSERROR_NOMEM;
}
- LOG(("Waiting for scheduler process to start up..."));
+ LOG("Waiting for scheduler process to start up...");
WaitPort(nsmsgport);
struct ami_schedule_message *asmsg = (struct ami_schedule_message *)GetMsg(nsmsgport);
@@ -564,7 +564,7 @@ nserror ami_scheduler_process_create(struct MsgPort *nsmsgport)
ReplyMsg((struct Message *)asmsg);
}
#endif
- LOG(("Scheduler started"));
+ LOG("Scheduler started");
return NSERROR_OK;
}
diff --git a/atari/bitmap.c b/atari/bitmap.c
index 431d97dc8..a159a6659 100644
--- a/atari/bitmap.c
+++ b/atari/bitmap.c
@@ -81,8 +81,7 @@ static void *atari_bitmap_create_ex( int w, int h, short bpp, int rowstride, uns
{
struct bitmap * bitmap;
- LOG(("width %d (rowstride: %d, bpp: %d), height %d, state %u",w, rowstride,
- bpp, h, state ));
+ LOG("width %d (rowstride: %d, bpp: %d), height %d, state %u", w, rowstride, bpp, h, state);
if( rowstride == 0) {
rowstride = bpp * w;
@@ -108,10 +107,10 @@ static void *atari_bitmap_create_ex( int w, int h, short bpp, int rowstride, uns
} else {
free(bitmap);
bitmap=NULL;
- LOG(("Out of memory!"));
+ LOG("Out of memory!");
}
}
- LOG(("bitmap %p", bitmap));
+ LOG("bitmap %p", bitmap);
return bitmap;
}
@@ -195,7 +194,7 @@ static unsigned char *bitmap_get_buffer(void *bitmap)
struct bitmap *bm = bitmap;
if (bitmap == NULL) {
- LOG(("NULL bitmap!"));
+ LOG("NULL bitmap!");
return NULL;
}
@@ -219,7 +218,7 @@ size_t atari_bitmap_get_rowstride(void *bitmap)
struct bitmap *bm = bitmap;
if (bitmap == NULL) {
- LOG(("NULL bitmap!"));
+ LOG("NULL bitmap!");
return 0;
}
return bm->rowstride;
@@ -232,7 +231,7 @@ void atari_bitmap_destroy(void *bitmap)
struct bitmap *bm = bitmap;
if (bitmap == NULL) {
- LOG(("NULL bitmap!"));
+ LOG("NULL bitmap!");
return;
}
@@ -273,11 +272,11 @@ static void bitmap_set_opaque(void *bitmap, bool opaque)
struct bitmap *bm = bitmap;
if (bitmap == NULL) {
- LOG(("NULL bitmap!"));
+ LOG("NULL bitmap!");
return;
}
- LOG(("setting bitmap %p to %s", bm, opaque?"opaque":"transparent"));
+ LOG("setting bitmap %p to %s", bm, opaque ? "opaque" : "transparent");
bm->opaque = opaque;
}
@@ -294,7 +293,7 @@ static bool bitmap_test_opaque(void *bitmap)
struct bitmap *bm = bitmap;
if (bitmap == NULL) {
- LOG(("NULL bitmap!"));
+ LOG("NULL bitmap!");
return false;
}
@@ -306,11 +305,11 @@ static bool bitmap_test_opaque(void *bitmap)
while (tst-- > 0) {
if (bm->pixdata[(tst << 2) + 3] != 0xff) {
- LOG(("bitmap %p has transparency",bm));
+ LOG("bitmap %p has transparency", bm);
return false;
}
}
- LOG(("bitmap %p is opaque", bm));
+ LOG("bitmap %p is opaque", bm);
return true;
}
@@ -321,7 +320,7 @@ bool atari_bitmap_get_opaque(void *bitmap)
struct bitmap *bm = bitmap;
if (bitmap == NULL) {
- LOG(("NULL bitmap!"));
+ LOG("NULL bitmap!");
return false;
}
@@ -335,7 +334,7 @@ int atari_bitmap_get_width(void *bitmap)
struct bitmap *bm = bitmap;
if (bitmap == NULL) {
- LOG(("NULL bitmap!"));
+ LOG("NULL bitmap!");
return 0;
}
@@ -349,7 +348,7 @@ int atari_bitmap_get_height(void *bitmap)
struct bitmap *bm = bitmap;
if (bitmap == NULL) {
- LOG(("NULL bitmap!"));
+ LOG("NULL bitmap!");
return 0;
}
return(bm->height);
diff --git a/atari/certview.c b/atari/certview.c
index c5d169a41..d649c02e5 100644
--- a/atari/certview.c
+++ b/atari/certview.c
@@ -84,7 +84,7 @@ static nserror atari_sslcert_viewer_init_phase2(struct core_window *cw,
assert(ssl_d);
- LOG((""));
+ LOG("");
return(sslcert_viewer_init(cb_t, cw, ssl_d));
}
@@ -100,7 +100,7 @@ static void atari_sslcert_viewer_finish(struct core_window *cw)
/* This will also free the session data: */
sslcert_viewer_fini(cvwin->ssl_session_data);
- LOG((""));
+ LOG("");
}
static void atari_sslcert_viewer_draw(struct core_window *cw, int x,
@@ -126,7 +126,7 @@ static void atari_sslcert_viewer_keypress(struct core_window *cw, uint32_t ucs4)
cvwin = (struct atari_sslcert_viewer_s *)atari_treeview_get_user_data(cw);
- LOG(("ucs4: %lu\n", ucs4));
+ LOG("ucs4: %lu\n", ucs4);
sslcert_viewer_keypress(cvwin->ssl_session_data, ucs4);
}
@@ -153,14 +153,14 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
short retval = 0;
OBJECT *toolbar;
- LOG((""));
+ LOG("");
if(ev_out->emo_events & MU_MESAG){
switch (msg[0]) {
case WM_TOOLBAR:
toolbar = gemtk_obj_get_tree(TOOLBAR_SSL_CERT);
- LOG(("CERTVIEWER WM_TOOLBAR"));
+ LOG("CERTVIEWER WM_TOOLBAR");
tv = (struct core_window*) gemtk_wm_get_user_data(win);
assert(tv);
cvwin = (struct atari_sslcert_viewer_s *)
@@ -241,7 +241,7 @@ static void atari_sslcert_viewer_init(struct atari_sslcert_viewer_s * cvwin,
if (cvwin->tv == NULL) {
/* handle it properly, clean up previous allocs */
- LOG(("Failed to allocate treeview"));
+ LOG("Failed to allocate treeview");
return;
}
@@ -283,7 +283,7 @@ static void atari_sslcert_viewer_destroy(struct atari_sslcert_viewer_s * cvwin)
assert(cvwin->init);
assert(cvwin->window);
- LOG((""));
+ LOG("");
if (atari_treeview_is_open(cvwin->tv))
atari_treeview_close(cvwin->tv);
@@ -292,5 +292,5 @@ static void atari_sslcert_viewer_destroy(struct atari_sslcert_viewer_s * cvwin)
cvwin->window = NULL;
atari_treeview_delete(cvwin->tv);
free(cvwin);
- LOG(("done"));
+ LOG("done");
}
diff --git a/atari/cookies.c b/atari/cookies.c
index 0d4704e27..4578f38a4 100644
--- a/atari/cookies.c
+++ b/atari/cookies.c
@@ -74,13 +74,13 @@ static struct atari_treeview_callbacks atari_cookie_manager_treeview_callbacks =
static nserror atari_cookie_manager_init_phase2(struct core_window *cw,
struct core_window_callback_table *cb_t)
{
- LOG((""));
+ LOG("");
return(cookie_manager_init(cb_t, cw));
}
static void atari_cookie_manager_finish(struct core_window *cw)
{
- LOG((""));
+ LOG("");
cookie_manager_fini();
}
@@ -93,7 +93,7 @@ static void atari_cookie_manager_draw(struct core_window *cw, int x,
static void atari_cookie_manager_keypress(struct core_window *cw, uint32_t ucs4)
{
- LOG(("ucs4: %lu\n", ucs4));
+ LOG("ucs4: %lu\n", ucs4);
cookie_manager_keypress(ucs4);
}
@@ -110,13 +110,13 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
{
short retval = 0;
- LOG((""));
+ LOG("");
if(ev_out->emo_events & MU_MESAG){
switch (msg[0]) {
case WM_TOOLBAR:
- LOG(("WM_TOOLBAR"));
+ LOG("WM_TOOLBAR");
break;
case WM_CLOSED:
@@ -160,7 +160,7 @@ void atari_cookie_manager_init(void)
if (atari_cookie_manager.tv == NULL) {
/* handle it properly, clean up previous allocs */
- LOG(("Failed to allocate treeview"));
+ LOG("Failed to allocate treeview");
return;
}
@@ -211,7 +211,7 @@ void atari_cookie_manager_destroy(void)
atari_treeview_delete(atari_cookie_manager.tv);
atari_cookie_manager.init = false;
}
- LOG(("done"));
+ LOG("done");
}
diff --git a/atari/ctxmenu.c b/atari/ctxmenu.c
index 4dc17016a..7106fabfe 100644
--- a/atari/ctxmenu.c
+++ b/atari/ctxmenu.c
@@ -302,7 +302,7 @@ void context_popup(struct gui_window * gw, short x, short y)
/* the GEMDOS cmdline contains the length of the commandline
in the first byte: */
cmdline[0] = (unsigned char)strlen(tempfile);
- LOG(("Creating temporay source file: %s\n", tempfile));
+ LOG("Creating temporay source file: %s\n", tempfile);
fp_tmpfile = fopen(tempfile, "w");
if (fp_tmpfile != NULL){
fwrite(data, size, 1, fp_tmpfile);
@@ -320,7 +320,7 @@ void context_popup(struct gui_window * gw, short x, short y)
}
} else {
- LOG(("Invalid content!"));
+ LOG("Invalid content!");
}
} else {
form_alert(0, "[1][Set option \"atari_editor\".][OK]");
diff --git a/atari/deskmenu.c b/atari/deskmenu.c
index 98bb02e64..eeffacea6 100644
--- a/atari/deskmenu.c
+++ b/atari/deskmenu.c
@@ -577,14 +577,14 @@ static void register_menu_str( struct s_menu_item_evnt * mi )
while (i > 2) {
if ((strncmp(" ", &str[i], 2) == 0) && (strlen(&str[i]) > 2)) {
// "Standard" Keyboard Shortcut Element found:
- LOG(("Standard Keyboard Shortcut: \"%s\"\n", &str[i]));
+ LOG("Standard Keyboard Shortcut: \"%s\"\n", &str[i]);
x = i+2;
is_std_shortcut = true;
break;
}
if( str[i] == '['){
- LOG(("Keyboard Shortcut: \"%s\"\n", &str[i]));
+ LOG("Keyboard Shortcut: \"%s\"\n", &str[i]);
// "Custom" Keyboard Shortcut Element found (identified by [):
x = i;
break;
@@ -659,9 +659,7 @@ static void register_menu_str( struct s_menu_item_evnt * mi )
}
}
- LOG(("Registered keyboard shortcut for \"%s\" => mod: %d, "
- "keycode: %d, ascii: %c\n", str, accel->mod, accel->keycode,
- accel->ascii));
+ LOG("Registered keyboard shortcut for \"%s\" => mod: %d, ""keycode: %d, ascii: %c\n", str, accel->mod, accel->keycode, accel->ascii);
}
}
diff --git a/atari/download.c b/atari/download.c
index 7445a837d..ce56d66d3 100644
--- a/atari/download.c
+++ b/atari/download.c
@@ -197,7 +197,7 @@ static void gui_download_window_destroy( struct gui_download_window * gdw)
{
- LOG((""));
+ LOG("");
if (gdw->status == NSATARI_DOWNLOAD_WORKING) {
download_context_abort(gdw->ctx);
}
@@ -255,7 +255,7 @@ gui_download_window_create(download_context *ctx, struct gui_window *parent)
char alert[200];
- LOG(("Creating download window for gui window: %p", parent));
+ LOG("Creating download window for gui window: %p", parent);
/* TODO: Implement real form and use messages file strings! */
@@ -332,9 +332,7 @@ gui_download_window_create(download_context *ctx, struct gui_window *parent)
gemtk_wm_set_toolbar_redraw_func(gdw->guiwin, toolbar_redraw_cb);
strncpy((char*)&gdw->lbl_file, filename, MAX_SLEN_LBL_FILE-1);
- LOG(("created download: %s (total size: %d)",
- gdw->destination, gdw->size_total
- ));
+ LOG("created download: %s (total size: %d)", gdw->destination, gdw->size_total);
GRECT work, curr;
work.g_x = 0;
@@ -362,7 +360,7 @@ static nserror gui_download_window_data(struct gui_download_window *dw,
uint32_t tnow = clck / (CLOCKS_PER_SEC>>3);
uint32_t sdiff = (clck / (CLOCKS_PER_SEC)) - dw->start;
- LOG((""));
+ LOG("");
if(dw->abort == true){
dw->status = NSATARI_DOWNLOAD_CANCELED;
@@ -410,7 +408,7 @@ static nserror gui_download_window_data(struct gui_download_window *dw,
static void gui_download_window_error(struct gui_download_window *dw,
const char *error_msg)
{
- LOG(("%s", error_msg));
+ LOG("%s", error_msg);
strncpy((char*)&dw->lbl_file, error_msg, MAX_SLEN_LBL_FILE-1);
dw->status = NSATARI_DOWNLOAD_ERROR;
gemtk_wm_exec_redraw(dw->guiwin, NULL);
@@ -420,7 +418,7 @@ static void gui_download_window_error(struct gui_download_window *dw,
static void gui_download_window_done(struct gui_download_window *dw)
{
- LOG((""));
+ LOG("");
// TODO: change abort to close
dw->status = NSATARI_DOWNLOAD_COMPLETE;
diff --git a/atari/filetype.c b/atari/filetype.c
index 4e8c334f8..1cce6fc18 100644
--- a/atari/filetype.c
+++ b/atari/filetype.c
@@ -37,7 +37,7 @@ const char *fetch_filetype(const char *unix_path)
char * res = (char*)"text/html";
l = strlen(unix_path);
- LOG(("unix path: %s", unix_path));
+ LOG("unix path: %s", unix_path);
/* This line is added for devlopment versions running from the root dir: */
if( strchr( unix_path, (int)'.' ) ){
@@ -86,6 +86,6 @@ const char *fetch_filetype(const char *unix_path)
}
}
- LOG(("mime type: %s", res ));
+ LOG("mime type: %s", res);
return( res );
}
diff --git a/atari/findfile.c b/atari/findfile.c
index 60b3ed510..89f858caf 100644
--- a/atari/findfile.c
+++ b/atari/findfile.c
@@ -37,7 +37,7 @@ char * local_file_to_url( const char * filename )
#define BACKSLASH 0x5C
char * url;
- LOG(("in: %s", filename));
+ LOG("in: %s", filename);
if( strlen(filename) <= 2){
return( NULL );
@@ -61,7 +61,7 @@ char * local_file_to_url( const char * filename )
free(fname_local);
- LOG(("out: %s", url));
+ LOG("out: %s", url);
return( url );
#undef BACKSLASH
@@ -87,10 +87,10 @@ char * atari_find_resource(char *buf, const char *filename, const char *def)
{
char *cdir = NULL;
char t[PATH_MAX];
- LOG(("%s (def: %s)", filename, def ));
+ LOG("%s (def: %s)", filename, def);
strcpy(t, NETSURF_GEM_RESPATH);
strcat(t, filename);
- LOG(("checking %s", (char*)&t));
+ LOG("checking %s", (char *)&t);
if (gemdos_realpath(t, buf) != NULL) {
if (access(buf, R_OK) == 0) {
return buf;
@@ -98,7 +98,7 @@ char * atari_find_resource(char *buf, const char *filename, const char *def)
}
strcpy(t, "./");
strcat(t, filename);
- LOG(("checking %s", (char*)&t));
+ LOG("checking %s", (char *)&t);
if (gemdos_realpath(t, buf) != NULL) {
if (access(buf, R_OK) == 0) {
return buf;
@@ -110,7 +110,7 @@ char * atari_find_resource(char *buf, const char *filename, const char *def)
strcpy(t, cdir);
strcat(t, "/.netsurf/");
strcat(t, filename);
- LOG(("checking %s", (char*)&t));
+ LOG("checking %s", (char *)&t);
if (gemdos_realpath(t, buf) != NULL) {
if (access(buf, R_OK) == 0)
return buf;
@@ -122,19 +122,19 @@ char * atari_find_resource(char *buf, const char *filename, const char *def)
if (gemdos_realpath(cdir, buf) != NULL) {
strcat(buf, "/");
strcat(buf, filename);
- LOG(("checking %s", (char*)&t));
+ LOG("checking %s", (char *)&t);
if (access(buf, R_OK) == 0)
return buf;
}
}
if (def[0] == '~') {
snprintf(t, PATH_MAX, "%s%s", getenv("HOME"), def + 1);
- LOG(("checking %s", (char*)&t));
+ LOG("checking %s", (char *)&t);
if (gemdos_realpath(t, buf) == NULL) {
strcpy(buf, t);
}
} else {
- LOG(("checking %s", (char*)def));
+ LOG("checking %s", (char *)def);
if (gemdos_realpath(def, buf) == NULL) {
strcpy(buf, def);
}
diff --git a/atari/gui.c b/atari/gui.c
index daf342ae2..23d31420d 100644
--- a/atari/gui.c
+++ b/atari/gui.c
@@ -150,11 +150,11 @@ static void atari_poll(void)
evnt_multi_fast(&aes_event_in, aes_msg_out, &aes_event_out);
if(gemtk_wm_dispatch_event(&aes_event_in, &aes_event_out, aes_msg_out) == 0) {
if( (aes_event_out.emo_events & MU_MESAG) != 0 ) {
- LOG(("WM: %d\n", aes_msg_out[0]));
+ LOG("WM: %d\n", aes_msg_out[0]);
switch(aes_msg_out[0]) {
case MN_SELECTED:
- LOG(("Menu Item: %d\n",aes_msg_out[4]));
+ LOG("Menu Item: %d\n", aes_msg_out[4]);
deskmenu_dispatch_item(aes_msg_out[3], aes_msg_out[4]);
break;
@@ -206,15 +206,13 @@ gui_window_create(struct browser_window *bw,
gui_window_create_flags flags)
{
struct gui_window *gw=NULL;
- LOG(( "gw: %p, BW: %p, existing %p, flags: %d\n" , gw, bw, existing,
- (int)flags
- ));
+ LOG("gw: %p, BW: %p, existing %p, flags: %d\n", gw, bw, existing, (int)flags);
gw = calloc(1, sizeof(struct gui_window));
if (gw == NULL)
return NULL;
- LOG(("new window: %p, bw: %p\n", gw, bw));
+ LOG("new window: %p, bw: %p\n", gw, bw);
window_create(gw, bw, existing, WIDGET_STATUSBAR|WIDGET_TOOLBAR|WIDGET_RESIZE\
|WIDGET_SCROLL);
if (gw->root->win) {
@@ -266,7 +264,7 @@ void gui_window_destroy(struct gui_window *gw)
if (gw == NULL)
return;
- LOG(("%s\n", __FUNCTION__ ));
+ LOG("%s\n", __FUNCTION__);
if (input_window == gw) {
gui_set_input_gui_window(NULL);
@@ -445,7 +443,7 @@ static void gui_window_set_scroll(struct gui_window *w, int sx, int sy)
|| (!browser_window_has_content(w->browser->bw)))
return;
- LOG(("scroll (gui_window: %p) %d, %d\n", w, sx, sy));
+ LOG("scroll (gui_window: %p) %d, %d\n", w, sx, sy);
window_scroll_by(w->root, sx, sy);
return;
@@ -772,7 +770,7 @@ static void gui_401login_open(nsurl *url, const char *realm,
char * out = NULL;
bres = login_form_do( url, (char*)realm, &out);
if (bres) {
- LOG(("url: %s, realm: %s, auth: %s\n", url, realm, out ));
+ LOG("url: %s, realm: %s, auth: %s\n", url, realm, out);
urldb_set_auth_details(url, realm, out);
}
if (out != NULL) {
@@ -790,7 +788,7 @@ gui_cert_verify(nsurl *url, const struct ssl_cert_info *certs,
void *cbpw)
{
struct sslcert_session_data *data;
- LOG((""));
+ LOG("");
// TODO: localize string
int b = form_alert(1, "[2][SSL Verify failed, continue?][Continue|Abort|Details...]");
@@ -813,7 +811,7 @@ gui_cert_verify(nsurl *url, const struct ssl_cert_info *certs,
void gui_set_input_gui_window(struct gui_window *gw)
{
- LOG(("Setting input window from: %p to %p\n", input_window, gw));
+ LOG("Setting input window from: %p to %p\n", input_window, gw);
input_window = gw;
}
@@ -824,7 +822,7 @@ struct gui_window * gui_get_input_window(void)
static void gui_quit(void)
{
- LOG((""));
+ LOG("");
struct gui_window * gw = window_list;
struct gui_window * tmp = window_list;
@@ -856,9 +854,9 @@ static void gui_quit(void)
rsrc_free();
- LOG(("Shutting down plotter"));
+ LOG("Shutting down plotter");
plot_finalise();
- LOG(("done"));
+ LOG("done");
}
/**
@@ -870,7 +868,7 @@ process_cmdline(int argc, char** argv)
int opt;
bool set_default_dimensions = true;
- LOG(("argc %d, argv %p", argc, argv));
+ LOG("argc %d, argv %p", argc, argv);
if ((nsoption_int(window_width) != 0) && (nsoption_int(window_height) != 0)) {
@@ -963,7 +961,7 @@ static nserror set_defaults(struct nsoption_s *defaults)
/* Set defaults for absent option strings */
nsoption_setnull_charp(cookie_file, strdup("cookies"));
if (nsoption_charp(cookie_file) == NULL) {
- LOG(("Failed initialising string options"));
+ LOG("Failed initialising string options");
return NSERROR_BAD_PARAMETER;
}
return NSERROR_OK;
@@ -980,7 +978,7 @@ static void gui_init(int argc, char** argv)
OBJECT * cursors;
atari_find_resource(buf, "netsurf.rsc", "./res/netsurf.rsc");
- LOG(("Using RSC file: %s ", (char*)&buf));
+ LOG("Using RSC file: %s ", (char *)&buf);
if (rsrc_load(buf)==0) {
char msg[1024];
@@ -1016,15 +1014,15 @@ static void gui_init(int argc, char** argv)
create_cursor(MFORM_EX_FLAG_USERFORM, CURSOR_HELP,
cursors, &gem_cursors.help);
- LOG(("Enabling core select menu"));
+ LOG("Enabling core select menu");
nsoption_set_bool(core_select_menu, true);
- LOG(("Loading url.db from: %s", nsoption_charp(url_file) ));
+ LOG("Loading url.db from: %s", nsoption_charp(url_file));
if( strlen(nsoption_charp(url_file)) ) {
urldb_load(nsoption_charp(url_file));
}
- LOG(("Loading cookies from: %s", nsoption_charp(cookie_file) ));
+ LOG("Loading cookies from: %s", nsoption_charp(cookie_file));
if( strlen(nsoption_charp(cookie_file)) ) {
urldb_load_cookies(nsoption_charp(cookie_file));
}
@@ -1032,10 +1030,10 @@ static void gui_init(int argc, char** argv)
if (process_cmdline(argc,argv) != true)
die("unable to process command line.\n");
- LOG(("Initializing NKC..."));
+ LOG("Initializing NKC...");
nkc_init();
- LOG(("Initializing plotters..."));
+ LOG("Initializing plotters...");
plot_init(nsoption_charp(atari_font_driver));
aes_event_in.emi_m1leave = MO_LEAVE;
@@ -1172,18 +1170,18 @@ int main(int argc, char** argv)
nsoption_commandline(&argc, argv, NULL);
/* common initialisation */
- LOG(("Initialising core..."));
+ LOG("Initialising core...");
ret = netsurf_init(messages, store);
if (ret != NSERROR_OK) {
die("NetSurf failed to initialise");
}
- LOG(("Initializing GUI..."));
+ LOG("Initializing GUI...");
gui_init(argc, argv);
graf_mouse( ARROW , NULL);
- LOG(("Creating initial browser window..."));
+ LOG("Creating initial browser window...");
addr = option_homepage_url;
if (strncmp(addr, "file://", 7) && strncmp(addr, "http://", 7)) {
if (stat(addr, &stat_buf) == 0) {
@@ -1205,7 +1203,7 @@ int main(int argc, char** argv)
if (ret != NSERROR_OK) {
warn_user(messages_get_errorcode(ret), 0);
} else {
- LOG(("Entering Atari event mainloop..."));
+ LOG("Entering Atari event mainloop...");
while (!atari_quit) {
atari_poll();
}
@@ -1219,7 +1217,7 @@ int main(int argc, char** argv)
fclose(stdout);
fclose(stderr);
#endif
- LOG(("exit_gem"));
+ LOG("exit_gem");
exit_gem();
return 0;
diff --git a/atari/history.c b/atari/history.c
index cb2ba9e17..f048b0bbe 100644
--- a/atari/history.c
+++ b/atari/history.c
@@ -72,13 +72,13 @@ static struct atari_treeview_callbacks atari_global_history_treeview_callbacks =
static nserror atari_global_history_init_phase2(struct core_window *cw,
struct core_window_callback_table *cb_t)
{
- LOG((""));
+ LOG("");
return(global_history_init(cb_t, cw));
}
static void atari_global_history_finish(struct core_window *cw)
{
- LOG((""));
+ LOG("");
global_history_fini();
}
@@ -91,7 +91,7 @@ static void atari_global_history_draw(struct core_window *cw, int x,
static void atari_global_history_keypress(struct core_window *cw, uint32_t ucs4)
{
- LOG(("ucs4: %lu\n", ucs4));
+ LOG("ucs4: %lu\n", ucs4);
global_history_keypress(ucs4);
}
@@ -99,7 +99,7 @@ static void atari_global_history_mouse_action(struct core_window *cw,
browser_mouse_state mouse,
int x, int y)
{
- LOG(("x: %d, y: %d\n", x, y));
+ LOG("x: %d, y: %d\n", x, y);
global_history_mouse_action(mouse, x, y);
@@ -111,7 +111,7 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
{
short retval = 0;
- LOG((""));
+ LOG("");
if (ev_out->emo_events & MU_MESAG) {
switch (msg[0]) {
@@ -156,7 +156,7 @@ void atari_global_history_init(void)
if (atari_global_history.tv == NULL) {
/* handle it properly, clean up previous allocs */
- LOG(("Failed to allocate treeview"));
+ LOG("Failed to allocate treeview");
return;
}
}
@@ -207,7 +207,7 @@ void atari_global_history_destroy(void)
atari_treeview_delete(atari_global_history.tv);
atari_global_history.init = false;
}
- LOG(("done"));
+ LOG("done");
}
void atari_global_history_redraw(void)
diff --git a/atari/hotlist.c b/atari/hotlist.c
index 621d68891..265491191 100644
--- a/atari/hotlist.c
+++ b/atari/hotlist.c
@@ -72,13 +72,13 @@ static struct atari_treeview_callbacks atari_hotlist_treeview_callbacks = {
static nserror atari_hotlist_init_phase2(struct core_window *cw,
struct core_window_callback_table *cb_t)
{
- LOG((""));
+ LOG("");
return(hotlist_init(cb_t, cw, hl.path));
}
static void atari_hotlist_finish(struct core_window *cw)
{
- LOG((""));
+ LOG("");
hotlist_fini(hl.path);
}
@@ -93,7 +93,7 @@ static void atari_hotlist_keypress(struct core_window *cw, uint32_t ucs4)
{
GUIWIN *gemtk_win;
GRECT area;
- LOG(("ucs4: %lu\n", ucs4));
+ LOG("ucs4: %lu\n", ucs4);
hotlist_keypress(ucs4);
gemtk_win = atari_treeview_get_gemtk_window(cw);
atari_treeview_get_grect(cw, TREEVIEW_AREA_CONTENT, &area);
@@ -104,7 +104,7 @@ static void atari_hotlist_mouse_action(struct core_window *cw,
browser_mouse_state mouse,
int x, int y)
{
- LOG(("x: %d, y: %d\n", x, y));
+ LOG("x: %d, y: %d\n", x, y);
hotlist_mouse_action(mouse, x, y);
}
@@ -123,7 +123,7 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
GRECT tb_area;
GUIWIN * gemtk_win;
- LOG((""));
+ LOG("");
tv = (struct atari_treeview_window*) gemtk_wm_get_user_data(win);
cw = (struct core_window *)tv;
@@ -132,7 +132,7 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
switch (msg[0]) {
case WM_TOOLBAR:
- LOG(("WM_TOOLBAR"));
+ LOG("WM_TOOLBAR");
toolbar = gemtk_obj_get_tree(TOOLBAR_HOTLIST);
@@ -198,7 +198,7 @@ void atari_hotlist_init(void)
strncpy( (char*)&hl.path, nsoption_charp(hotlist_file), PATH_MAX-1 );
}
- LOG(("Hotlist: %s", (char*)&hl.path ));
+ LOG("Hotlist: %s", (char *)&hl.path);
if( hl.window == NULL ){
int flags = ATARI_TREEVIEW_WIDGETS;
@@ -223,7 +223,7 @@ void atari_hotlist_init(void)
if (hl.tv == NULL) {
/* handle it properly, clean up previous allocs */
- LOG(("Failed to allocate treeview"));
+ LOG("Failed to allocate treeview");
return;
}
@@ -275,7 +275,7 @@ void atari_hotlist_destroy(void)
atari_treeview_delete(hl.tv);
hl.init = false;
}
- LOG(("done"));
+ LOG("done");
}
void atari_hotlist_redraw(void)
@@ -298,7 +298,7 @@ void atari_hotlist_add_page( const char * url, const char * title )
return;
if (hotlist_has_url(nsurl)) {
- LOG(("URL already added as Bookmark"));
+ LOG("URL already added as Bookmark");
nsurl_unref(nsurl);
return;
}
diff --git a/atari/osspec.c b/atari/osspec.c
index 2f21bbefe..adf8375cb 100644
--- a/atari/osspec.c
+++ b/atari/osspec.c
@@ -117,14 +117,14 @@ char *gemdos_realpath(const char * path, char * rpath)
return(rpath);
}
- LOG(("realpath in: %s\n", path));
+ LOG("realpath in: %s\n", path);
r = realpath(path, work);
if (r != NULL) {
unx2dos((const char *)r, rpath);
- LOG(("realpath out: %s\n", rpath));
+ LOG("realpath out: %s\n", rpath);
return(rpath);
} else {
- LOG(("realpath out: NULL!\n"));
+ LOG("realpath out: NULL!\n");
}
return (NULL);
}
diff --git a/atari/plot/font_freetype.c b/atari/plot/font_freetype.c
index 086008dd7..a77aff855 100644
--- a/atari/plot/font_freetype.c
+++ b/atari/plot/font_freetype.c
@@ -154,11 +154,11 @@ static FT_Error ft_face_requester(FTC_FaceID face_id, FT_Library library, FT_Po
error = FT_New_Face(library, ft_face->fontfile, ft_face->index, face);
if (error) {
- LOG(("Could not find font (code %d)\n", error));
+ LOG("Could not find font (code %d)\n", error);
} else {
error = FT_Select_Charmap(*face, FT_ENCODING_UNICODE);
if (error) {
- LOG(("Could not select charmap (code %d)\n", error));
+ LOG("Could not select charmap (code %d)\n", error);
} else {
for (cidx = 0; cidx < (*face)->num_charmaps; cidx++) {
if ((*face)->charmap == (*face)->charmaps[cidx]) {
@@ -168,7 +168,7 @@ static FT_Error ft_face_requester(FTC_FaceID face_id, FT_Library library, FT_Po
}
}
}
- LOG(("Loaded face from %s\n", ft_face->fontfile));
+ LOG("Loaded face from %s\n", ft_face->fontfile);
return error;
}
@@ -190,7 +190,7 @@ ft_new_face(const char *option, const char *resname, const char *fontfile)
}
error = FTC_Manager_LookupFace(ft_cmanager, (FTC_FaceID)newf, &aface);
if (error) {
- LOG(("Could not find font face %s (code %d)\n", fontfile, error));
+ LOG("Could not find font face %s (code %d)\n", fontfile, error);
free(newf);
newf = font_faces[FONT_FACE_DEFAULT]; /* use default */
}
@@ -291,7 +291,7 @@ static bool ft_font_init(void)
/* freetype library initialise */
error = FT_Init_FreeType( &library );
if (error) {
- LOG(("Freetype could not initialised (code %d)\n", error));
+ LOG("Freetype could not initialised (code %d)\n", error);
return false;
}
@@ -310,7 +310,7 @@ static bool ft_font_init(void)
NULL,
&ft_cmanager);
if (error) {
- LOG(("Freetype could not initialise cache manager (code %d)\n", error));
+ LOG("Freetype could not initialise cache manager (code %d)\n", error);
FT_Done_FreeType(library);
return false;
}
@@ -329,7 +329,7 @@ static bool ft_font_init(void)
FONT_PKG_PATH FONT_FILE_SANS
);
if (font_faces[FONT_FACE_SANS_SERIF] == NULL) {
- LOG(("Could not find default font (code %d)\n", error));
+ LOG("Could not find default font (code %d)\n", error);
FTC_Manager_Done(ft_cmanager);
FT_Done_FreeType(library);
return false;
@@ -687,7 +687,7 @@ int ctor_font_plotter_freetype( FONT_PLOTTER self )
self->draw_glyph = draw_glyph8;
}
- LOG(("%s: %s\n", (char*)__FILE__, __FUNCTION__));
+ LOG("%s: %s\n", (char *)__FILE__, __FUNCTION__);
if( !init ) {
ft_font_init();
fontbmp = atari_bitmap_create(48, 48, 0);
diff --git a/atari/plot/font_internal.c b/atari/plot/font_internal.c
index 66413f49c..1578b39d6 100644
--- a/atari/plot/font_internal.c
+++ b/atari/plot/font_internal.c
@@ -95,7 +95,7 @@ int ctor_font_plotter_internal( FONT_PLOTTER self )
self->str_split = str_split;
self->pixel_pos = pixel_pos;
self->text = text;
- LOG(("%s: %s\n", (char*)__FILE__, __FUNCTION__));
+ LOG("%s: %s\n", (char *)__FILE__, __FUNCTION__);
if( !init ) {
vdih = self->vdi_handle;
fontbmp = atari_bitmap_create(48, 48, 0);
diff --git a/atari/plot/font_vdi.c b/atari/plot/font_vdi.c
index 7c186107a..ef5499207 100644
--- a/atari/plot/font_vdi.c
+++ b/atari/plot/font_vdi.c
@@ -70,7 +70,7 @@ int ctor_font_plotter_vdi( FONT_PLOTTER self )
self->str_split = str_split;
self->pixel_pos = pixel_pos;
self->text = text;
- LOG(("%s: %s\n", (char*)__FILE__, __FUNCTION__));
+ LOG("%s: %s\n", (char *)__FILE__, __FUNCTION__);
if( !init ) {
vdih = self->vdi_handle;
}
diff --git a/atari/plot/plot.c b/atari/plot/plot.c
index ac998a4d5..1ac3ee973 100644
--- a/atari/plot/plot.c
+++ b/atari/plot/plot.c
@@ -1542,7 +1542,7 @@ int plot_init(char * fdrvrname)
short work_out[57];
atari_plot_vdi_handle=graf_handle(&dummy, &dummy, &dummy, &dummy);
v_opnvwk(work_in, &atari_plot_vdi_handle, work_out);
- LOG(("Plot VDI handle: %d", atari_plot_vdi_handle));
+ LOG("Plot VDI handle: %d", atari_plot_vdi_handle);
}
read_vdi_sysinfo(atari_plot_vdi_handle, &vdi_sysinfo);
if(verbose_log) {
diff --git a/atari/rootwin.c b/atari/rootwin.c
index 7b4cd0361..c9f507167 100644
--- a/atari/rootwin.c
+++ b/atari/rootwin.c
@@ -106,7 +106,7 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
switch (msg[0]) {
case WM_REDRAW:
- LOG(("WM_REDRAW"));
+ LOG("WM_REDRAW");
on_redraw(data->rootwin, msg);
break;
@@ -114,7 +114,7 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
case WM_SIZED:
case WM_MOVED:
case WM_FULLED:
- LOG(("WM_SIZED"));
+ LOG("WM_SIZED");
on_resized(data->rootwin);
break;
@@ -133,7 +133,7 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
case WM_TOPPED:
case WM_NEWTOP:
case WM_UNICONIFY:
- LOG(("WM_TOPPED"));
+ LOG("WM_TOPPED");
gui_set_input_gui_window(data->rootwin->active_gui_window);
//window_restore_active_gui_window(data->rootwin);
// TODO: use something like "restore_active_gui_window_state()"
@@ -144,8 +144,7 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
// TODO: this needs to iterate through all gui windows and
// check if the rootwin is this window...
if (data->rootwin->active_gui_window != NULL) {
- LOG(("WM_CLOSED initiated destroy for bw %p",
- data->rootwin->active_gui_window->browser->bw));
+ LOG("WM_CLOSED initiated destroy for bw %p", data->rootwin->active_gui_window->browser->bw);
browser_window_destroy(
data->rootwin->active_gui_window->browser->bw);
}
@@ -168,14 +167,13 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
// handle key
uint16_t nkc = gem_to_norm( (short)ev_out->emo_kmeta,
(short)ev_out->emo_kreturn);
- LOG(("rootwin MU_KEYBD input, nkc: %x\n", nkc));
+ LOG("rootwin MU_KEYBD input, nkc: %x\n", nkc);
retval = on_window_key_input(data->rootwin, nkc);
// printf("on_window_key_input: %d\n", retval);
}
if ((ev_out->emo_events & MU_BUTTON) != 0) {
- LOG(("rootwin MU_BUTTON input, x: %d, y: %d\n", ev_out->emo_mouse.p_x,
- ev_out->emo_mouse.p_x));
+ LOG("rootwin MU_BUTTON input, x: %d, y: %d\n", ev_out->emo_mouse.p_x, ev_out->emo_mouse.p_x);
window_get_grect(data->rootwin, BROWSER_AREA_CONTENT,
&area);
if (POINT_WITHIN(ev_out->emo_mouse.p_x, ev_out->emo_mouse.p_y,
@@ -315,13 +313,13 @@ void window_unref_gui_window(ROOTWIN *rootwin, struct gui_window *gw)
struct gui_window *w;
input_window = NULL;
- LOG(("window: %p, gui_window: %p", rootwin, gw));
+ LOG("window: %p, gui_window: %p", rootwin, gw);
w = window_list;
// find the next active tab:
while( w != NULL ) {
if(w->root == rootwin && w != gw) {
- LOG(("activating next tab %p", w));
+ LOG("activating next tab %p", w);
gui_set_input_gui_window(w);
break;
}
@@ -341,7 +339,7 @@ int window_destroy(ROOTWIN *rootwin)
assert(rootwin != NULL);
- LOG(("%p", rootwin));
+ LOG("%p", rootwin);
if (gemtk_wm_get_user_data(rootwin->win) != NULL) {
free(gemtk_wm_get_user_data(rootwin->win));
@@ -407,7 +405,7 @@ void window_restore_active_gui_window(ROOTWIN *rootwin)
GRECT tb_area;
struct gui_window *gw;
- LOG((""));
+ LOG("");
assert(rootwin->active_gui_window);
@@ -502,7 +500,7 @@ void window_set_focus(struct s_gui_win_root *rootwin,
assert(rootwin != NULL);
if (rootwin->focus.type != type || rootwin->focus.element != element) {
- LOG(("Set focus: %p (%d)\n", element, type));
+ LOG("Set focus: %p (%d)\n", element, type);
rootwin->focus.type = type;
rootwin->focus.element = element;
switch( type ) {
@@ -566,11 +564,11 @@ void window_set_active_gui_window(ROOTWIN *rootwin, struct gui_window *gw)
{
struct gui_window *old_gw = rootwin->active_gui_window;
- LOG((""));
+ LOG("");
if (rootwin->active_gui_window != NULL) {
if(rootwin->active_gui_window == gw) {
- LOG(("nothing to do..."));
+ LOG("nothing to do...");
return;
}
}
@@ -579,7 +577,7 @@ void window_set_active_gui_window(ROOTWIN *rootwin, struct gui_window *gw)
rootwin->active_gui_window = gw;
if (old_gw != NULL) {
- LOG(("restoring window..."));
+ LOG("restoring window...");
window_restore_active_gui_window(rootwin);
}
}
@@ -654,7 +652,7 @@ void window_open_search(ROOTWIN *rootwin, bool reformat)
GRECT area;
OBJECT *obj;
- LOG((""));
+ LOG("");
gw = rootwin->active_gui_window;
bw = gw->browser->bw;
@@ -1471,10 +1469,7 @@ static void on_file_dropped(ROOTWIN *rootwin, short msg[8])
buff[size] = 0;
- LOG(("file: %s, ext: %s, size: %d dropped at: %d,%d\n",
- (char*)buff, (char*)&ext,
- size, mx, my
- ));
+ LOG("file: %s, ext: %s, size: %d dropped at: %d,%d\n", (char *)buff, (char *)&ext, size, mx, my);
gui_window_get_scroll(gw, &sx, &sy);
@@ -1496,7 +1491,7 @@ static void on_file_dropped(ROOTWIN *rootwin, short msg[8])
if (ret != NSERROR_OK) {
free(buff);
/* A bad encoding should never happen */
- LOG(("utf8_from_local_encoding failed"));
+ LOG("utf8_from_local_encoding failed");
assert(ret != NSERROR_BAD_ENCODING);
/* no memory */
goto error;
diff --git a/atari/schedule.c b/atari/schedule.c
index 4ff51d4f9..bb47cc623 100644
--- a/atari/schedule.c
+++ b/atari/schedule.c
@@ -71,7 +71,7 @@ static nserror schedule_remove(void (*callback)(void *p), void *p)
return NSERROR_OK;
}
- LOG(("removing %p, %p", callback, p));
+ LOG("removing %p, %p", callback, p);
cur_nscb = schedule_list;
prev_nscb = NULL;
@@ -80,8 +80,7 @@ static nserror schedule_remove(void (*callback)(void *p), void *p)
if ((cur_nscb->callback == callback) &&
(cur_nscb->p == p)) {
/* item to remove */
- LOG(("callback entry %p removing %p(%p)",
- cur_nscb, cur_nscb->callback, cur_nscb->p));
+ LOG("callback entry %p removing %p(%p)", cur_nscb, cur_nscb->callback, cur_nscb->p);
/* remove callback */
unlnk_nscb = cur_nscb;
@@ -119,8 +118,7 @@ nserror atari_schedule(int ival, void (*callback)(void *p), void *p)
nscb->timeout = MS_NOW() + ival;
- LOG(("adding callback %p for %p(%p) at %d ms",
- nscb, callback, p, nscb->timeout ));
+ LOG("adding callback %p for %p(%p) at %d ms", nscb, callback, p, nscb->timeout);
nscb->callback = callback;
nscb->p = p;
@@ -166,8 +164,7 @@ int schedule_run(void)
prev_nscb->next = unlnk_nscb->next;
}
- LOG(("callback entry %p running %p(%p)",
- unlnk_nscb, unlnk_nscb->callback, unlnk_nscb->p));
+ LOG("callback entry %p running %p(%p)", unlnk_nscb, unlnk_nscb->callback, unlnk_nscb->p);
/* call callback */
unlnk_nscb->callback(unlnk_nscb->p);
@@ -176,7 +173,7 @@ int schedule_run(void)
/* need to deal with callback modifying the list. */
if (schedule_list == NULL) {
- LOG(("schedule_list == NULL"));
+ LOG("schedule_list == NULL");
return -1; /* no more callbacks scheduled */
}
@@ -201,7 +198,7 @@ int schedule_run(void)
/* make rettime relative to now and convert to ms */
nexttime = nexttime - now;
- LOG(("returning time to next event as %ldms", nexttime ));
+ LOG("returning time to next event as %ldms", nexttime);
/*return next event time in milliseconds (24days max wait) */
return nexttime;
@@ -213,14 +210,14 @@ void list_schedule(void)
{
struct nscallback *cur_nscb;
- LOG(("schedule list at ms clock %ld", MS_NOW() ));
+ LOG("schedule list at ms clock %ld", MS_NOW());
cur_nscb = schedule_list;
while (cur_nscb != NULL) {
- LOG(("Schedule %p at %ld", cur_nscb, cur_nscb->timeout ));
+ LOG("Schedule %p at %ld", cur_nscb, cur_nscb->timeout);
cur_nscb = cur_nscb->next;
}
- LOG(("Maxmium callbacks scheduled: %d", max_scheduled ));
+ LOG("Maxmium callbacks scheduled: %d", max_scheduled);
}
diff --git a/atari/search.c b/atari/search.c
index c2b02f06a..8ba552198 100644
--- a/atari/search.c
+++ b/atari/search.c
@@ -67,7 +67,7 @@ struct gui_search_table *atari_search_table = &search_table;
*/
void nsatari_search_set_status(bool found, void *p)
{
- LOG(("%p set status: %d\n", p, found));
+ LOG("%p set status: %d\n", p, found);
// TODO: maybe update GUI
}
@@ -80,7 +80,7 @@ void nsatari_search_set_status(bool found, void *p)
void nsatari_search_set_hourglass(bool active, void *p)
{
SEARCH_FORM_SESSION s = (SEARCH_FORM_SESSION)p;
- LOG(("active: %d, session: %p", active, p));
+ LOG("active: %d, session: %p", active, p);
if (active) {
gui_window_set_pointer(s->g, GUI_POINTER_PROGRESS);
} else {
@@ -99,7 +99,7 @@ void nsatari_search_set_hourglass(bool active, void *p)
*/
void nsatari_search_add_recent(const char *string, void *p)
{
- LOG(("%p add recent: %s\n", p, string));
+ LOG("%p add recent: %s\n", p, string);
}
@@ -115,7 +115,7 @@ void nsatari_search_set_forward_state(bool active, void *p)
GRECT area;
SEARCH_FORM_SESSION s = (SEARCH_FORM_SESSION)p;
/* deactivate back cb */
- LOG(("%p: set forward state: %d\n", p, active));
+ LOG("%p: set forward state: %d\n", p, active);
gw = s->g;
@@ -142,7 +142,7 @@ void nsatari_search_set_back_state(bool active, void *p)
GRECT area;
SEARCH_FORM_SESSION s = (SEARCH_FORM_SESSION)p;
/* deactivate back cb */
- LOG(("%p: set back state: %d\n", p, active));
+ LOG("%p: set back state: %d\n", p, active);
s->state.back_avail = active;
gw = s->g;
@@ -224,7 +224,7 @@ void nsatari_search_restore_form( struct s_search_form_session *s, OBJECT *obj)
void nsatari_search_session_destroy(struct s_search_form_session *s)
{
if (s != NULL) {
- LOG((""));
+ LOG("");
browser_window_search_clear(s->g->browser->bw);
free(s);
}
diff --git a/atari/settings.c b/atari/settings.c
index 6a9faf190..e921da247 100644
--- a/atari/settings.c
+++ b/atari/settings.c
@@ -169,7 +169,7 @@ static char **read_locales(void)
warn_user("Failed to load locales: %s",buf);
return(NULL);
} else {
- LOG(("Reading locales from: %s...", buf));
+ LOG("Reading locales from: %s...", buf);
}
/* Count items: */
@@ -977,12 +977,12 @@ void open_settings(void)
void close_settings(void)
{
- LOG((""));
+ LOG("");
gemtk_wm_remove(settings_guiwin);
settings_guiwin = NULL;
wind_close(h_aes_win);
wind_delete(h_aes_win);
h_aes_win = 0;
- LOG(("Done"));
+ LOG("Done");
}
diff --git a/atari/statusbar.c b/atari/statusbar.c
index b10a95a0e..c9d0f78aa 100644
--- a/atari/statusbar.c
+++ b/atari/statusbar.c
@@ -166,7 +166,7 @@ CMP_STATUSBAR sb_create( struct gui_window * gw )
void sb_destroy( CMP_STATUSBAR s )
{
- LOG(("%s\n", __FUNCTION__ ));
+ LOG("%s\n", __FUNCTION__);
if( s ) {
if( s->comp ){
mt_CompDelete( &app, s->comp );
@@ -206,7 +206,7 @@ CMP_STATUSBAR sb_create( struct gui_window * gw )
void sb_destroy( CMP_STATUSBAR s )
{
- LOG(("%s\n", __FUNCTION__ ));
+ LOG("%s\n", __FUNCTION__);
if( s ) {
free( s );
}
diff --git a/atari/toolbar.c b/atari/toolbar.c
index c2e7ced06..e830679d9 100644
--- a/atari/toolbar.c
+++ b/atari/toolbar.c
@@ -272,7 +272,7 @@ struct s_toolbar *toolbar_create(struct s_gui_win_root *owner)
int i;
struct s_toolbar *t;
- LOG((""));
+ LOG("");
assert(init == true);
@@ -330,8 +330,7 @@ struct s_toolbar *toolbar_create(struct s_gui_win_root *owner)
t->throbber.max_index = THROBBER_MAX_INDEX;
t->throbber.running = false;
- LOG(("created toolbar: %p, root: %p, textarea: %p, throbber: %p", t,
- owner, t->url.textarea, t->throbber));
+ LOG("created toolbar: %p, root: %p, textarea: %p, throbber: %p", t, owner, t->url.textarea, t->throbber);
return( t );
}
@@ -459,7 +458,7 @@ void toolbar_redraw(struct s_toolbar *tb, GRECT *clip)
void toolbar_update_buttons(struct s_toolbar *tb, struct browser_window *bw,
short button)
{
- LOG((""));
+ LOG("");
struct s_tb_button * bt;
bool enable = false;
@@ -583,7 +582,7 @@ void toolbar_set_dimensions(struct s_toolbar *tb, GRECT *area)
void toolbar_set_url(struct s_toolbar *tb, const char * text)
{
- LOG((""));
+ LOG("");
textarea_set_text(tb->url.textarea, text);
if (tb->attached && tb->visible) {
@@ -668,7 +667,7 @@ bool toolbar_text_input(struct s_toolbar *tb, char *text)
{
bool handled = true;
- LOG((""));
+ LOG("");
return(handled);
}
@@ -753,7 +752,7 @@ bool toolbar_key_input(struct s_toolbar *tb, short nkc)
void toolbar_mouse_input(struct s_toolbar *tb, short obj, short button)
{
- LOG((""));
+ LOG("");
GRECT work;
short mx, my, mb, kstat;
struct gui_window * gw;
diff --git a/atari/treeview.c b/atari/treeview.c
index 2f99cbc8a..20ac3e7fe 100644
--- a/atari/treeview.c
+++ b/atari/treeview.c
@@ -326,8 +326,7 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
on_keybd_event(cw, ev_out, msg);
}
if( (ev_out->emo_events & MU_BUTTON) != 0 ) {
- LOG(("Treeview click at: %d,%d\n", ev_out->emo_mouse.p_x,
- ev_out->emo_mouse.p_y));
+ LOG("Treeview click at: %d,%d\n", ev_out->emo_mouse.p_x, ev_out->emo_mouse.p_y);
on_mbutton_event(cw, ev_out, msg);
}
@@ -528,7 +527,7 @@ atari_treeview_create(GUIWIN *win, struct atari_treeview_callbacks * callbacks,
tv = calloc(1, sizeof(struct atari_treeview_window));
if (tv == NULL) {
- LOG(("calloc failed"));
+ LOG("calloc failed");
warn_user(messages_get_errorcode(NSERROR_NOMEM), 0);
return NULL;
}
diff --git a/atari/verify_ssl.c b/atari/verify_ssl.c
index 5d3f86856..8b7525a4c 100644
--- a/atari/verify_ssl.c
+++ b/atari/verify_ssl.c
@@ -159,7 +159,7 @@ static void do_popup( WINDOW *win, int index, int mode, void *data)
char * items[dp->num_certs];
short x, y;
unsigned int i;
- LOG(("do_popup: num certs: %d", dp->num_certs));
+ LOG("do_popup: num certs: %d", dp->num_certs);
for( i = 0; i<dp->num_certs; i++) {
items[i] = malloc( 48 );
strncpy(items[i], (char*)&dp->cert_infos_n[i].issuer, 46 );
@@ -244,7 +244,7 @@ bool verify_ssl_form_do( const char * url, const struct ssl_cert_info * cert_inf
break;
case VERIFY_BT_SCROLL_R:
- LOG(( "scroll r!" ));
+ LOG("scroll r!");
cont = true;
dp.scrollx += 1;
if( dp.scrollx > (dp.cols - (272 / 8 )) )
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);
diff --git a/cocoa/DownloadWindowController.m b/cocoa/DownloadWindowController.m
index e9a13e631..df57b379a 100644
--- a/cocoa/DownloadWindowController.m
+++ b/cocoa/DownloadWindowController.m
@@ -112,7 +112,7 @@ static void cocoa_register_download( DownloadWindowController *download );
(NSString *)kLSQuarantineTypeWebDownload, (NSString *)kLSQuarantineTypeKey,
nil];
LSSetItemAttribute( &ref, kLSRolesAll, kLSItemQuarantineProperties, (CFDictionaryRef)attributes );
- LOG(("Set quarantine attributes on file %s", [path UTF8String]));
+ LOG("Set quarantine attributes on file %s", [path UTF8String]);
}
[self setOutputFile: [NSFileHandle fileHandleForWritingAtPath: path]];
diff --git a/cocoa/fetch.m b/cocoa/fetch.m
index 278b80134..1c36bb8a5 100644
--- a/cocoa/fetch.m
+++ b/cocoa/fetch.m
@@ -51,13 +51,13 @@ static const char *fetch_filetype(const char *unix_path)
uti = [[NSWorkspace sharedWorkspace] typeOfFile: [NSString stringWithUTF8String: unix_path] error:&utiError];
if (nil != uti) {
- LOG(("Looking for mimetype from uti \"%s\"", [uti UTF8String] ));
+ LOG("Looking for mimetype from uti \"%s\"", [uti UTF8String] );
mimeType = (NSString *)UTTypeCopyPreferredTagWithClass( (CFStringRef)uti, kUTTagClassMIMEType );
} else {
NSAlert *utiAlert = [NSAlert alertWithError:utiError];
[utiAlert runModal]; // Ignore return value.
- LOG(("uti call failed"));
+ LOG("uti call failed");
strncpy(cocoafiletype, "text/html", sizeof(cocoafiletype));
return cocoafiletype;
@@ -69,13 +69,13 @@ static const char *fetch_filetype(const char *unix_path)
} else {
const char *extension;
- LOG(("mimetype from uti failed"));
+ LOG("mimetype from uti failed");
extension = [(NSString *)UTTypeCopyPreferredTagWithClass( (CFStringRef)uti, kUTTagClassFilenameExtension) UTF8String];
if (extension == NULL) {
/* give up and go with default */
- LOG(("No extension going with default type"));
+ LOG("No extension going with default type");
strncpy(cocoafiletype, "text/html", sizeof(cocoafiletype)); } else {
int eidx = 0; /* index of extension entry */
@@ -90,7 +90,7 @@ static const char *fetch_filetype(const char *unix_path)
}
}
- LOG(( "\tMIME type for '%s' is '%s'", unix_path, cocoafiletype ));
+ LOG("\tMIME type for '%s' is '%s'", unix_path, cocoafiletype);
return cocoafiletype;
}
diff --git a/cocoa/plotter.m b/cocoa/plotter.m
index 61f53c192..dbc9460c4 100644
--- a/cocoa/plotter.m
+++ b/cocoa/plotter.m
@@ -201,7 +201,7 @@ static bool plot_path(const float *p, unsigned int n, colour fill, float width,
if (n == 0) return true;
if (*p != PLOTTER_PATH_MOVE) {
- LOG(("Path does not start with move"));
+ LOG("Path does not start with move");
return false;
}
@@ -236,7 +236,7 @@ static bool plot_path(const float *p, unsigned int n, colour fill, float width,
break;
default:
- LOG(("Invalid path"));
+ LOG("Invalid path");
return false;
}
}
diff --git a/content/content.c b/content/content.c
index cf0216453..057b96ee1 100644
--- a/content/content.c
+++ b/content/content.c
@@ -79,8 +79,7 @@ nserror content__init(struct content *c, const content_handler *handler,
struct content_user *user_sentinel;
nserror error;
- LOG(("url "URL_FMT_SPC" -> %p",
- nsurl_access(llcache_handle_get_url(llcache)), c));
+ LOG("url "URL_FMT_SPC" -> %p", nsurl_access(llcache_handle_get_url(llcache)), c);
user_sentinel = calloc(1, sizeof(struct content_user));
if (user_sentinel == NULL) {
@@ -280,8 +279,7 @@ void content_convert(struct content *c)
if (c->locked == true)
return;
- LOG(("content "URL_FMT_SPC" (%p)",
- nsurl_access(llcache_handle_get_url(c->llcache)), c));
+ LOG("content "URL_FMT_SPC" (%p)", nsurl_access(llcache_handle_get_url(c->llcache)), c);
if (c->handler->data_complete != NULL) {
c->locked = true;
@@ -360,7 +358,7 @@ void content__reformat(struct content *c, bool background,
assert(c->status == CONTENT_STATUS_READY ||
c->status == CONTENT_STATUS_DONE);
assert(c->locked == false);
- LOG(("%p %s", c, nsurl_access(llcache_handle_get_url(c->llcache))));
+ LOG("%p %s", c, nsurl_access(llcache_handle_get_url(c->llcache)));
c->available_width = width;
if (c->handler->reformat != NULL) {
@@ -385,8 +383,7 @@ void content_destroy(struct content *c)
struct content_rfc5988_link *link;
assert(c);
- LOG(("content %p %s", c,
- nsurl_access(llcache_handle_get_url(c->llcache))));
+ LOG("content %p %s", c, nsurl_access(llcache_handle_get_url(c->llcache)));
assert(c->locked == false);
if (c->handler->destroy != NULL)
@@ -599,7 +596,7 @@ bool content_scaled_redraw(struct hlcache_handle *h,
return true;
}
- LOG(("Content %p %dx%d ctx:%p", c, width, height, ctx));
+ LOG("Content %p %dx%d ctx:%p", c, width, height, ctx);
if (ctx->plot->option_knockout) {
knockout_plot_start(ctx, &new_ctx);
@@ -664,9 +661,7 @@ bool content_add_user(struct content *c,
{
struct content_user *user;
- LOG(("content "URL_FMT_SPC" (%p), user %p %p",
- nsurl_access(llcache_handle_get_url(c->llcache)),
- c, callback, pw));
+ LOG("content "URL_FMT_SPC" (%p), user %p %p", nsurl_access(llcache_handle_get_url(c->llcache)), c, callback, pw);
user = malloc(sizeof(struct content_user));
if (!user)
return false;
@@ -692,9 +687,7 @@ void content_remove_user(struct content *c,
void *pw)
{
struct content_user *user, *next;
- LOG(("content "URL_FMT_SPC" (%p), user %p %p",
- nsurl_access(llcache_handle_get_url(c->llcache)), c,
- callback, pw));
+ LOG("content "URL_FMT_SPC" (%p), user %p %p", nsurl_access(llcache_handle_get_url(c->llcache)), c, callback, pw);
/* user_list starts with a sentinel */
for (user = c->user_list; user->next != 0 &&
@@ -702,7 +695,7 @@ void content_remove_user(struct content *c,
user->next->pw == pw); user = user->next)
;
if (user->next == 0) {
- LOG(("user not found in list"));
+ LOG("user not found in list");
assert(0);
return;
}
@@ -808,8 +801,7 @@ void content_open(hlcache_handle *h, struct browser_window *bw,
{
struct content *c = hlcache_handle_get_content(h);
assert(c != 0);
- LOG(("content %p %s", c,
- nsurl_access(llcache_handle_get_url(c->llcache))));
+ LOG("content %p %s", c, nsurl_access(llcache_handle_get_url(c->llcache)));
if (c->handler->open != NULL)
c->handler->open(c, bw, page, params);
}
@@ -825,8 +817,7 @@ void content_close(hlcache_handle *h)
{
struct content *c = hlcache_handle_get_content(h);
assert(c != 0);
- LOG(("content %p %s", c,
- nsurl_access(llcache_handle_get_url(c->llcache))));
+ LOG("content %p %s", c, nsurl_access(llcache_handle_get_url(c->llcache)));
if (c->handler->close != NULL)
c->handler->close(c);
}
@@ -1479,7 +1470,7 @@ nserror content__clone(const struct content *c, struct content *nc)
*/
nserror content_abort(struct content *c)
{
- LOG(("Aborting %p", c));
+ LOG("Aborting %p", c);
if (c->handler->stop != NULL)
c->handler->stop(c);
diff --git a/content/fetch.c b/content/fetch.c
index 0ca90413a..158eb7c07 100644
--- a/content/fetch.c
+++ b/content/fetch.c
@@ -218,14 +218,14 @@ static void dump_rings(void)
q = queue_ring;
if (q) {
do {
- LOG(("queue_ring: %s", nsurl_access(q->url)));
+ LOG("queue_ring: %s", nsurl_access(q->url));
q = q->r_next;
} while (q != queue_ring);
}
f = fetch_ring;
if (f) {
do {
- LOG(("fetch_ring: %s", nsurl_access(f->url)));
+ LOG("fetch_ring: %s", nsurl_access(f->url));
f = f->r_next;
} while (f != fetch_ring);
}
@@ -340,9 +340,7 @@ void fetcher_quit(void)
* the reference count to allow the fetcher to
* be stopped.
*/
- LOG(("Fetcher for scheme %s still has %d active users at quit.",
- lwc_string_data(fetchers[fetcherd].scheme),
- fetchers[fetcherd].refcount));
+ LOG("Fetcher for scheme %s still has %d active users at quit.", lwc_string_data(fetchers[fetcherd].scheme), fetchers[fetcherd].refcount);
fetchers[fetcherd].refcount = 1;
}
@@ -748,9 +746,9 @@ void fetch_remove_from_queues(struct fetch *fetch)
RING_GETSIZE(struct fetch, fetch_ring, all_active);
RING_GETSIZE(struct fetch, queue_ring, all_queued);
- LOG(("Fetch ring is now %d elements.", all_active));
+ LOG("Fetch ring is now %d elements.", all_active);
- LOG(("Queue ring is now %d elements.", all_queued));
+ LOG("Queue ring is now %d elements.", all_queued);
#endif
}
diff --git a/content/fetchers/curl.c b/content/fetchers/curl.c
index b82f6b063..a2c6f2eb4 100644
--- a/content/fetchers/curl.c
+++ b/content/fetchers/curl.c
@@ -112,7 +112,7 @@ static char fetch_proxy_userpwd[100]; /**< Proxy authentication details. */
*/
static bool fetch_curl_initialise(lwc_string *scheme)
{
- LOG(("Initialise cURL fetcher for %s", lwc_string_data(scheme)));
+ LOG("Initialise cURL fetcher for %s", lwc_string_data(scheme));
curl_fetchers_registered++;
return true; /* Always succeeds */
}
@@ -128,17 +128,17 @@ static void fetch_curl_finalise(lwc_string *scheme)
struct cache_handle *h;
curl_fetchers_registered--;
- LOG(("Finalise cURL fetcher %s", lwc_string_data(scheme)));
+ LOG("Finalise cURL fetcher %s", lwc_string_data(scheme));
if (curl_fetchers_registered == 0) {
CURLMcode codem;
/* All the fetchers have been finalised. */
- LOG(("All cURL fetchers finalised, closing down cURL"));
+ LOG("All cURL fetchers finalised, closing down cURL");
curl_easy_cleanup(fetch_blank_curl);
codem = curl_multi_cleanup(fetch_curl_multi);
if (codem != CURLM_OK)
- LOG(("curl_multi_cleanup failed: ignoring"));
+ LOG("curl_multi_cleanup failed: ignoring");
curl_global_cleanup();
}
@@ -208,8 +208,7 @@ fetch_curl_post_convert(const struct fetch_multipart_data *control)
"application/octet-stream",
CURLFORM_END);
if (code != CURL_FORMADD_OK)
- LOG(("curl_formadd: %d (%s)",
- code, control->name));
+ LOG("curl_formadd: %d (%s)", code, control->name);
} else {
char *mimetype = guit->fetch->mimetype(control->value);
code = curl_formadd(&post, &last,
@@ -220,9 +219,7 @@ fetch_curl_post_convert(const struct fetch_multipart_data *control)
(mimetype != 0 ? mimetype : "text/plain"),
CURLFORM_END);
if (code != CURL_FORMADD_OK)
- LOG(("curl_formadd: %d (%s=%s)",
- code, control->name,
- control->value));
+ LOG("curl_formadd: %d (%s=%s)", code, control->name, control->value);
free(mimetype);
}
free(leafname);
@@ -233,9 +230,7 @@ fetch_curl_post_convert(const struct fetch_multipart_data *control)
CURLFORM_COPYCONTENTS, control->value,
CURLFORM_END);
if (code != CURL_FORMADD_OK)
- LOG(("curl_formadd: %d (%s=%s)", code,
- control->name,
- control->value));
+ LOG("curl_formadd: %d (%s=%s)", code, control->name, control->value);
}
}
@@ -282,7 +277,7 @@ fetch_curl_setup(struct fetch *parent_fetch,
fetch->fetch_handle = parent_fetch;
- LOG(("fetch %p, url '%s'", fetch, nsurl_access(url)));
+ LOG("fetch %p, url '%s'", fetch, nsurl_access(url));
/* construct a new fetch structure */
fetch->curl_handle = NULL;
@@ -681,7 +676,7 @@ static void fetch_curl_abort(void *vf)
{
struct curl_fetch_info *f = (struct curl_fetch_info *)vf;
assert(f);
- LOG(("fetch %p, url '%s'", f, nsurl_access(f->url)));
+ LOG("fetch %p, url '%s'", f, nsurl_access(f->url));
if (f->curl_handle) {
f->abort = true;
} else {
@@ -701,7 +696,7 @@ static void fetch_curl_stop(struct curl_fetch_info *f)
CURLMcode codem;
assert(f);
- LOG(("fetch %p, url '%s'", f, nsurl_access(f->url)));
+ LOG("fetch %p, url '%s'", f, nsurl_access(f->url));
if (f->curl_handle) {
/* remove from curl multi handle */
@@ -769,7 +764,7 @@ static bool fetch_curl_process_headers(struct curl_fetch_info *f)
assert(code == CURLE_OK);
}
http_code = f->http_code;
- LOG(("HTTP status code %li", http_code));
+ LOG("HTTP status code %li", http_code);
if (http_code == 304 && !f->post_urlenc && !f->post_multipart) {
/* Not Modified && GET request */
@@ -780,7 +775,7 @@ static bool fetch_curl_process_headers(struct curl_fetch_info *f)
/* handle HTTP redirects (3xx response codes) */
if (300 <= http_code && http_code < 400 && f->location != 0) {
- LOG(("FETCH_REDIRECT, '%s'", f->location));
+ LOG("FETCH_REDIRECT, '%s'", f->location);
msg.type = FETCH_REDIRECT;
msg.data.redirect = f->location;
fetch_send_callback(&msg, f->fetch_handle);
@@ -836,7 +831,7 @@ static void fetch_curl_done(CURL *curl_handle, CURLcode result)
assert(code == CURLE_OK);
abort_fetch = f->abort;
- LOG(("done %s", nsurl_access(f->url)));
+ LOG("done %s", nsurl_access(f->url));
if (abort_fetch == false && (result == CURLE_OK ||
(result == CURLE_WRITE_ERROR && f->stopped == false))) {
@@ -874,7 +869,7 @@ static void fetch_curl_done(CURL *curl_handle, CURLcode result)
memset(f->cert_data, 0, sizeof(f->cert_data));
cert = true;
} else {
- LOG(("Unknown cURL response code %d", result));
+ LOG("Unknown cURL response code %d", result);
error = true;
}
@@ -1007,8 +1002,7 @@ static void fetch_curl_poll(lwc_string *scheme_ignored)
do {
codem = curl_multi_perform(fetch_curl_multi, &running);
if (codem != CURLM_OK && codem != CURLM_CALL_MULTI_PERFORM) {
- LOG(("curl_multi_perform: %i %s",
- codem, curl_multi_strerror(codem)));
+ LOG("curl_multi_perform: %i %s", codem, curl_multi_strerror(codem));
warn_user("MiscError", curl_multi_strerror(codem));
return;
}
@@ -1169,7 +1163,7 @@ static size_t fetch_curl_header(char *data, size_t size, size_t nmemb,
free(f->location);
f->location = malloc(size);
if (!f->location) {
- LOG(("malloc failed"));
+ LOG("malloc failed");
return size;
}
SKIP_ST(9);
@@ -1242,17 +1236,17 @@ nserror fetch_curl_register(void)
.finalise = fetch_curl_finalise
};
- LOG(("curl_version %s", curl_version()));
+ LOG("curl_version %s", curl_version());
code = curl_global_init(CURL_GLOBAL_ALL);
if (code != CURLE_OK) {
- LOG(("curl_global_init failed."));
+ LOG("curl_global_init failed.");
return NSERROR_INIT_FAILED;
}
fetch_curl_multi = curl_multi_init();
if (!fetch_curl_multi) {
- LOG(("curl_multi_init failed."));
+ LOG("curl_multi_init failed.");
return NSERROR_INIT_FAILED;
}
@@ -1280,7 +1274,7 @@ nserror fetch_curl_register(void)
*/
fetch_blank_curl = curl_easy_init();
if (!fetch_blank_curl) {
- LOG(("curl_easy_init failed"));
+ LOG("curl_easy_init failed");
return NSERROR_INIT_FAILED;
}
@@ -1312,11 +1306,11 @@ nserror fetch_curl_register(void)
if (nsoption_charp(ca_bundle) &&
strcmp(nsoption_charp(ca_bundle), "")) {
- LOG(("ca_bundle: '%s'", nsoption_charp(ca_bundle)));
+ LOG("ca_bundle: '%s'", nsoption_charp(ca_bundle));
SETOPT(CURLOPT_CAINFO, nsoption_charp(ca_bundle));
}
if (nsoption_charp(ca_path) && strcmp(nsoption_charp(ca_path), "")) {
- LOG(("ca_path: '%s'", nsoption_charp(ca_path)));
+ LOG("ca_path: '%s'", nsoption_charp(ca_path));
SETOPT(CURLOPT_CAPATH, nsoption_charp(ca_path));
}
@@ -1328,7 +1322,7 @@ nserror fetch_curl_register(void)
curl_with_openssl = false;
}
- LOG(("cURL %slinked against openssl", curl_with_openssl ? "" : "not "));
+ LOG("cURL %slinked against openssl", curl_with_openssl ? "" : "not ");
/* cURL initialised okay, register the fetchers */
@@ -1347,20 +1341,19 @@ nserror fetch_curl_register(void)
}
if (fetcher_add(scheme, &fetcher_ops) != NSERROR_OK) {
- LOG(("Unable to register cURL fetcher for %s",
- data->protocols[i]));
+ LOG("Unable to register cURL fetcher for %s", data->protocols[i]);
}
}
return NSERROR_OK;
curl_easy_setopt_failed:
- LOG(("curl_easy_setopt failed."));
+ LOG("curl_easy_setopt failed.");
return NSERROR_INIT_FAILED;
#if LIBCURL_VERSION_NUM >= 0x071e00
curl_multi_setopt_failed:
- LOG(("curl_multi_setopt failed."));
+ LOG("curl_multi_setopt failed.");
return NSERROR_INIT_FAILED;
#endif
}
diff --git a/content/fetchers/data.c b/content/fetchers/data.c
index ecf77b048..00494ccc7 100644
--- a/content/fetchers/data.c
+++ b/content/fetchers/data.c
@@ -62,7 +62,7 @@ static CURL *curl;
static bool fetch_data_initialise(lwc_string *scheme)
{
- LOG(("fetch_data_initialise called for %s", lwc_string_data(scheme)));
+ LOG("fetch_data_initialise called for %s", lwc_string_data(scheme));
if ( (curl = curl_easy_init()) == NULL)
return false;
else
@@ -71,7 +71,7 @@ static bool fetch_data_initialise(lwc_string *scheme)
static void fetch_data_finalise(lwc_string *scheme)
{
- LOG(("fetch_data_finalise called for %s", lwc_string_data(scheme)));
+ LOG("fetch_data_finalise called for %s", lwc_string_data(scheme));
curl_easy_cleanup(curl);
}
@@ -154,7 +154,7 @@ static bool fetch_data_process(struct fetch_data_context *c)
* data must still be there.
*/
- LOG(("url: %.140s", c->url));
+ LOG("url: %.140s", c->url);
if (strlen(c->url) < 6) {
/* 6 is the minimum possible length (data:,) */
@@ -263,8 +263,7 @@ static void fetch_data_poll(lwc_string *scheme)
char header[64];
fetch_set_http_code(c->parent_fetch, 200);
- LOG(("setting data: MIME type to %s, length to %zd",
- c->mimetype, c->datalen));
+ LOG("setting data: 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_data_send_callback().
@@ -300,7 +299,7 @@ static void fetch_data_poll(lwc_string *scheme)
fetch_data_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_data_process() is broken.
diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c
index 2e7b3919a..cedb8a49f 100644
--- a/content/fs_backing_store.c
+++ b/content/fs_backing_store.c
@@ -519,11 +519,11 @@ invalidate_entry(struct store_state *state, struct store_entry *bse)
* This entry cannot be immediately removed as it has
* associated allocation so wait for allocation release.
*/
- LOG(("invalidating entry with referenced allocation"));
+ LOG("invalidating entry with referenced allocation");
return NSERROR_OK;
}
- LOG(("Removing entry for %p", bse));
+ LOG("Removing entry for %p", bse);
/* remove the entry from the index */
ret = remove_store_entry(state, &bse);
@@ -533,12 +533,12 @@ invalidate_entry(struct store_state *state, struct store_entry *bse)
ret = invalidate_element(state, bse, ENTRY_ELEM_META);
if (ret != NSERROR_OK) {
- LOG(("Error invalidating metadata element"));
+ LOG("Error invalidating metadata element");
}
ret = invalidate_element(state, bse, ENTRY_ELEM_DATA);
if (ret != NSERROR_OK) {
- LOG(("Error invalidating data element"));
+ LOG("Error invalidating data element");
}
return NSERROR_OK;
@@ -620,8 +620,8 @@ static nserror store_evict(struct store_state *state)
return NSERROR_OK;
}
- LOG(("Evicting entries to reduce %d by %d",
- state->total_alloc, state->hysteresis));
+ LOG("Evicting entries to reduce %"PRIu64" by %zd",
+ state->total_alloc, state->hysteresis);
/* allocate storage for the list */
elist = malloc(sizeof(entry_ident_t) * state->last_entry);
@@ -658,7 +658,7 @@ static nserror store_evict(struct store_state *state)
free(elist);
- LOG(("removed %d in %d entries", removed, ent));
+ LOG("removed %zd in %d entries", removed, ent);
return ret;
}
@@ -773,7 +773,7 @@ static nserror write_blocks(struct store_state *state)
&state->blocks[elem_idx][bfidx].use_map[0],
BLOCK_USE_MAP_SIZE);
if (wr != BLOCK_USE_MAP_SIZE) {
- LOG(("writing block file %d use index on file number %d failed", elem_idx, bfidx));
+ LOG("writing block file %d use index on file number %d failed", elem_idx, bfidx);
goto wr_err;
}
written += wr;
@@ -829,19 +829,19 @@ static nserror set_block_extents(struct store_state *state)
return NSERROR_OK;
}
- LOG(("Starting"));
+ LOG("Starting");
for (elem_idx = 0; elem_idx < ENTRY_ELEM_COUNT; elem_idx++) {
for (bfidx = 0; bfidx < BLOCK_FILE_COUNT; bfidx++) {
if (state->blocks[elem_idx][bfidx].fd != -1) {
/* ensure block file is correct extent */
ftr = ftruncate(state->blocks[elem_idx][bfidx].fd, 1U << (log2_block_size[elem_idx] + BLOCK_ENTRY_COUNT));
if (ftr == -1) {
- LOG(("Truncate failed errno:%d", errno));
+ LOG("Truncate failed errno:%d", errno);
}
}
}
}
- LOG(("Complete"));
+ LOG("Complete");
state->blocks_opened = false;
@@ -886,7 +886,7 @@ get_store_entry(struct store_state *state, nsurl *url, struct store_entry **bse)
entry_ident_t ident;
unsigned int sei; /* store entry index */
- LOG(("url:%s", nsurl_access(url)));
+ LOG("url:%s", nsurl_access(url));
/* use the url hash as the entry identifier */
ident = nsurl_hash(url);
@@ -894,13 +894,13 @@ get_store_entry(struct store_state *state, nsurl *url, struct store_entry **bse)
sei = BS_ENTRY_INDEX(ident, state);
if (sei == 0) {
- LOG(("Failed to find ident 0x%x in index", ident));
+ LOG("Failed to find ident 0x%x in index", ident);
return NSERROR_NOT_FOUND;
}
if (state->entries[sei].ident != ident) {
/* entry ident did not match */
- LOG(("ident did not match entry"));
+ LOG("ident did not match entry");
return NSERROR_NOT_FOUND;
}
@@ -975,7 +975,7 @@ set_store_entry(struct store_state *state,
nserror ret;
struct store_entry_element *elem;
- LOG(("url:%s", nsurl_access(url)));
+ LOG("url:%s", nsurl_access(url));
/* evict entries as required and ensure there is at least one
* new entry available.
@@ -1013,8 +1013,7 @@ set_store_entry(struct store_state *state,
* to see if the old entry is in use and if
* not prefer the newly stored entry instead?
*/
- LOG(("Entry index collision trying to replace %x with %x",
- se->ident, ident));
+ LOG("Entry index collision trying to replace %x with %x", se->ident, ident);
return NSERROR_PERMISSION;
}
}
@@ -1027,7 +1026,7 @@ set_store_entry(struct store_state *state,
/* this entry cannot be removed as it has associated
* allocation.
*/
- LOG(("attempt to overwrite entry with in use data"));
+ LOG("attempt to overwrite entry with in use data");
return NSERROR_PERMISSION;
}
@@ -1086,7 +1085,7 @@ store_open(struct store_state *state,
fname = store_fname(state, ident, elem_idx);
if (fname == NULL) {
- LOG(("filename error"));
+ LOG("filename error");
return -1;
}
@@ -1094,13 +1093,13 @@ store_open(struct store_state *state,
if (openflags & O_CREAT) {
ret = netsurf_mkdir_all(fname);
if (ret != NSERROR_OK) {
- LOG(("file path \"%s\" could not be created", fname));
+ LOG("file path \"%s\" could not be created", fname);
free(fname);
return -1;
}
}
- LOG(("opening %s", fname));
+ LOG("opening %s", fname);
fd = open(fname, openflags, S_IRUSR | S_IWUSR);
free(fname);
@@ -1127,9 +1126,9 @@ build_entrymap(struct store_state *state)
{
unsigned int eloop;
- LOG(("Allocating %d bytes for max of %d buckets",
- (1 << state->ident_bits) * sizeof(entry_index_t),
- 1 << state->ident_bits));
+ LOG("Allocating %ld bytes for max of %d buckets",
+ (1 << state->ident_bits) * sizeof(entry_index_t),
+ 1 << state->ident_bits);
state->addrmap = calloc(1 << state->ident_bits, sizeof(entry_index_t));
if (state->addrmap == NULL) {
@@ -1205,10 +1204,10 @@ read_entries(struct store_state *state)
entries_size = (1 << state->entry_bits) * sizeof(struct store_entry);
- LOG(("Allocating %d bytes for max of %d entries of %d length elements %d length",
- entries_size, 1 << state->entry_bits,
- sizeof(struct store_entry),
- sizeof(struct store_entry_element)));
+ LOG("Allocating %zd bytes for max of %d entries of %ld length elements %ld length",
+ entries_size, 1 << state->entry_bits,
+ sizeof(struct store_entry),
+ sizeof(struct store_entry_element));
state->entries = calloc(1, entries_size);
if (state->entries == NULL) {
@@ -1223,7 +1222,7 @@ read_entries(struct store_state *state)
close(fd);
if (rd > 0) {
state->last_entry = rd / sizeof(struct store_entry);
- LOG(("Read %d entries", state->last_entry));
+ LOG("Read %d entries", state->last_entry);
}
} else {
/* could rebuild entries from fs */
@@ -1254,7 +1253,7 @@ read_blocks(struct store_state *state)
return ret;
}
- LOG(("Initialising block use map from %s", fname));
+ LOG("Initialising block use map from %s", fname);
fd = open(fname, O_RDWR);
free(fname);
@@ -1266,7 +1265,7 @@ read_blocks(struct store_state *state)
&state->blocks[elem_idx][bfidx].use_map[0],
BLOCK_USE_MAP_SIZE);
if (rd <= 0) {
- LOG(("reading block file %d use index on file number %d failed", elem_idx, bfidx));
+ LOG("reading block file %d use index on file number %d failed", elem_idx, bfidx);
goto rd_err;
}
}
@@ -1275,7 +1274,7 @@ read_blocks(struct store_state *state)
close(fd);
} else {
- LOG(("Initialising block use map to defaults"));
+ LOG("Initialising block use map to defaults");
/* ensure block 0 (invalid sentinal) is skipped */
state->blocks[ENTRY_ELEM_DATA][0].use_map[0] = 1;
state->blocks[ENTRY_ELEM_META][0].use_map[0] = 1;
@@ -1345,7 +1344,7 @@ write_control(struct store_state *state)
return ret;
}
- LOG(("writing control file \"%s\"", fname));
+ LOG("writing control file \"%s\"", fname);
ret = netsurf_mkdir_all(fname);
if (ret != NSERROR_OK) {
@@ -1393,7 +1392,7 @@ read_control(struct store_state *state)
return ret;
}
- LOG(("opening control file \"%s\"", fname));
+ LOG("opening control file \"%s\"", fname);
fcontrol = fopen(fname, "rb");
@@ -1510,7 +1509,7 @@ initialise(const struct llcache_store_parameters *parameters)
/* read store control and create new if required */
ret = read_control(newstate);
if (ret != NSERROR_OK) {
- LOG(("read control failed %s", messages_get_errorcode(ret)));
+ LOG("read control failed %s", messages_get_errorcode(ret));
ret = write_control(newstate);
if (ret == NSERROR_OK) {
unlink_entries(newstate);
@@ -1559,12 +1558,15 @@ initialise(const struct llcache_store_parameters *parameters)
storestate = newstate;
- LOG(("FS backing store init successful"));
+ LOG("FS backing store init successful");
- LOG(("path:%s limit:%d hyst:%d addr:%d entries:%d",
- newstate->path, newstate->limit, newstate->hysteresis,
- newstate->ident_bits, newstate->entry_bits));
- LOG(("Using %lld/%lld", newstate->total_alloc, newstate->limit));
+ LOG("path:%s limit:%zd hyst:%zd addr:%d entries:%d",
+ newstate->path,
+ newstate->limit,
+ newstate->hysteresis,
+ newstate->ident_bits,
+ newstate->entry_bits);
+ LOG("Using %"PRIu64"/%zd", newstate->total_alloc, newstate->limit);
return NSERROR_OK;
}
@@ -1603,14 +1605,14 @@ finalise(void)
/* avoid division by zero */
if (op_count > 0) {
- LOG(("Cache total/hit/miss/fail (counts) %d/%d/%d/%d (100%%/%d%%/%d%%/%d%%)",
- op_count,
- storestate->hit_count,
- storestate->miss_count,
- 0,
- (storestate->hit_count * 100) / op_count,
- (storestate->miss_count * 100) / op_count,
- 0));
+ LOG("Cache total/hit/miss/fail (counts) %d/%zd/%zd/%d (100%%/%zd%%/%zd%%/%d%%)",
+ op_count,
+ storestate->hit_count,
+ storestate->miss_count,
+ 0,
+ (storestate->hit_count * 100) / op_count,
+ (storestate->miss_count * 100) / op_count,
+ 0);
}
free(storestate->path);
@@ -1644,7 +1646,7 @@ static nserror store_write_block(struct store_state *state,
state->blocks[elem_idx][bf].fd = store_open(state, bf,
elem_idx + ENTRY_ELEM_COUNT, O_CREAT | O_RDWR);
if (state->blocks[elem_idx][bf].fd == -1) {
- LOG(("Open failed errno %d", errno));
+ LOG("Open failed errno %d", errno);
return NSERROR_SAVE_FAILED;
}
@@ -1659,15 +1661,21 @@ static nserror store_write_block(struct store_state *state,
bse->elem[elem_idx].size,
offst);
if (wr != (ssize_t)bse->elem[elem_idx].size) {
- LOG(("Write failed %d of %d bytes from %p at 0x%x block %d errno %d",
- wr, bse->elem[elem_idx].size, bse->elem[elem_idx].data,
- offst, bse->elem[elem_idx].block, errno));
+ LOG("Write failed %zd of %d bytes from %p at 0x%jx block %d errno %d",
+ wr,
+ bse->elem[elem_idx].size,
+ bse->elem[elem_idx].data,
+ (uintmax_t)offst,
+ bse->elem[elem_idx].block,
+ errno);
return NSERROR_SAVE_FAILED;
}
- LOG(("Wrote %d bytes from %p at 0x%x block %d",
- wr, bse->elem[elem_idx].data,
- offst, bse->elem[elem_idx].block));
+ LOG("Wrote %zd bytes from %p at 0x%jx block %d",
+ wr,
+ bse->elem[elem_idx].data,
+ (uintmax_t)offst,
+ bse->elem[elem_idx].block);
return NSERROR_OK;
}
@@ -1691,7 +1699,7 @@ static nserror store_write_file(struct store_state *state,
fd = store_open(state, bse->ident, elem_idx, O_CREAT | O_WRONLY);
if (fd < 0) {
perror("");
- LOG(("Open failed %d errno %d", fd, errno));
+ LOG("Open failed %d errno %d", fd, errno);
return NSERROR_SAVE_FAILED;
}
@@ -1700,15 +1708,17 @@ static nserror store_write_file(struct store_state *state,
close(fd);
if (wr != (ssize_t)bse->elem[elem_idx].size) {
- LOG(("Write failed %d of %d bytes from %p errno %d",
- wr, bse->elem[elem_idx].size, bse->elem[elem_idx].data,
- err));
+ LOG("Write failed %zd of %d bytes from %p errno %d",
+ wr,
+ bse->elem[elem_idx].size,
+ bse->elem[elem_idx].data,
+ err);
/** @todo Delete the file? */
return NSERROR_SAVE_FAILED;
}
- LOG(("Wrote %d bytes from %p", wr, bse->elem[elem_idx].data));
+ LOG("Wrote %zd bytes from %p", wr, bse->elem[elem_idx].data);
return NSERROR_OK;
}
@@ -1749,7 +1759,7 @@ store(nsurl *url,
/* set the store entry up */
ret = set_store_entry(storestate, url, elem_idx, data, datalen, &bse);
if (ret != NSERROR_OK) {
- LOG(("store entry setting failed"));
+ LOG("store entry setting failed");
return ret;
}
@@ -1772,7 +1782,7 @@ static nserror entry_release_alloc(struct store_entry_element *elem)
if ((elem->flags & ENTRY_ELEM_FLAG_HEAP) != 0) {
elem->ref--;
if (elem->ref == 0) {
- LOG(("freeing %p", elem->data));
+ LOG("freeing %p", elem->data);
free(elem->data);
elem->flags &= ~ENTRY_ELEM_FLAG_HEAP;
}
@@ -1804,7 +1814,7 @@ static nserror store_read_block(struct store_state *state,
state->blocks[elem_idx][bf].fd = store_open(state, bf,
elem_idx + ENTRY_ELEM_COUNT, O_CREAT | O_RDWR);
if (state->blocks[elem_idx][bf].fd == -1) {
- LOG(("Open failed errno %d", errno));
+ LOG("Open failed errno %d", errno);
return NSERROR_SAVE_FAILED;
}
@@ -1819,15 +1829,21 @@ static nserror store_read_block(struct store_state *state,
bse->elem[elem_idx].size,
offst);
if (rd != (ssize_t)bse->elem[elem_idx].size) {
- LOG(("Failed reading %d of %d bytes into %p from 0x%x block %d errno %d",
- rd, bse->elem[elem_idx].size, bse->elem[elem_idx].data,
- offst, bse->elem[elem_idx].block, errno));
+ LOG("Failed reading %zd of %d bytes into %p from 0x%jx block %d errno %d",
+ rd,
+ bse->elem[elem_idx].size,
+ bse->elem[elem_idx].data,
+ (uintmax_t)offst,
+ bse->elem[elem_idx].block,
+ errno);
return NSERROR_SAVE_FAILED;
}
- LOG(("Read %d bytes into %p from 0x%x block %d",
- rd, bse->elem[elem_idx].data,
- offst, bse->elem[elem_idx].block));
+ LOG("Read %zd bytes into %p from 0x%jx block %d",
+ rd,
+ bse->elem[elem_idx].data,
+ (uintmax_t)offst,
+ bse->elem[elem_idx].block);
return NSERROR_OK;
}
@@ -1852,7 +1868,7 @@ static nserror store_read_file(struct store_state *state,
/* separate file in backing store */
fd = store_open(storestate, bse->ident, elem_idx, O_RDONLY);
if (fd < 0) {
- LOG(("Open failed %d errno %d", fd, errno));
+ LOG("Open failed %d errno %d", fd, errno);
/** @todo should this invalidate the entry? */
return NSERROR_NOT_FOUND;
}
@@ -1862,7 +1878,7 @@ static nserror store_read_file(struct store_state *state,
bse->elem[elem_idx].data + tot,
bse->elem[elem_idx].size - tot);
if (rd <= 0) {
- LOG(("read error returned %d errno %d", rd, errno));
+ LOG("read error returned %zd errno %d", rd, errno);
ret = NSERROR_NOT_FOUND;
break;
}
@@ -1871,7 +1887,7 @@ static nserror store_read_file(struct store_state *state,
close(fd);
- LOG(("Read %d bytes into %p", tot, bse->elem[elem_idx].data));
+ LOG("Read %zd bytes into %p", tot, bse->elem[elem_idx].data);
return ret;
}
@@ -1904,13 +1920,13 @@ fetch(nsurl *url,
/* fetch store entry */
ret = get_store_entry(storestate, url, &bse);
if (ret != NSERROR_OK) {
- LOG(("entry not found"));
+ LOG("entry not found");
storestate->miss_count++;
return ret;
}
storestate->hit_count++;
- LOG(("retriving cache data for url:%s", nsurl_access(url)));
+ LOG("retriving cache data for url:%s", nsurl_access(url));
/* calculate the entry element index */
if ((bsflags & BACKING_STORE_META) != 0) {
@@ -1925,17 +1941,16 @@ fetch(nsurl *url,
/* use the existing allocation and bump the ref count. */
elem->ref++;
- LOG(("Using existing entry (%p) allocation %p refs:%d",
- bse, elem->data, elem->ref));
+ LOG("Using existing entry (%p) allocation %p refs:%d", bse, elem->data, elem->ref);
} else {
/* allocate from the heap */
elem->data = malloc(elem->size);
if (elem->data == NULL) {
- LOG(("Failed to create new heap allocation"));
+ LOG("Failed to create new heap allocation");
return NSERROR_NOMEM;
}
- LOG(("Created new heap allocation %p", elem->data));
+ LOG("Created new heap allocation %p", elem->data);
/* mark the entry as having a valid heap allocation */
elem->flags |= ENTRY_ELEM_FLAG_HEAP;
@@ -1984,7 +1999,7 @@ static nserror release(nsurl *url, enum backing_store_flags bsflags)
ret = get_store_entry(storestate, url, &bse);
if (ret != NSERROR_OK) {
- LOG(("entry not found"));
+ LOG("entry not found");
return ret;
}
diff --git a/content/hlcache.c b/content/hlcache.c
index 6e991281d..388c59a94 100644
--- a/content/hlcache.c
+++ b/content/hlcache.c
@@ -191,7 +191,7 @@ static void hlcache_content_callback(struct content *c, content_msg msg,
error = handle->cb(handle, &event, handle->pw);
if (error != NSERROR_OK)
- LOG(("Error in callback: %d", error));
+ LOG("Error in callback: %d", error);
}
/**
@@ -560,7 +560,7 @@ void hlcache_finalise(void)
num_contents++;
}
- LOG(("%d contents remain before cache drain", num_contents));
+ LOG("%d contents remain before cache drain", num_contents);
/* Drain cache */
do {
@@ -574,17 +574,14 @@ void hlcache_finalise(void)
}
} while (num_contents > 0 && num_contents != prev_contents);
- LOG(("%d contents remaining:", num_contents));
+ LOG("%d contents remaining:", num_contents);
for (entry = hlcache->content_list; entry != NULL; entry = entry->next) {
hlcache_handle entry_handle = { entry, NULL, NULL };
if (entry->content != NULL) {
- LOG((" %p : %s (%d users)", entry,
- nsurl_access(
- hlcache_handle_get_url(&entry_handle)),
- content_count_users(entry->content)));
+ LOG(" %p : %s (%d users)", entry, nsurl_access(hlcache_handle_get_url(&entry_handle)), content_count_users(entry->content));
} else {
- LOG((" %p", entry));
+ LOG(" %p", entry);
}
}
@@ -612,12 +609,12 @@ void hlcache_finalise(void)
hlcache->retrieval_ctx_ring = NULL;
}
- LOG(("hit/miss %d/%d", hlcache->hit_count, hlcache->miss_count));
+ LOG("hit/miss %d/%d", hlcache->hit_count, hlcache->miss_count);
free(hlcache);
hlcache = NULL;
- LOG(("Finalising low-level cache"));
+ LOG("Finalising low-level cache");
llcache_finalise();
}
diff --git a/content/llcache.c b/content/llcache.c
index 046dd1ae4..219e315b3 100644
--- a/content/llcache.c
+++ b/content/llcache.c
@@ -1294,13 +1294,13 @@ llcache_serialise_metadata(llcache_object *object,
overflow:
/* somehow we overflowed the buffer - hth? */
- LOG(("Overflowed metadata buffer"));
+ LOG("Overflowed metadata buffer");
free(data);
return NSERROR_INVALID;
operror:
/* output error */
- LOG(("Output error"));
+ LOG("Output error");
free(data);
return NSERROR_INVALID;
}
@@ -1338,7 +1338,7 @@ llcache_process_metadata(llcache_object *object)
size_t num_headers;
size_t hloop;
- LOG(("Retriving metadata"));
+ LOG("Retriving metadata");
/* attempt to retrieve object metadata from the backing store */
res = guit->llcache->fetch(object->url,
@@ -1351,7 +1351,7 @@ llcache_process_metadata(llcache_object *object)
end = metadata + metadatalen;
- LOG(("Processing retrived data"));
+ LOG("Processing retrived data");
/* metadata line 1 is the url the metadata referrs to */
line = 1;
@@ -1374,9 +1374,7 @@ llcache_process_metadata(llcache_object *object)
* by simply skipping caching of this object.
*/
- LOG(("Got metadata for %s instead of %s",
- nsurl_access(metadataurl),
- nsurl_access(object->url)));
+ LOG("Got metadata for %s instead of %s", nsurl_access(metadataurl), nsurl_access(object->url));
nsurl_unref(metadataurl);
@@ -1469,7 +1467,7 @@ llcache_process_metadata(llcache_object *object)
return NSERROR_OK;
format_error:
- LOG(("metadata error on line %d error code %d\n", line, res));
+ LOG("metadata error on line %d error code %d\n", line, res);
guit->llcache->release(object->url, BACKING_STORE_META);
return res;
@@ -1859,7 +1857,7 @@ static nserror llcache_fetch_redirect(llcache_object *object, const char *target
/* Forcibly stop redirecting if we've followed too many redirects */
#define REDIRECT_LIMIT 10
if (object->fetch.redirect_count > REDIRECT_LIMIT) {
- LOG(("Too many nested redirects"));
+ LOG("Too many nested redirects");
event.type = LLCACHE_EVENT_ERROR;
event.data.msg = messages_get("BadRedirect");
@@ -2444,9 +2442,8 @@ static void llcache_persist_slowcheck(void *p)
total_bandwidth = (llcache->total_written * 1000) / llcache->total_elapsed;
if (total_bandwidth < llcache->minimum_bandwidth) {
- LOG(("Current bandwidth %llu less than minimum %llu",
- total_bandwidth, llcache->minimum_bandwidth));
- LOG(("Disabling disc cache; too slow"));
+ LOG("Current bandwidth %"PRIu64" less than minimum %zd",
+ total_bandwidth, llcache->minimum_bandwidth);
guit->llcache->finalise();
}
}
@@ -2502,7 +2499,7 @@ static void llcache_persist(void *p)
* (bandwidth) for this run being exceeded.
*/
if (total_elapsed > llcache->time_quantum) {
- LOG(("Overran timeslot"));
+ LOG("Overran timeslot");
/* writeout has exhausted the available time.
* Either the writeout is slow or the last
* object was very large.
@@ -2858,12 +2855,11 @@ static nserror llcache_object_notify_users(llcache_object *object)
#ifdef LLCACHE_TRACE
if (handle->state != objstate) {
if (emitted_notify == false) {
- LOG(("Notifying users of %p", object));
+ LOG("Notifying users of %p", object);
emitted_notify = true;
}
- LOG(("User %p state: %d Object state: %d",
- user, handle->state, objstate));
+ LOG("User %p state: %d Object state: %d", user, handle->state, objstate);
}
#endif
@@ -3296,7 +3292,7 @@ llcache_initialise(const struct llcache_parameters *prm)
llcache->time_quantum = prm->time_quantum;
llcache->all_caught_up = true;
- LOG(("llcache initialising with a limit of %d bytes", llcache->limit));
+ LOG("llcache initialising with a limit of %d bytes", llcache->limit);
/* backing store initialisation */
return guit->llcache->initialise(&prm->store);
@@ -3359,10 +3355,7 @@ void llcache_finalise(void)
llcache->total_elapsed;
}
- LOG(("Backing store wrote %"PRIu64" bytes in %"PRIu64" ms "
- "(average %"PRIu64" bytes/second)",
- llcache->total_written, llcache->total_elapsed,
- total_bandwidth));
+ LOG("Backing store wrote %"PRIu64" bytes in %"PRIu64" ms ""(average %"PRIu64" bytes/second)", llcache->total_written, llcache->total_elapsed, total_bandwidth);
free(llcache);
llcache = NULL;
diff --git a/content/urldb.c b/content/urldb.c
index a9476d72a..272f080c8 100644
--- a/content/urldb.c
+++ b/content/urldb.c
@@ -564,7 +564,7 @@ static bool urldb__host_is_ip_address(const char *host)
c[slash - host] = '\0';
sane_host = c;
host_len = slash - host - 1;
- LOG(("WARNING: called with non-host '%s'", host));
+ LOG("WARNING: called with non-host '%s'", host);
}
if (strspn(sane_host, "0123456789abcdefABCDEF[].:") < host_len)
@@ -1152,7 +1152,7 @@ static struct path_data *urldb_match_path(const struct path_data *parent,
assert(parent->segment == NULL);
if (path[0] != '/') {
- LOG(("path is %s", path));
+ LOG("path is %s", path);
}
assert(path[0] == '/');
@@ -1278,12 +1278,12 @@ static void urldb_dump_paths(struct path_data *parent)
do {
if (p->segment != NULL) {
- LOG(("\t%s : %u", lwc_string_data(p->scheme), p->port));
+ LOG("\t%s : %u", lwc_string_data(p->scheme), p->port);
- LOG(("\t\t'%s'", p->segment));
+ LOG("\t\t'%s'", p->segment);
for (i = 0; i != p->frag_cnt; i++)
- LOG(("\t\t\t#%s", p->fragment[i]));
+ LOG("\t\t\t#%s", p->fragment[i]);
}
if (p->children != NULL) {
@@ -1312,10 +1312,9 @@ static void urldb_dump_hosts(struct host_part *parent)
struct host_part *h;
if (parent->part) {
- LOG(("%s", parent->part));
+ LOG("%s", parent->part);
- LOG(("\t%s invalid SSL certs",
- parent->permit_invalid_certs ? "Permits" : "Denies"));
+ LOG("\t%s invalid SSL certs", parent->permit_invalid_certs ? "Permits" : "Denies");
}
/* Dump path data */
@@ -2493,14 +2492,14 @@ nserror urldb_load(const char *filename)
assert(filename);
- LOG(("Loading URL file %s", filename));
+ LOG("Loading URL file %s", filename);
if (url_bloom == NULL)
url_bloom = bloom_create(BLOOM_SIZE);
fp = fopen(filename, "r");
if (!fp) {
- LOG(("Failed to open file '%s' for reading", filename));
+ LOG("Failed to open file '%s' for reading", filename);
return NSERROR_NOT_FOUND;
}
@@ -2511,12 +2510,12 @@ nserror urldb_load(const char *filename)
version = atoi(s);
if (version < MIN_URL_FILE_VERSION) {
- LOG(("Unsupported URL file version."));
+ LOG("Unsupported URL file version.");
fclose(fp);
return NSERROR_INVALID;
}
if (version > URL_FILE_VERSION) {
- LOG(("Unknown URL file version."));
+ LOG("Unknown URL file version.");
fclose(fp);
return NSERROR_INVALID;
}
@@ -2546,13 +2545,13 @@ nserror urldb_load(const char *filename)
/* no URLs => try next host */
if (urls == 0) {
- LOG(("No URLs for '%s'", host));
+ LOG("No URLs for '%s'", host);
continue;
}
h = urldb_add_host(host);
if (!h) {
- LOG(("Failed adding host: '%s'", host));
+ LOG("Failed adding host: '%s'", host);
fclose(fp);
return NSERROR_NOMEM;
}
@@ -2603,7 +2602,7 @@ nserror urldb_load(const char *filename)
* Need a nsurl_save too.
*/
if (nsurl_create(url, &nsurl) != NSERROR_OK) {
- LOG(("Failed inserting '%s'", url));
+ LOG("Failed inserting '%s'", url);
fclose(fp);
return NSERROR_NOMEM;
}
@@ -2616,7 +2615,7 @@ nserror urldb_load(const char *filename)
/* Copy and merge path/query strings */
if (nsurl_get(nsurl, NSURL_PATH | NSURL_QUERY,
&path_query, &len) != NSERROR_OK) {
- LOG(("Failed inserting '%s'", url));
+ LOG("Failed inserting '%s'", url);
fclose(fp);
return NSERROR_NOMEM;
}
@@ -2627,7 +2626,7 @@ nserror urldb_load(const char *filename)
p = urldb_add_path(scheme_lwc, port, h, path_query,
fragment_lwc, nsurl);
if (!p) {
- LOG(("Failed inserting '%s'", url));
+ LOG("Failed inserting '%s'", url);
fclose(fp);
return NSERROR_NOMEM;
}
@@ -2668,7 +2667,7 @@ nserror urldb_load(const char *filename)
}
fclose(fp);
- LOG(("Successfully loaded URL file"));
+ LOG("Successfully loaded URL file");
#undef MAXIMUM_URL_LENGTH
return NSERROR_OK;
@@ -2684,7 +2683,7 @@ nserror urldb_save(const char *filename)
fp = fopen(filename, "w");
if (!fp) {
- LOG(("Failed to open file '%s' for writing", filename));
+ LOG("Failed to open file '%s' for writing", filename);
return NSERROR_SAVE_FAILED;
}
@@ -3065,7 +3064,7 @@ void urldb_set_thumbnail(nsurl *url, struct bitmap *bitmap)
p = urldb_find_url(url);
if (p != NULL) {
- LOG(("Setting bitmap on %s", nsurl_access(url)));
+ LOG("Setting bitmap on %s", nsurl_access(url));
if (p->thumb && p->thumb != bitmap) {
guit->bitmap->destroy(p->thumb);
@@ -3773,7 +3772,7 @@ void urldb_load_cookies(const char *filename)
if (loaded_cookie_file_version <
MIN_COOKIE_FILE_VERSION) {
- LOG(("Unsupported Cookie file version"));
+ LOG("Unsupported Cookie file version");
break;
}
diff --git a/css/css.c b/css/css.c
index 641d988ad..acbc14a14 100644
--- a/css/css.c
+++ b/css/css.c
@@ -326,9 +326,9 @@ static css_error nscss_convert_css_data(struct content_css_data *c)
const char *url;
if (css_stylesheet_get_url(c->sheet, &url) == CSS_OK) {
- LOG(("Failed converting %p %s (%d)", c, url, error));
+ LOG("Failed converting %p %s (%d)", c, url, error);
} else {
- LOG(("Failed converting %p (%d)", c, error));
+ LOG("Failed converting %p (%d)", c, error);
}
}
@@ -616,9 +616,7 @@ css_error nscss_handle_import(void *pw, css_stylesheet *parent,
nsurl_unref(ns_ref);
#ifdef NSCSS_IMPORT_TRACE
- LOG(("Import %d '%s' -> (handle: %p ctx: %p)",
- c->import_count, lwc_string_data(url),
- c->imports[c->import_count].c, ctx));
+ LOG("Import %d '%s' -> (handle: %p ctx: %p)", c->import_count, lwc_string_data(url), c->imports[c->import_count].c, ctx);
#endif
c->import_count++;
@@ -641,7 +639,7 @@ nserror nscss_import(hlcache_handle *handle,
css_error error = CSS_OK;
#ifdef NSCSS_IMPORT_TRACE
- LOG(("Event %d for %p (%p)", event->type, handle, ctx));
+ LOG("Event %d for %p (%p)", event->type, handle, ctx);
#endif
assert(ctx->css->imports[ctx->index].c == handle);
@@ -682,7 +680,7 @@ css_error nscss_import_complete(nscss_import_ctx *ctx)
error = nscss_register_imports(ctx->css);
#ifdef NSCSS_IMPORT_TRACE
- LOG(("Destroying import context %p for %d", ctx, ctx->index));
+ LOG("Destroying import context %p for %d", ctx, ctx->index);
#endif
/* No longer need import context */
diff --git a/css/select.c b/css/select.c
index b94bcac4f..f4570f7c2 100644
--- a/css/select.c
+++ b/css/select.c
@@ -190,20 +190,20 @@ css_stylesheet *nscss_create_inline_style(const uint8_t *data, size_t len,
error = css_stylesheet_create(&params, &sheet);
if (error != CSS_OK) {
- LOG(("Failed creating sheet: %d", error));
+ LOG("Failed creating sheet: %d", error);
return NULL;
}
error = css_stylesheet_append_data(sheet, data, len);
if (error != CSS_OK && error != CSS_NEEDDATA) {
- LOG(("failed appending data: %d", error));
+ LOG("failed appending data: %d", error);
css_stylesheet_destroy(sheet);
return NULL;
}
error = css_stylesheet_data_done(sheet);
if (error != CSS_OK) {
- LOG(("failed completing parse: %d", error));
+ LOG("failed completing parse: %d", error);
css_stylesheet_destroy(sheet);
return NULL;
}
@@ -229,7 +229,7 @@ static void nscss_dom_user_data_handler(dom_node_operation operation,
CSS_NODE_CLONED,
NULL, src, dst, data);
if (error != CSS_OK)
- LOG(("Failed to clone libcss_node_data."));
+ LOG("Failed to clone libcss_node_data.");
break;
case DOM_NODE_RENAMED:
@@ -237,7 +237,7 @@ static void nscss_dom_user_data_handler(dom_node_operation operation,
CSS_NODE_MODIFIED,
NULL, src, NULL, data);
if (error != CSS_OK)
- LOG(("Failed to update libcss_node_data."));
+ LOG("Failed to update libcss_node_data.");
break;
case DOM_NODE_IMPORTED:
@@ -247,11 +247,11 @@ static void nscss_dom_user_data_handler(dom_node_operation operation,
CSS_NODE_DELETED,
NULL, src, NULL, data);
if (error != CSS_OK)
- LOG(("Failed to delete libcss_node_data."));
+ LOG("Failed to delete libcss_node_data.");
break;
default:
- LOG(("User data operation not handled."));
+ LOG("User data operation not handled.");
assert(0);
}
}
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;
}
diff --git a/framebuffer/bitmap.c b/framebuffer/bitmap.c
index 9f5b02524..b4907ada6 100644
--- a/framebuffer/bitmap.c
+++ b/framebuffer/bitmap.c
@@ -51,7 +51,7 @@ static void *bitmap_create(int width, int height, unsigned int state)
{
nsfb_t *bm;
- LOG(("width %d, height %d, state %u",width,height,state));
+ LOG("width %d, height %d, state %u", width, height, state);
bm = nsfb_new(NSFB_SURFACE_RAM);
if (bm == NULL) {
@@ -69,7 +69,7 @@ static void *bitmap_create(int width, int height, unsigned int state)
return NULL;
}
- LOG(("bitmap %p", bm));
+ LOG("bitmap %p", bm);
return bm;
}
@@ -197,11 +197,11 @@ static bool bitmap_test_opaque(void *bitmap)
while (tst-- > 0) {
if (bmpptr[(tst << 2) + 3] != 0xff) {
- LOG(("bitmap %p has transparency",bm));
+ LOG("bitmap %p has transparency", bm);
return false;
}
}
- LOG(("bitmap %p is opaque", bm));
+ LOG("bitmap %p is opaque", bm);
return true;
}
@@ -282,7 +282,7 @@ bitmap_render(struct bitmap *bitmap,
nsfb_get_geometry(tbm, &width, &height, NULL);
- LOG(("width %d, height %d", width, height));
+ LOG("width %d, height %d", width, height);
/* Calculate size of buffer to render the content into */
/* We get the width from the content width, unless it exceeds 1024,
diff --git a/framebuffer/clipboard.c b/framebuffer/clipboard.c
index 323e8deff..05defe8f9 100644
--- a/framebuffer/clipboard.c
+++ b/framebuffer/clipboard.c
@@ -53,8 +53,8 @@ static void gui_get_clipboard(char **buffer, size_t *length)
if (gui_clipboard.length > 0) {
assert(gui_clipboard.buffer != NULL);
- LOG(("Pasting %i bytes: \"%s\"\n", gui_clipboard.length,
- gui_clipboard.buffer));
+ LOG("Pasting %zd bytes: \"%s\"\n",
+ gui_clipboard.length, gui_clipboard.buffer);
*buffer = malloc(gui_clipboard.length);
diff --git a/framebuffer/fbtk/event.c b/framebuffer/fbtk/event.c
index 607db8984..aab150283 100644
--- a/framebuffer/fbtk/event.c
+++ b/framebuffer/fbtk/event.c
@@ -52,7 +52,7 @@ fbtk_input(fbtk_widget_t *root, nsfb_event_t *event)
/* obtain widget with input focus */
input = root->u.root.input;
if (input == NULL) {
- LOG(("No widget has input focus."));
+ LOG("No widget has input focus.");
return; /* no widget with input */
}
@@ -85,7 +85,7 @@ fbtk_click(fbtk_widget_t *widget, nsfb_event_t *event)
x = fbtk_get_absx(clicked);
y = fbtk_get_absy(clicked);
- LOG(("clicked %p at %d,%d", clicked, x, y));
+ LOG("clicked %p at %d,%d", clicked, x, y);
/* post the click */
fbtk_post_callback(clicked, FBTK_CBT_CLICK, event, cloc.x0 - x, cloc.y0 - y);
diff --git a/framebuffer/fbtk/fbtk.c b/framebuffer/fbtk/fbtk.c
index c36966c3e..882e5e5f2 100644
--- a/framebuffer/fbtk/fbtk.c
+++ b/framebuffer/fbtk/fbtk.c
@@ -52,7 +52,7 @@ dump_tk_tree(fbtk_widget_t *widget)
int indent = 0;
while (widget != NULL) {
- LOG(("%*s%p", indent, "", widget));
+ LOG("%*s%p", indent, "", widget);
if (widget->first_child != NULL) {
widget = widget->first_child;
indent += 6;
@@ -100,12 +100,7 @@ fbtk_request_redraw(fbtk_widget_t *widget)
widget->redraw.height = widget->height;
#ifdef FBTK_LOGGING
- LOG(("redrawing %p %d,%d %d,%d",
- widget,
- widget->redraw.x,
- widget->redraw.y,
- widget->redraw.width,
- widget->redraw.height));
+ LOG("redrawing %p %d,%d %d,%d", widget, widget->redraw.x, widget->redraw.y, widget->redraw.width, widget->redraw.height);
#endif
cwidget = widget->last_child;
@@ -126,7 +121,7 @@ fbtk_request_redraw(fbtk_widget_t *widget)
int
fbtk_set_mapping(fbtk_widget_t *widget, bool map)
{
- LOG(("setting mapping on %p to %d", widget, map));
+ LOG("setting mapping on %p to %d", widget, map);
widget->mapped = map;
if (map) {
fbtk_request_redraw(widget);
@@ -149,7 +144,7 @@ swap_siblings(fbtk_widget_t *lw)
assert(rw != NULL);
- LOG(("Swapping %p with %p", lw, rw));
+ LOG("Swapping %p with %p", lw, rw);
before = lw->prev;
after = rw->next;
@@ -415,7 +410,7 @@ fbtk_get_root_widget(fbtk_widget_t *widget)
/* check root widget was found */
if (widget->type != FB_WIDGET_TYPE_ROOT) {
- LOG(("Widget with null parent that is not the root widget!"));
+ LOG("Widget with null parent that is not the root widget!");
return NULL;
}
@@ -556,7 +551,7 @@ fbtk_widget_new(fbtk_widget_t *parent,
return NULL;
#ifdef FBTK_LOGGING
- LOG(("creating %p %d,%d %d,%d", neww, x, y, width, height));
+ LOG("creating %p %d,%d %d,%d", neww, x, y, width, height);
#endif
/* make new window fit inside parent */
@@ -579,7 +574,7 @@ fbtk_widget_new(fbtk_widget_t *parent,
}
#ifdef FBTK_LOGGING
- LOG(("using %p %d,%d %d,%d", neww, x, y, width, height));
+ LOG("using %p %d,%d %d,%d", neww, x, y, width, height);
#endif
/* set values */
neww->type = type;
@@ -639,9 +634,7 @@ do_redraw(nsfb_t *nsfb, fbtk_widget_t *widget)
plot_ctx.y1 = plot_ctx.y0 + widget->redraw.height;
#ifdef FBTK_LOGGING
- LOG(("clipping %p %d,%d %d,%d",
- widget, plot_ctx.x0, plot_ctx.y0,
- plot_ctx.x1, plot_ctx.y1));
+ LOG("clipping %p %d,%d %d,%d", widget, plot_ctx.x0, plot_ctx.y0, plot_ctx.x1, plot_ctx.y1);
#endif
if (nsfb_plot_set_clip(nsfb, &plot_ctx) == true) {
fbtk_post_callback(widget, FBTK_CBT_REDRAW);
diff --git a/framebuffer/fbtk/scroll.c b/framebuffer/fbtk/scroll.c
index e91c3ef6e..c86c8a6de 100644
--- a/framebuffer/fbtk/scroll.c
+++ b/framebuffer/fbtk/scroll.c
@@ -334,7 +334,7 @@ hscroll_redraw(fbtk_widget_t *widget, fbtk_callback_info *cbi)
hpos = 0;
}
- LOG(("hscroll %d", hscroll));
+ LOG("hscroll %d", hscroll);
rect.x0 = bbox.x0 + 3 + hpos;
rect.y0 = bbox.y0 + 5;
@@ -362,7 +362,7 @@ hscrolll_click(fbtk_widget_t *widget, fbtk_callback_info *cbi)
newpos = scrollw->u.scroll.minimum;
if (newpos == scrollw->u.scroll.position) {
- LOG(("horiz scroll was the same %d", newpos));
+ LOG("horiz scroll was the same %d", newpos);
return 0;
}
diff --git a/framebuffer/fetch.c b/framebuffer/fetch.c
index 6ae100734..24920fbbb 100644
--- a/framebuffer/fetch.c
+++ b/framebuffer/fetch.c
@@ -65,7 +65,7 @@ static nsurl *get_resource_url(const char *path)
static const char *fetch_filetype(const char *unix_path)
{
int l;
- LOG(("unix path %s", unix_path));
+ LOG("unix path %s", unix_path);
l = strlen(unix_path);
if (2 < l && strcasecmp(unix_path + l - 3, "css") == 0)
return "text/css";
diff --git a/framebuffer/font_freetype.c b/framebuffer/font_freetype.c
index c5a18da50..ec3ceab52 100644
--- a/framebuffer/font_freetype.c
+++ b/framebuffer/font_freetype.c
@@ -83,12 +83,12 @@ static FT_Error ft_face_requester(FTC_FaceID face_id, FT_Library library, FT_Po
error = FT_New_Face(library, fb_face->fontfile, fb_face->index, face);
if (error) {
- LOG(("Could not find font (code %d)", error));
+ LOG("Could not find font (code %d)", error);
} else {
error = FT_Select_Charmap(*face, FT_ENCODING_UNICODE);
if (error) {
- LOG(("Could not select charmap (code %d)", error));
+ LOG("Could not select charmap (code %d)", error);
} else {
for (cidx = 0; cidx < (*face)->num_charmaps; cidx++) {
if ((*face)->charmap == (*face)->charmaps[cidx]) {
@@ -98,7 +98,7 @@ static FT_Error ft_face_requester(FTC_FaceID face_id, FT_Library library, FT_Po
}
}
}
- LOG(("Loaded face from %s", fb_face->fontfile));
+ LOG("Loaded face from %s", fb_face->fontfile);
return error;
}
@@ -123,7 +123,7 @@ fb_new_face(const char *option, const char *resname, const char *fontname)
error = FTC_Manager_LookupFace(ft_cmanager, (FTC_FaceID)newf, &aface);
if (error) {
- LOG(("Could not find font face %s (code %d)", fontname, error));
+ LOG("Could not find font face %s (code %d)", fontname, error);
free(newf->fontfile);
free(newf);
newf = NULL;
@@ -143,7 +143,7 @@ bool fb_font_init(void)
/* freetype library initialise */
error = FT_Init_FreeType( &library );
if (error) {
- LOG(("Freetype could not initialised (code %d)", error));
+ LOG("Freetype could not initialised (code %d)", error);
return false;
}
@@ -163,7 +163,7 @@ bool fb_font_init(void)
NULL,
&ft_cmanager);
if (error) {
- LOG(("Freetype could not initialise cache manager (code %d)", error));
+ LOG("Freetype could not initialise cache manager (code %d)", error);
FT_Done_FreeType(library);
return false;
}
@@ -180,7 +180,7 @@ bool fb_font_init(void)
NETSURF_FB_FONT_SANS_SERIF);
if (fb_face == NULL) {
/* The sans serif font is the default and must be found. */
- LOG(("Could not find the default font"));
+ LOG("Could not find the default font");
FTC_Manager_Done(ft_cmanager);
FT_Done_FreeType(library);
return false;
diff --git a/framebuffer/framebuffer.c b/framebuffer/framebuffer.c
index 927e6318f..97760cfc6 100644
--- a/framebuffer/framebuffer.c
+++ b/framebuffer/framebuffer.c
@@ -317,7 +317,7 @@ framebuffer_plot_path(const float *p,
colour c,
const float transform[6])
{
- LOG(("path unimplemented"));
+ LOG("path unimplemented");
return true;
}
@@ -375,7 +375,7 @@ static bool framebuffer_format_from_bpp(int bpp, enum nsfb_format_e *fmt)
break;
default:
- LOG(("Bad bits per pixel (%d)\n", bpp));
+ LOG("Bad bits per pixel (%d)\n", bpp);
return false;
}
@@ -397,18 +397,18 @@ framebuffer_initialise(const char *fename, int width, int height, int bpp)
fbtype = nsfb_type_from_name(fename);
if (fbtype == NSFB_SURFACE_NONE) {
- LOG(("The %s surface is not available from libnsfb\n", fename));
+ LOG("The %s surface is not available from libnsfb\n", fename);
return NULL;
}
nsfb = nsfb_new(fbtype);
if (nsfb == NULL) {
- LOG(("Unable to create %s fb surface\n", fename));
+ LOG("Unable to create %s fb surface\n", fename);
return NULL;
}
if (nsfb_set_geometry(nsfb, width, height, fbfmt) == -1) {
- LOG(("Unable to set surface geometry\n"));
+ LOG("Unable to set surface geometry\n");
nsfb_free(nsfb);
return NULL;
}
@@ -416,7 +416,7 @@ framebuffer_initialise(const char *fename, int width, int height, int bpp)
nsfb_cursor_init(nsfb);
if (nsfb_init(nsfb) == -1) {
- LOG(("Unable to initialise nsfb surface\n"));
+ LOG("Unable to initialise nsfb surface\n");
nsfb_free(nsfb);
return NULL;
}
@@ -436,7 +436,7 @@ framebuffer_resize(nsfb_t *nsfb, int width, int height, int bpp)
}
if (nsfb_set_geometry(nsfb, width, height, fbfmt) == -1) {
- LOG(("Unable to change surface geometry\n"));
+ LOG("Unable to change surface geometry\n");
return false;
}
diff --git a/framebuffer/gui.c b/framebuffer/gui.c
index 56fe41bc4..1c60bee2f 100644
--- a/framebuffer/gui.c
+++ b/framebuffer/gui.c
@@ -140,7 +140,7 @@ widget_scroll_y(struct gui_window *gw, int y, bool abs)
int content_width, content_height;
int height;
- LOG(("window scroll"));
+ LOG("window scroll");
if (abs) {
bwidget->pany = y - bwidget->scrolly;
} else {
@@ -224,7 +224,7 @@ fb_pan(fbtk_widget_t *widget,
height = fbtk_get_height(widget);
width = fbtk_get_width(widget);
- LOG(("panning %d, %d", bwidget->panx, bwidget->pany));
+ LOG("panning %d, %d", bwidget->panx, bwidget->pany);
x = fbtk_get_absx(widget);
y = fbtk_get_absy(widget);
@@ -400,7 +400,7 @@ fb_browser_window_redraw(fbtk_widget_t *widget, fbtk_callback_info *cbi)
bwidget = fbtk_get_userpw(widget);
if (bwidget == NULL) {
- LOG(("browser widget from widget %p was null", widget));
+ LOG("browser widget from widget %p was null", widget);
return -1;
}
@@ -452,7 +452,7 @@ process_cmdline(int argc, char** argv)
{0, 0, 0, 0 }
}; /* no long options */
- LOG(("argc %d, argv %p", argc, argv));
+ LOG("argc %d, argv %p", argc, argv);
fename = "sdl";
febpp = 32;
@@ -521,7 +521,7 @@ static nserror set_defaults(struct nsoption_s *defaults)
if (nsoption_charp(cookie_file) == NULL ||
nsoption_charp(cookie_jar) == NULL) {
- LOG(("Failed initialising cookie options"));
+ LOG("Failed initialising cookie options");
return NSERROR_BAD_PARAMETER;
}
@@ -599,7 +599,7 @@ static void framebuffer_run(void)
static void gui_quit(void)
{
- LOG(("gui_quit"));
+ LOG("gui_quit");
urldb_save_cookies(nsoption_charp(cookie_jar));
@@ -626,7 +626,7 @@ fb_browser_window_click(fbtk_widget_t *widget, fbtk_callback_info *cbi)
cbi->event->type != NSFB_EVENT_KEY_UP)
return 0;
- LOG(("browser window clicked at %d,%d", cbi->x, cbi->y));
+ LOG("browser window clicked at %d,%d", cbi->x, cbi->y);
switch (cbi->event->type) {
case NSFB_EVENT_KEY_DOWN:
@@ -809,7 +809,7 @@ fb_browser_window_input(fbtk_widget_t *widget, fbtk_callback_info *cbi)
static fbtk_modifier_type modifier = FBTK_MOD_CLEAR;
int ucs4 = -1;
- LOG(("got value %d", cbi->event->value.keycode));
+ LOG("got value %d", cbi->event->value.keycode);
switch (cbi->event->type) {
case NSFB_EVENT_KEY_DOWN:
@@ -1185,7 +1185,7 @@ create_toolbar(struct gui_window *gw,
toolbar_layout = NSFB_TOOLBAR_DEFAULT_LAYOUT;
}
- LOG(("Using toolbar layout %s", toolbar_layout));
+ LOG("Using toolbar layout %s", toolbar_layout);
itmtype = toolbar_layout;
@@ -1219,7 +1219,7 @@ create_toolbar(struct gui_window *gw,
(*itmtype != 0) &&
(xdir !=0)) {
- LOG(("toolbar adding %c", *itmtype));
+ LOG("toolbar adding %c", *itmtype);
switch (*itmtype) {
@@ -1361,7 +1361,7 @@ create_toolbar(struct gui_window *gw,
default:
widget = NULL;
xdir = 0;
- LOG(("Unknown element %c in toolbar layout", *itmtype));
+ LOG("Unknown element %c in toolbar layout", *itmtype);
break;
}
@@ -1370,7 +1370,7 @@ create_toolbar(struct gui_window *gw,
xpos += (xdir * (fbtk_get_width(widget) + padding));
}
- LOG(("xpos is %d",xpos));
+ LOG("xpos is %d", xpos);
itmtype += xdir;
}
@@ -1580,7 +1580,7 @@ create_normal_browser_window(struct gui_window *gw, int furniture_width)
int statusbar_width = 0;
int toolbar_height = nsoption_int(fb_toolbar_size);
- LOG(("Normal window"));
+ LOG("Normal window");
gw->window = fbtk_create_window(fbtk, 0, 0, 0, 0, 0);
@@ -1611,7 +1611,7 @@ create_normal_browser_window(struct gui_window *gw, int furniture_width)
false);
fbtk_set_handler(gw->status, FBTK_CBT_POINTERENTER, set_ptr_default_move, NULL);
- LOG(("status bar %p at %d,%d", gw->status, fbtk_get_absx(gw->status), fbtk_get_absy(gw->status)));
+ LOG("status bar %p at %d,%d", gw->status, fbtk_get_absx(gw->status), fbtk_get_absy(gw->status));
/* create horizontal scrollbar */
gw->hscroll = fbtk_create_hscroll(gw->window,
@@ -2027,7 +2027,7 @@ gui_window_remove_caret(struct gui_window *g)
static void framebuffer_window_reformat(struct gui_window *gw)
{
/** @todo if we ever do zooming reformat should be implemented */
- LOG(("window:%p", gw));
+ LOG("window:%p", gw);
/*
browser_window_reformat(gw->bw, false, width, height);
@@ -2138,7 +2138,7 @@ main(int argc, char** argv)
/* create an initial browser window */
- LOG(("calling browser_window_create"));
+ LOG("calling browser_window_create");
ret = nsurl_create(feurl, &url);
if (ret == NSERROR_OK) {
@@ -2160,7 +2160,7 @@ main(int argc, char** argv)
netsurf_exit();
if (fb_font_finalise() == false)
- LOG(("Font finalisation failed."));
+ LOG("Font finalisation failed.");
/* finalise options */
nsoption_finalise(nsoptions, nsoptions_default);
diff --git a/framebuffer/misc.c b/framebuffer/misc.c
index 406a959d3..f1f96816a 100644
--- a/framebuffer/misc.c
+++ b/framebuffer/misc.c
@@ -27,7 +27,7 @@
void warn_user(const char *warning, const char *detail)
{
- LOG(("%s %s", warning, detail));
+ LOG("%s %s", warning, detail);
}
diff --git a/framebuffer/schedule.c b/framebuffer/schedule.c
index 151b6f99f..d75758197 100644
--- a/framebuffer/schedule.c
+++ b/framebuffer/schedule.c
@@ -203,13 +203,12 @@ void list_schedule(void)
gettimeofday(&tv, NULL);
- LOG(("schedule list at %ld:%ld", tv.tv_sec, tv.tv_usec));
+ LOG("schedule list at %ld:%ld", tv.tv_sec, tv.tv_usec);
cur_nscb = schedule_list;
while (cur_nscb != NULL) {
- LOG(("Schedule %p at %ld:%ld",
- cur_nscb, cur_nscb->tv.tv_sec, cur_nscb->tv.tv_usec));
+ LOG("Schedule %p at %ld:%ld", cur_nscb, cur_nscb->tv.tv_sec, cur_nscb->tv.tv_usec);
cur_nscb = cur_nscb->next;
}
}
diff --git a/gtk/cookies.c b/gtk/cookies.c
index ee7238746..cb59d0ae8 100644
--- a/gtk/cookies.c
+++ b/gtk/cookies.c
@@ -142,7 +142,7 @@ void nsgtk_cookies_init_menu()
while (event->widget != NULL) {
w = GTK_WIDGET(gtk_builder_get_object(gladeFile, event->widget));
if (w == NULL) {
- LOG(("Unable to connect menu widget ""%s""", event->widget)); } else {
+ LOG("Unable to connect menu widget ""%s""", event->widget); } else {
g_signal_connect(G_OBJECT(w), "activate", event->handler, cookies_window);
}
event++;
diff --git a/gtk/fetch.c b/gtk/fetch.c
index f56e99d81..f68f203d5 100644
--- a/gtk/fetch.c
+++ b/gtk/fetch.c
@@ -73,7 +73,7 @@ void gtk_fetch_filetype_init(const char *mimefile)
hash_add(mime_hash, "spr", "image/x-riscos-sprite");
if (fh == NULL) {
- LOG(("Unable to open a mime.types file, so using a minimal one for you."));
+ LOG("Unable to open a mime.types file, so using a minimal one for you.");
return;
}
diff --git a/gtk/font_pango.c b/gtk/font_pango.c
index ee506380f..d3a2a2a94 100644
--- a/gtk/font_pango.c
+++ b/gtk/font_pango.c
@@ -59,12 +59,12 @@ static PangoLayout *nsfont_pango_layout = NULL;
static inline void nsfont_pango_check(void)
{
if (nsfont_pango_context == NULL) {
- LOG(("Creating nsfont_pango_context."));
+ LOG("Creating nsfont_pango_context.");
nsfont_pango_context = gdk_pango_context_get();
}
if (nsfont_pango_layout == NULL) {
- LOG(("Creating nsfont_pango_layout."));
+ LOG("Creating nsfont_pango_layout.");
nsfont_pango_layout = pango_layout_new(nsfont_pango_context);
}
}
diff --git a/gtk/gdk.c b/gtk/gdk.c
index 22569285d..9ed90bd8e 100644
--- a/gtk/gdk.c
+++ b/gtk/gdk.c
@@ -86,7 +86,7 @@ nsgdk_pixbuf_get_from_surface(cairo_surface_t *surface, int scwidth, int scheigh
if (cairo_surface_status(scsurface) != CAIRO_STATUS_SUCCESS) {
cairo_surface_destroy(scsurface);
g_object_unref(pixbuf);
- LOG(("Surface creation failed"));
+ LOG("Surface creation failed");
return NULL;
}
diff --git a/gtk/gui.c b/gtk/gui.c
index 6f51133e4..b8d8fc152 100644
--- a/gtk/gui.c
+++ b/gtk/gui.c
@@ -192,7 +192,7 @@ nsgtk_new_ui(char **respath, const char *name, GtkBuilder **pglade)
gtk_builder_connect_signals(builder, NULL);
- LOG(("Using '%s' as %s ui template file", filepath, name));
+ LOG("Using '%s' as %s ui template file", filepath, name);
if (pglade != NULL) {
*pglade = builder;
@@ -290,7 +290,7 @@ static nserror set_defaults(struct nsoption_s *defaults)
(nsoption_charp(hotlist_path) == NULL) ||
(nsoption_charp(downloads_directory) == NULL) ||
(nsoption_charp(ca_path) == NULL)) {
- LOG(("Failed initialising default resource paths"));
+ LOG("Failed initialising default resource paths");
return NSERROR_BAD_PARAMETER;
}
@@ -333,7 +333,7 @@ static nserror nsgtk_init(int argc, char** argv, char **respath)
themelist_file_location = NULL;
}
if (themelist_file_location == NULL) {
- LOG(("Unable to find themelist - disabling"));
+ LOG("Unable to find themelist - disabling");
}
/* Obtain resources path location.
@@ -345,7 +345,7 @@ static nserror nsgtk_init(int argc, char** argv, char **respath)
memcpy(res_dir_location,
languages_file_location,
strlen(languages_file_location) - 9);
- LOG(("Using '%s' for resource path", res_dir_location));
+ LOG("Using '%s' for resource path", res_dir_location);
/* initialise the glade templates */
nsgtk_init_glade(respath);
@@ -361,7 +361,7 @@ static nserror nsgtk_init(int argc, char** argv, char **respath)
resource_filename = filepath_find(respath, "SearchEngines");
search_web_init(resource_filename);
if (resource_filename != NULL) {
- LOG(("Using '%s' as Search Engines file", resource_filename));
+ LOG("Using '%s' as Search Engines file", resource_filename);
free(resource_filename);
}
@@ -378,7 +378,7 @@ static nserror nsgtk_init(int argc, char** argv, char **respath)
/* Toolbar inicies file */
toolbar_indices_file_location = filepath_find(respath, "toolbarIndices");
- LOG(("Using '%s' as custom toolbar settings file", toolbar_indices_file_location));
+ LOG("Using '%s' as custom toolbar settings file", toolbar_indices_file_location);
/* load throbber images */
if (nsgtk_throbber_init(respath, THROBBER_FRAMES) == false)
@@ -400,7 +400,7 @@ static nserror nsgtk_init(int argc, char** argv, char **respath)
* window.
*/
browser_set_dpi(gdk_screen_get_resolution(gdk_screen_get_default()));
- LOG(("Set CSS DPI to %d", browser_get_dpi()));
+ LOG("Set CSS DPI to %d", browser_get_dpi());
if (nsgtk_history_init(glade_file_location->history) == false)
die("Unable to initialise history window.\n");
@@ -529,7 +529,7 @@ static void nsgtk_main(void)
static void gui_quit(void)
{
- LOG(("Quitting GUI"));
+ LOG("Quitting GUI");
/* Ensure all scaffoldings are destroyed before we go into exit */
nsgtk_download_destroy();
@@ -567,7 +567,7 @@ void warn_user(const char *warning, const char *detail)
{
char buf[300]; /* 300 is the size the RISC OS GUI uses */
- LOG(("%s %s", warning, detail ? detail : ""));
+ LOG("%s %s", warning, detail ? detail : "");
fflush(stdout);
snprintf(buf, sizeof(buf), "%s %s", messages_get(warning),
@@ -856,7 +856,7 @@ static nserror get_config_home(char **config_home_out)
if (home_dir != NULL) {
ret = check_dirname(home_dir, ".netsurf", &config_home);
if (ret == NSERROR_OK) {
- LOG(("\"%s\"", config_home));
+ LOG("\"%s\"", config_home);
*config_home_out = config_home;
return ret;
}
@@ -896,7 +896,7 @@ static nserror get_config_home(char **config_home_out)
}
}
- LOG(("\"%s\"", config_home));
+ LOG("\"%s\"", config_home);
*config_home_out = config_home;
return NSERROR_OK;
@@ -909,7 +909,7 @@ static nserror create_config_home(char **config_home_out)
char *xdg_config_dir;
nserror ret;
- LOG(("Attempting to create configuration directory"));
+ LOG("Attempting to create configuration directory");
/* $XDG_CONFIG_HOME defines the base directory
* relative to which user specific configuration files
@@ -945,7 +945,7 @@ static nserror create_config_home(char **config_home_out)
/* strip the trailing separator */
config_home[strlen(config_home) - 1] = 0;
- LOG(("\"%s\"", config_home));
+ LOG("\"%s\"", config_home);
*config_home_out = config_home;
@@ -994,7 +994,7 @@ static nserror get_cache_home(char **cache_home_out)
}
}
- LOG(("\"%s\"", cache_home));
+ LOG("\"%s\"", cache_home);
*cache_home_out = cache_home;
return NSERROR_OK;
@@ -1007,7 +1007,7 @@ static nserror create_cache_home(char **cache_home_out)
char *xdg_cache_dir;
nserror ret;
- LOG(("Attempting to create configuration directory"));
+ LOG("Attempting to create configuration directory");
/* $XDG_CACHE_HOME defines the base directory
* relative to which user specific cache files
@@ -1043,7 +1043,7 @@ static nserror create_cache_home(char **cache_home_out)
/* strip the trailing separator */
cache_home[strlen(cache_home) - 1] = 0;
- LOG(("\"%s\"", cache_home));
+ LOG("\"%s\"", cache_home);
*cache_home_out = cache_home;
@@ -1131,7 +1131,7 @@ int main(int argc, char** argv)
ret = create_config_home(&nsgtk_config_home);
}
if (ret != NSERROR_OK) {
- LOG(("Unable to locate a configuration directory."));
+ LOG("Unable to locate a configuration directory.");
nsgtk_config_home = NULL;
}
@@ -1161,7 +1161,7 @@ int main(int argc, char** argv)
ret = create_cache_home(&cache_home);
}
if (ret != NSERROR_OK) {
- LOG(("Unable to locate a cache directory."));
+ LOG("Unable to locate a cache directory.");
}
/* core initialisation */
diff --git a/gtk/history.c b/gtk/history.c
index 9a507ef1f..2dbedf98a 100644
--- a/gtk/history.c
+++ b/gtk/history.c
@@ -146,7 +146,7 @@ void nsgtk_history_init_menu(void)
while (event->widget != NULL) {
w = GTK_WIDGET(gtk_builder_get_object(gladeFile, event->widget));
if (w == NULL) {
- LOG(("Unable to connect menu widget ""%s""", event->widget));
+ LOG("Unable to connect menu widget ""%s""", event->widget);
} else {
g_signal_connect(G_OBJECT(w), "activate", event->handler, global_history_window);
}
diff --git a/gtk/hotlist.c b/gtk/hotlist.c
index 3f2515ec8..fed6ae735 100644
--- a/gtk/hotlist.c
+++ b/gtk/hotlist.c
@@ -154,7 +154,7 @@ void nsgtk_hotlist_init_menu(void)
while (event->widget != NULL) {
w = GTK_WIDGET(gtk_builder_get_object(gladeFile, event->widget));
if (w == NULL) {
- LOG(("Unable to connect menu widget ""%s""", event->widget)); } else {
+ LOG("Unable to connect menu widget ""%s""", event->widget); } else {
g_signal_connect(G_OBJECT(w), "activate", event->handler, hotlist_window);
}
event++;
diff --git a/gtk/plotters.c b/gtk/plotters.c
index ab7e4c5fb..33f4c65fe 100644
--- a/gtk/plotters.c
+++ b/gtk/plotters.c
@@ -450,7 +450,7 @@ static bool nsgtk_plot_path(const float *p, unsigned int n, colour fill, float w
return true;
if (p[0] != PLOTTER_PATH_MOVE) {
- LOG(("Path does not start with move"));
+ LOG("Path does not start with move");
return false;
}
@@ -489,7 +489,7 @@ static bool nsgtk_plot_path(const float *p, unsigned int n, colour fill, float w
p[i+5], p[i+6]);
i += 7;
} else {
- LOG(("bad path command %f", p[i]));
+ LOG("bad path command %f", p[i]);
/* Reset matrix for safety */
cairo_set_matrix(current_cr, &old_ctm);
return false;
diff --git a/gtk/preferences.c b/gtk/preferences.c
index 446732651..9ca8eb759 100644
--- a/gtk/preferences.c
+++ b/gtk/preferences.c
@@ -566,7 +566,7 @@ nsgtk_preferences_comboboxLanguage_realize(GtkWidget *widget,
gtk_list_store_clear(priv->content_language);
active_language = -1;
- LOG(("Used %s for languages", languages_file_location));
+ LOG("Used %s for languages", languages_file_location);
while (fgets(buf, sizeof(buf), fp)) {
/* Ignore blank lines */
if (buf[0] == '\0')
@@ -597,7 +597,7 @@ nsgtk_preferences_comboboxLanguage_realize(GtkWidget *widget,
fclose(fp);
} else {
- LOG(("Failed opening languages file"));
+ LOG("Failed opening languages file");
}
gtk_combo_box_set_active(GTK_COMBO_BOX(widget), active_language);
@@ -667,7 +667,7 @@ nsgtk_preferences_comboTheme_realize(GtkWidget *widget, struct ppref *priv)
((fp = fopen(themelist_file_location, "r")) != NULL)) {
gtk_list_store_clear(priv->themes);
- LOG(("Used %s for themelist", themelist_file_location));
+ LOG("Used %s for themelist", themelist_file_location);
while (fgets(buf, sizeof(buf), fp)) {
/* Ignore blank lines */
@@ -685,7 +685,7 @@ nsgtk_preferences_comboTheme_realize(GtkWidget *widget, struct ppref *priv)
fclose(fp);
} else {
- LOG(("Failed opening themes file"));
+ LOG("Failed opening themes file");
}
/* get configured theme and sanity check value */
@@ -1065,7 +1065,7 @@ GtkWidget* nsgtk_preferences(struct browser_window *bw, GtkWindow *parent)
priv->dialog = gtk_builder_get_object(preferences_builder,
"dialogPreferences");
if (priv->dialog == NULL) {
- LOG(("Unable to get object for preferences dialog"));
+ LOG("Unable to get object for preferences dialog");
/* release builder as were done with it */
g_object_unref(G_OBJECT(preferences_builder));
return NULL;
diff --git a/gtk/print.c b/gtk/print.c
index 53fbed083..e5e9e847f 100644
--- a/gtk/print.c
+++ b/gtk/print.c
@@ -137,8 +137,7 @@ static inline void nsgtk_print_set_dashed(void)
/** Set clipping area for subsequent plot operations. */
static bool nsgtk_print_plot_clip(const struct rect *clip)
{
- LOG(("Clipping. x0: %i ;\t y0: %i ;\t x1: %i ;\t y1: %i",
- clip->x0, clip->y0, clip->x1, clip->y1));
+ LOG("Clipping. x0: %i ;\t y0: %i ;\t x1: %i ;\t y1: %i", clip->x0, clip->y0, clip->x1, clip->y1);
/* Normalize cllipping area - to prevent overflows.
* See comment in pdf_plot_fill. */
@@ -248,7 +247,7 @@ static bool nsgtk_print_plot_line(int x0, int y0, int x1, int y1, const plot_sty
static bool nsgtk_print_plot_rectangle(int x0, int y0, int x1, int y1, const plot_style_t *style)
{
- LOG(("x0: %i ;\t y0: %i ;\t x1: %i ;\t y1: %i", x0,y0,x1,y1));
+ LOG("x0: %i ;\t y0: %i ;\t x1: %i ;\t y1: %i", x0, y0, x1, y1);
if (style->fill_type != PLOT_OP_TYPE_NONE) {
@@ -302,7 +301,7 @@ static bool nsgtk_print_plot_polygon(const int *p, unsigned int n, const plot_st
{
unsigned int i;
- LOG(("Plotting polygon."));
+ LOG("Plotting polygon.");
nsgtk_print_set_colour(style->fill_colour);
nsgtk_print_set_solid();
@@ -310,11 +309,11 @@ static bool nsgtk_print_plot_polygon(const int *p, unsigned int n, const plot_st
cairo_set_line_width(gtk_print_current_cr, 0);
cairo_move_to(gtk_print_current_cr, p[0], p[1]);
- LOG(("Starting line at: %i\t%i",p[0],p[1]));
+ LOG("Starting line at: %i\t%i", p[0], p[1]);
for (i = 1; i != n; i++) {
cairo_line_to(gtk_print_current_cr, p[i * 2], p[i * 2 + 1]);
- LOG(("Drawing line to: %i\t%i",p[i * 2], p[i * 2 + 1]));
+ LOG("Drawing line to: %i\t%i", p[i * 2], p[i * 2 + 1]);
}
cairo_fill(gtk_print_current_cr);
@@ -553,7 +552,7 @@ void gtk_print_signal_begin_print (GtkPrintOperation *operation,
int page_number;
double height_on_page, height_to_print;
- LOG(("Begin print"));
+ LOG("Begin print");
settings = user_data;
@@ -572,9 +571,7 @@ void gtk_print_signal_begin_print (GtkPrintOperation *operation,
} else {
- LOG(("page_width: %f ;page_height: %f; content height: %lf",
- settings->page_width, settings->page_height,
- height_to_print));
+ LOG("page_width: %f ;page_height: %f; content height: %lf", settings->page_width, settings->page_height, height_to_print);
height_on_page = settings->page_height;
height_on_page = height_on_page -
@@ -598,7 +595,7 @@ void gtk_print_signal_begin_print (GtkPrintOperation *operation,
void gtk_print_signal_draw_page(GtkPrintOperation *operation,
GtkPrintContext *context, gint page_nr, gpointer user_data)
{
- LOG(("Draw Page"));
+ LOG("Draw Page");
gtk_print_current_cr = gtk_print_context_get_cairo_context(context);
print_draw_next_page(&gtk_printer, settings);
}
@@ -610,7 +607,7 @@ void gtk_print_signal_draw_page(GtkPrintOperation *operation,
void gtk_print_signal_end_print(GtkPrintOperation *operation,
GtkPrintContext *context, gpointer user_data)
{
- LOG(("End print"));
+ LOG("End print");
print_cleanup(content_to_print, &gtk_printer, user_data);
}
diff --git a/gtk/scaffolding.c b/gtk/scaffolding.c
index 661902b9e..3151ba145 100644
--- a/gtk/scaffolding.c
+++ b/gtk/scaffolding.c
@@ -227,7 +227,7 @@ static void scaffolding_window_destroy(GtkWidget *widget, gpointer data)
{
struct nsgtk_scaffolding *gs = data;
- LOG(("scaffold:%p", gs));
+ LOG("scaffold:%p", gs);
if ((gs->history_window) && (gs->history_window->window)) {
gtk_widget_destroy(GTK_WIDGET(gs->history_window->window));
@@ -242,7 +242,7 @@ static void scaffolding_window_destroy(GtkWidget *widget, gpointer data)
gs->next->prev = gs->prev;
}
- LOG(("scaffold list head: %p", scaf_list));
+ LOG("scaffold list head: %p", scaf_list);
if (scaf_list == NULL) {
/* no more open windows - stop the browser */
@@ -668,8 +668,7 @@ MULTIHANDLER(savepage)
path = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(fc));
d = opendir(path);
if (d == NULL) {
- LOG(("Unable to open directory %s for complete save: %s", path,
- strerror(errno)));
+ LOG("Unable to open directory %s for complete save: %s", path, strerror(errno));
if (errno == ENOTDIR)
warn_user("NoDirError", path);
else
@@ -701,7 +700,7 @@ MULTIHANDLER(pdf)
char *url_name;
nserror res;
- LOG(("Print preview (generating PDF) started."));
+ LOG("Print preview (generating PDF) started.");
res = nsurl_nice(browser_window_get_url(bw), &url_name, true);
if (res != NSERROR_OK) {
@@ -1085,10 +1084,10 @@ MULTIHANDLER(selectall)
struct browser_window *bw = nsgtk_get_browser_window(g->top_level);
if (nsgtk_widget_has_focus(GTK_WIDGET(g->url_bar))) {
- LOG(("Selecting all URL bar text"));
+ LOG("Selecting all URL bar text");
gtk_editable_select_region(GTK_EDITABLE(g->url_bar), 0, -1);
} else {
- LOG(("Selecting all document text"));
+ LOG("Selecting all document text");
browser_window_key_press(bw, NS_KEY_SELECT_ALL);
}
@@ -1704,7 +1703,7 @@ static gboolean nsgtk_history_button_press_event(GtkWidget *widget,
struct browser_window *bw =
nsgtk_get_browser_window(hw->g->top_level);
- LOG(("X=%g, Y=%g", event->x, event->y));
+ LOG("X=%g, Y=%g", event->x, event->y);
browser_window_history_click(bw, event->x, event->y, false);
@@ -2043,7 +2042,7 @@ struct nsgtk_scaffolding *nsgtk_new_scaffolding(struct gui_window *toplevel)
return NULL;
}
- LOG(("Constructing a scaffold of %p for gui_window %p", g, toplevel));
+ LOG("Constructing a scaffold of %p for gui_window %p", g, toplevel);
g->top_level = toplevel;
@@ -2293,7 +2292,7 @@ struct nsgtk_scaffolding *nsgtk_new_scaffolding(struct gui_window *toplevel)
/* finally, show the window. */
gtk_widget_show(GTK_WIDGET(g->window));
- LOG(("creation complete"));
+ LOG("creation complete");
return g;
}
@@ -2470,7 +2469,7 @@ gui_search_web_provider_update(const char *provider_name,
GdkPixbuf *srch_pixbuf = NULL;
char *searchcontent;
- LOG(("name:%s bitmap %p", provider_name, provider_bitmap));
+ LOG("name:%s bitmap %p", provider_name, provider_bitmap);
if (provider_bitmap != NULL) {
srch_pixbuf = nsgdk_pixbuf_get_from_surface(provider_bitmap->surface, 16, 16);
diff --git a/gtk/schedule.c b/gtk/schedule.c
index e28675a0b..cf0333388 100644
--- a/gtk/schedule.c
+++ b/gtk/schedule.c
@@ -27,7 +27,7 @@
#ifdef DEBUG_GTK_SCHEDULE
#include "utils/log.h"
#else
-#define LOG(X)
+#define LOG(format, args...) ((void) 0)
#endif
/** Killable callback closure embodiment. */
@@ -50,7 +50,7 @@ nsgtk_schedule_generic_callback(gpointer data)
_nsgtk_callback_t *cb = (_nsgtk_callback_t *)(data);
if (cb->callback_killed) {
/* This callback instance has been killed. */
- LOG(("CB at %p already dead.", cb));
+ LOG("CB at %p already dead.", cb);
}
queued_callbacks = g_list_remove(queued_callbacks, cb);
pending_callbacks = g_list_append(pending_callbacks, cb);
@@ -64,8 +64,7 @@ nsgtk_schedule_kill_callback(void *_target, void *_match)
_nsgtk_callback_t *match = (_nsgtk_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;
@@ -123,7 +122,7 @@ schedule_run(void)
/* Clear the pending list. */
pending_callbacks = NULL;
- LOG(("Captured a run of %d callbacks to fire.", g_list_length(this_run)));
+ LOG("Captured a run of %d callbacks to fire.", g_list_length(this_run));
/* Run all the callbacks which made it this far. */
while (this_run != NULL) {
diff --git a/gtk/tabs.c b/gtk/tabs.c
index c50c11400..0a1923604 100644
--- a/gtk/tabs.c
+++ b/gtk/tabs.c
@@ -148,7 +148,7 @@ nsgtk_tab_switch_page_after(GtkNotebook *notebook,
if ((srcpagenum != -1) &&
(srcpagenum != (gint)selpagenum)) {
/* ensure the add tab is not actually selected */
- LOG(("src %d sel %d",srcpagenum,selpagenum ));
+ LOG("src %d sel %d", srcpagenum, selpagenum);
srcpage = gtk_notebook_get_nth_page(notebook, srcpagenum);
gw = g_object_get_data(G_OBJECT(srcpage), "gui_window");
if ((gw != NULL) && (nsgtk_get_scaffold(gw) != NULL)) {
@@ -156,7 +156,7 @@ nsgtk_tab_switch_page_after(GtkNotebook *notebook,
}
}
} else {
- LOG(("sel %d", selpagenum ));
+ LOG("sel %d", selpagenum);
/* tab with page in it */
gw = g_object_get_data(G_OBJECT(selpage), "gui_window");
if (gw != NULL) {
diff --git a/gtk/theme.c b/gtk/theme.c
index 4cd02d478..eb43fc588 100644
--- a/gtk/theme.c
+++ b/gtk/theme.c
@@ -130,7 +130,7 @@ static bool nsgtk_theme_verify(const char *themename)
}
val = fwrite(filecontent, strlen(filecontent), 1, fp);
if (val == 0)
- LOG(("empty write themelist"));
+ LOG("empty write themelist");
fclose(fp);
free(filecontent);
return true;
diff --git a/gtk/throbber.c b/gtk/throbber.c
index dac79e39d..8726763ed 100644
--- a/gtk/throbber.c
+++ b/gtk/throbber.c
@@ -48,9 +48,8 @@ bool nsgtk_throbber_initialise_from_png(const int frames, char** frame_files)
if (frames < 2) {
/* we need at least two frames - one for idle, one for active */
- LOG(("Insufficent number of frames in throbber animation!"));
- LOG(("(called with %d frames, where 2 is a minimum.)",
- frames));
+ LOG("Insufficent number of frames in throbber animation!");
+ LOG("(called with %d frames, where 2 is a minimum.)", frames);
return false;
}
@@ -68,8 +67,7 @@ bool nsgtk_throbber_initialise_from_png(const int frames, char** frame_files)
for (frame_loop = 0; frame_loop < frames; frame_loop++) {
throb->framedata[frame_loop] = gdk_pixbuf_new_from_file(frame_files[frame_loop], &err);
if (err != NULL) {
- LOG(("Error when loading %s: %s (%d)",
- frame_files[frame_loop], err->message, err->code));
+ LOG("Error when loading %s: %s (%d)", frame_files[frame_loop], err->message, err->code);
throb->framedata[frame_loop] = NULL;
errors_when_loading = true;
}
diff --git a/gtk/toolbar.c b/gtk/toolbar.c
index b6bf8d98a..35ff25ccc 100644
--- a/gtk/toolbar.c
+++ b/gtk/toolbar.c
@@ -1118,7 +1118,7 @@ void nsgtk_toolbar_customization_load(struct nsgtk_scaffolding *g)
}
val = fgets(buffer, sizeof buffer, f);
if (val == NULL) {
- LOG(("empty read toolbar settings"));
+ LOG("empty read toolbar settings");
}
fclose(f);
i = BACK_BUTTON;
diff --git a/gtk/treeview.c b/gtk/treeview.c
index 9613f11fd..2b2e6c781 100644
--- a/gtk/treeview.c
+++ b/gtk/treeview.c
@@ -534,7 +534,7 @@ struct nsgtk_treeview *nsgtk_treeview_create(unsigned int flags,
tv = malloc(sizeof(struct nsgtk_treeview));
if (tv == NULL) {
- LOG(("malloc failed"));
+ LOG("malloc failed");
warn_user("NoMemory", 0);
return NULL;
}
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++;
}
}
diff --git a/gtk/window.c b/gtk/window.c
index 375f232a8..75a6d9f6b 100644
--- a/gtk/window.c
+++ b/gtk/window.c
@@ -463,7 +463,7 @@ nsgtk_window_scroll_event(GtkWidget *widget,
break;
#endif
default:
- LOG(("Unhandled mouse scroll direction"));
+ LOG("Unhandled mouse scroll direction");
return TRUE;
}
@@ -760,7 +760,7 @@ gui_window_create(struct browser_window *bw,
return NULL;
}
- LOG(("Creating gui window %p for browser window %p", g, bw));
+ LOG("Creating gui window %p for browser window %p", g, bw);
g->bw = bw;
g->mouse.state = 0;
@@ -920,10 +920,10 @@ void nsgtk_window_destroy_browser(struct gui_window *gw)
static void gui_window_destroy(struct gui_window *g)
{
- LOG(("gui_window: %p", g));
+ LOG("gui_window: %p", g);
assert(g != NULL);
assert(g->bw != NULL);
- LOG(("scaffolding: %p", g->scaffold));
+ LOG("scaffolding: %p", g->scaffold);
if (g->prev) {
g->prev->next = g->next;
@@ -935,7 +935,7 @@ static void gui_window_destroy(struct gui_window *g)
g->next->prev = g->prev;
}
- LOG(("window list head: %p", window_list));
+ LOG("window list head: %p", window_list);
}
/**
@@ -954,13 +954,13 @@ static void gui_window_set_icon(struct gui_window *gw, hlcache_handle *icon)
if (icon != NULL) {
icon_bitmap = content_get_bitmap(icon);
if (icon_bitmap != NULL) {
- LOG(("Using %p bitmap", icon_bitmap));
+ LOG("Using %p bitmap", icon_bitmap);
gw->icon = nsgdk_pixbuf_get_from_surface(icon_bitmap->surface, 16, 16);
}
}
if (gw->icon == NULL) {
- LOG(("Using default favicon"));
+ LOG("Using default favicon");
g_object_ref(favicon_pixbuf);
gw->icon = favicon_pixbuf;
}
@@ -1218,8 +1218,8 @@ static void gui_window_get_dimensions(struct gui_window *g, int *width, int *hei
*width /= scale;
*height /= scale;
}
- LOG(("width: %i", *width));
- LOG(("height: %i", *height));
+ LOG("width: %i", *width);
+ LOG("height: %i", *height);
}
static void gui_window_start_selection(struct gui_window *g)
@@ -1250,12 +1250,20 @@ static void gui_window_create_form_select_menu(struct gui_window *g,
item = 0;
option = form_select_get_option(control, item);
while (option != NULL) {
- LOG(("Item %d option %p text %s", item, option, option->text));
+ LOG("Item %"PRIdPTR" option %p text %s",
+ item, option, option->text);
menu_item = gtk_check_menu_item_new_with_label(option->text);
- if (option->selected)
+ if (option->selected) {
gtk_check_menu_item_set_active(
GTK_CHECK_MENU_ITEM(menu_item), TRUE);
+ }
+ /*
+ * This casts the item index integer into an integer
+ * the size of a pointer. This allows the callback
+ * parameter to be passed avoiding allocating memory
+ * for a context with a single integer in it.
+ */
g_signal_connect(menu_item, "toggled",
G_CALLBACK(nsgtk_select_menu_clicked), (gpointer)item);
@@ -1286,10 +1294,10 @@ gui_window_file_gadget_open(struct gui_window *g,
NSGTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
NULL);
- LOG(("*** open dialog: %p", dialog));
+ LOG("*** open dialog: %p", dialog);
int ret = gtk_dialog_run(GTK_DIALOG(dialog));
- LOG(("*** return value: %d", ret));
+ LOG("*** return value: %d", ret);
if (ret == GTK_RESPONSE_ACCEPT) {
char *filename;
diff --git a/image/ico.c b/image/ico.c
index b6743cb7c..9cb650bfe 100644
--- a/image/ico.c
+++ b/image/ico.c
@@ -162,7 +162,7 @@ static bool nsico_convert(struct content *c)
bmp = ico_find(ico->ico, 255, 255);
if (bmp == NULL) {
/* return error */
- LOG(("Failed to select icon"));
+ LOG("Failed to select icon");
return false;
}
@@ -185,7 +185,7 @@ static bool nsico_redraw(struct content *c, struct content_redraw_data *data,
bmp = ico_find(ico->ico, data->width, data->height);
if (bmp == NULL) {
/* return error */
- LOG(("Failed to select icon"));
+ LOG("Failed to select icon");
return false;
}
@@ -194,7 +194,7 @@ static bool nsico_redraw(struct content *c, struct content_redraw_data *data,
if (bmp_decode(bmp) != BMP_OK) {
return false;
} else {
- LOG(("Decoding bitmap"));
+ LOG("Decoding bitmap");
guit->bitmap->modified(bmp->bitmap);
}
@@ -257,7 +257,7 @@ static void *nsico_get_internal(const struct content *c, void *context)
bmp = ico_find(ico->ico, 16, 16);
if (bmp == NULL) {
/* return error */
- LOG(("Failed to select icon"));
+ LOG("Failed to select icon");
return NULL;
}
diff --git a/image/image_cache.c b/image/image_cache.c
index cf15bf75d..49285635f 100644
--- a/image/image_cache.c
+++ b/image/image_cache.c
@@ -224,11 +224,7 @@ static void image_cache__free_bitmap(struct image_cache_entry_s *centry)
{
if (centry->bitmap != NULL) {
#ifdef IMAGE_CACHE_VERBOSE
- LOG(("Freeing bitmap %p size %d age %d redraw count %d",
- centry->bitmap,
- centry->bitmap_size,
- image_cache->current_age - centry->bitmap_age,
- centry->redraw_count));
+ LOG("Freeing bitmap %p size %d age %d redraw count %d", centry->bitmap, centry->bitmap_size, image_cache->current_age - centry->bitmap_age, centry->redraw_count);
#endif
guit->bitmap->destroy(centry->bitmap);
centry->bitmap = NULL;
@@ -245,7 +241,7 @@ static void image_cache__free_bitmap(struct image_cache_entry_s *centry)
static void image_cache__free_entry(struct image_cache_entry_s *centry)
{
#ifdef IMAGE_CACHE_VERBOSE
- LOG(("freeing %p ", centry));
+ LOG("freeing %p ", centry);
#endif
if (centry->redraw_count == 0) {
@@ -287,7 +283,7 @@ static void image_cache__background_update(void *p)
icache->current_age += icache->params.bg_clean_time;
#ifdef IMAGE_CACHE_VERBOSE
- LOG(("Cache age %ds", icache->current_age / 1000));
+ LOG("Cache age %ds", icache->current_age / 1000);
#endif
image_cache__clean(icache);
@@ -339,13 +335,13 @@ bool image_cache_speculate(struct content *c)
if ((image_cache->total_bitmap_size < image_cache->params.limit) &&
(c->size <= image_cache->params.speculative_small)) {
#ifdef IMAGE_CACHE_VERBOSE
- LOG(("content size (%d) is smaller than minimum (%d)", c->size, SPECULATE_SMALL));
+ LOG("content size (%d) is smaller than minimum (%d)", c->size, SPECULATE_SMALL);
#endif
decision = true;
}
#ifdef IMAGE_CACHE_VERBOSE
- LOG(("returning %d", decision));
+ LOG("returning %d", decision);
#endif
return decision;
}
@@ -378,8 +374,8 @@ image_cache_init(const struct image_cache_parameters *image_cache_parameters)
image_cache__background_update,
image_cache);
- LOG(("Image cache initilised with a limit of %d hysteresis of %d",
- image_cache->params.limit, image_cache->params.hysteresis));
+ LOG("Image cache initilised with a limit of %zd hysteresis of %zd",
+ image_cache->params.limit, image_cache->params.hysteresis);
return NSERROR_OK;
}
@@ -391,9 +387,8 @@ nserror image_cache_fini(void)
guit->browser->schedule(-1, image_cache__background_update, image_cache);
- LOG(("Size at finish %d (in %d)",
- image_cache->total_bitmap_size,
- image_cache->bitmap_count));
+ LOG("Size at finish %zd (in %d)",
+ image_cache->total_bitmap_size, image_cache->bitmap_count);
while (image_cache->entries != NULL) {
image_cache__free_entry(image_cache->entries);
@@ -403,13 +398,11 @@ nserror image_cache_fini(void)
image_cache->miss_count +
image_cache->fail_count;
- LOG(("Age %ds", image_cache->current_age / 1000));
- LOG(("Peak size %d (in %d)",
- image_cache->max_bitmap_size,
- image_cache->max_bitmap_size_count ));
- LOG(("Peak image count %d (size %d)",
- image_cache->max_bitmap_count,
- image_cache->max_bitmap_count_size));
+ LOG("Age %ds", image_cache->current_age / 1000);
+ LOG("Peak size %zd (in %d)",
+ image_cache->max_bitmap_size, image_cache->max_bitmap_size_count);
+ LOG("Peak image count %d (size %zd)",
+ image_cache->max_bitmap_count, image_cache->max_bitmap_count_size);
if (op_count > 0) {
uint64_t op_size;
@@ -418,35 +411,35 @@ nserror image_cache_fini(void)
image_cache->miss_size +
image_cache->fail_size;
- LOG(("Cache total/hit/miss/fail (counts) %d/%d/%d/%d (100%%/%d%%/%d%%/%d%%)",
- op_count,
- image_cache->hit_count,
- image_cache->miss_count,
- image_cache->fail_count,
- (image_cache->hit_count * 100) / op_count,
- (image_cache->miss_count * 100) / op_count,
- (image_cache->fail_count * 100) / op_count));
- LOG(("Cache total/hit/miss/fail (size) %d/%d/%d/%d (100%%/%d%%/%d%%/%d%%)",
- op_size,
- image_cache->hit_size,
- image_cache->miss_size,
- image_cache->fail_size,
- (image_cache->hit_size * 100) / op_size,
- (image_cache->miss_size * 100) / op_size,
- (image_cache->fail_size * 100) / op_size));
+ LOG("Cache total/hit/miss/fail (counts) %d/%d/%d/%d (100%%/%d%%/%d%%/%d%%)",
+ op_count,
+ image_cache->hit_count,
+ image_cache->miss_count,
+ image_cache->fail_count,
+ (image_cache->hit_count * 100) / op_count,
+ (image_cache->miss_count * 100) / op_count,
+ (image_cache->fail_count * 100) / op_count);
+ LOG("Cache total/hit/miss/fail (size) %zd/%zd/%zd/%zd (100%%/%"PRId64"%%/%"PRId64"%%/%"PRId64"%%)",
+ op_size,
+ image_cache->hit_size,
+ image_cache->miss_size,
+ image_cache->fail_size,
+ (image_cache->hit_size * 100) / op_size,
+ (image_cache->miss_size * 100) / op_size,
+ (image_cache->fail_size * 100) / op_size);
}
- LOG(("Total images never rendered: %d (includes %d that were converted)",
- image_cache->total_unrendered,
- image_cache->specultive_miss_count));
+ LOG("Total images never rendered: %d (includes %d that were converted)",
+ image_cache->total_unrendered,
+ image_cache->specultive_miss_count);
- LOG(("Total number of excessive conversions: %d (from %d images converted more than once)",
- image_cache->total_extra_conversions,
- image_cache->total_extra_conversions_count));
+ LOG("Total number of excessive conversions: %d (from %d images converted more than once)",
+ image_cache->total_extra_conversions,
+ image_cache->total_extra_conversions_count);
- LOG(("Bitmap of size %d had most (%d) conversions",
- image_cache->peak_conversions_size,
- image_cache->peak_conversions));
+ LOG("Bitmap of size %d had most (%d) conversions",
+ image_cache->peak_conversions_size,
+ image_cache->peak_conversions);
free(image_cache);
@@ -478,7 +471,7 @@ nserror image_cache_add(struct content *content,
centry->bitmap_size = content->width * content->height * 4;
}
- LOG(("centry %p, content %p, bitmap %p", centry, content, bitmap));
+ LOG("centry %p, content %p, bitmap %p", centry, content, bitmap);
centry->convert = convert;
@@ -517,7 +510,7 @@ nserror image_cache_remove(struct content *content)
/* get the cache entry */
centry = image_cache__find(content);
if (centry == NULL) {
- LOG(("Could not find cache entry for content (%p)", content));
+ LOG("Could not find cache entry for content (%p)", content);
return NSERROR_NOT_FOUND;
}
@@ -747,7 +740,7 @@ bool image_cache_redraw(struct content *c,
/* get the cache entry */
centry = image_cache__find(c);
if (centry == NULL) {
- LOG(("Could not find cache entry for content (%p)", c));
+ LOG("Could not find cache entry for content (%p)", c);
return false;
}
@@ -785,7 +778,7 @@ void image_cache_destroy(struct content *content)
/* get the cache entry */
centry = image_cache__find(content);
if (centry == NULL) {
- LOG(("Could not find cache entry for content (%p)", content));
+ LOG("Could not find cache entry for content (%p)", content);
} else {
image_cache__free_entry(centry);
}
diff --git a/image/jpeg.c b/image/jpeg.c
index 309dec0a1..8e6ac8528 100644
--- a/image/jpeg.c
+++ b/image/jpeg.c
@@ -140,7 +140,7 @@ static void nsjpeg_term_source(j_decompress_ptr cinfo)
static void nsjpeg_error_log(j_common_ptr cinfo)
{
cinfo->err->format_message(cinfo, nsjpeg_error_buffer);
- LOG(("%s", nsjpeg_error_buffer));
+ LOG("%s", nsjpeg_error_buffer);
}
@@ -154,7 +154,7 @@ static void nsjpeg_error_exit(j_common_ptr cinfo)
jmp_buf *setjmp_buffer = (jmp_buf *) cinfo->client_data;
cinfo->err->format_message(cinfo, nsjpeg_error_buffer);
- LOG(("%s", nsjpeg_error_buffer));
+ LOG("%s", nsjpeg_error_buffer);
longjmp(*setjmp_buffer, 1);
}
diff --git a/image/png.c b/image/png.c
index ecb7e3c65..5d68d2f8a 100644
--- a/image/png.c
+++ b/image/png.c
@@ -71,7 +71,7 @@ enum nspng_cberr {
*/
static void nspng_warning(png_structp png_ptr, png_const_charp warning_message)
{
- LOG(("%s", warning_message));
+ LOG("%s", warning_message);
}
/**
@@ -79,7 +79,7 @@ static void nspng_warning(png_structp png_ptr, png_const_charp warning_message)
*/
static void nspng_error(png_structp png_ptr, png_const_charp error_message)
{
- LOG(("%s", error_message));
+ LOG("%s", error_message);
longjmp(png_jmpbuf(png_ptr), CBERR_LIBPNG);
}
@@ -172,8 +172,7 @@ static void info_callback(png_structp png_s, png_infop info)
png_c->rowbytes = png_get_rowbytes(png_s, info);
png_c->interlace = (interlace == PNG_INTERLACE_ADAM7);
- LOG(("size %li * %li, rowbytes %zu", (unsigned long)width,
- (unsigned long)height, png_c->rowbytes));
+ LOG("size %li * %li, rowbytes %zu", (unsigned long)width, (unsigned long)height, png_c->rowbytes);
}
static void row_callback(png_structp png_s, png_bytep new_row,
@@ -261,7 +260,7 @@ static nserror nspng_create_png_data(nspng_content *png_c)
if (setjmp(png_jmpbuf(png_c->png))) {
png_destroy_read_struct(&png_c->png, &png_c->info, 0);
- LOG(("Failed to set callbacks"));
+ LOG("Failed to set callbacks");
png_c->png = NULL;
png_c->info = NULL;
@@ -349,7 +348,7 @@ static bool nspng_process_data(struct content *c, const char *data,
* up png conversion and signal the content
* error
*/
- LOG(("Fatal PNG error during header, error content"));
+ LOG("Fatal PNG error during header, error content");
png_destroy_read_struct(&png_c->png, &png_c->info, 0);
png_c->png = NULL;
diff --git a/image/rsvg.c b/image/rsvg.c
index 3dd27fed6..4ffb43aa8 100644
--- a/image/rsvg.c
+++ b/image/rsvg.c
@@ -66,7 +66,7 @@ static nserror rsvg_create_svg_data(rsvg_content *c)
c->bitmap = NULL;
if ((c->rsvgh = rsvg_handle_new()) == NULL) {
- LOG(("rsvg_handle_new() returned NULL."));
+ LOG("rsvg_handle_new() returned NULL.");
msg_data.error = messages_get("NoMemory");
content_broadcast(&c->base, CONTENT_MSG_ERROR, msg_data);
return NSERROR_NOMEM;
@@ -116,7 +116,7 @@ static bool rsvg_process_data(struct content *c, const char *data,
if (rsvg_handle_write(d->rsvgh, (const guchar *)data, (gsize)size,
&err) == FALSE) {
- LOG(("rsvg_handle_write returned an error: %s", err->message));
+ LOG("rsvg_handle_write returned an error: %s", err->message);
msg_data.error = err->message;
content_broadcast(c, CONTENT_MSG_ERROR, msg_data);
return false;
@@ -162,7 +162,7 @@ static bool rsvg_convert(struct content *c)
GError *err = NULL;
if (rsvg_handle_close(d->rsvgh, &err) == FALSE) {
- LOG(("rsvg_handle_close returned an error: %s", err->message));
+ LOG("rsvg_handle_close returned an error: %s", err->message);
msg_data.error = err->message;
content_broadcast(c, CONTENT_MSG_ERROR, msg_data);
return false;
@@ -180,7 +180,7 @@ static bool rsvg_convert(struct content *c)
if ((d->bitmap = guit->bitmap->create(c->width, c->height,
BITMAP_NEW)) == NULL) {
- LOG(("Failed to create bitmap for rsvg render."));
+ LOG("Failed to create bitmap for rsvg render.");
msg_data.error = messages_get("NoMemory");
content_broadcast(c, CONTENT_MSG_ERROR, msg_data);
return false;
@@ -191,14 +191,14 @@ static bool rsvg_convert(struct content *c)
CAIRO_FORMAT_ARGB32,
c->width, c->height,
guit->bitmap->get_rowstride(d->bitmap))) == NULL) {
- LOG(("Failed to create Cairo image surface for rsvg render."));
+ LOG("Failed to create Cairo image surface for rsvg render.");
msg_data.error = messages_get("NoMemory");
content_broadcast(c, CONTENT_MSG_ERROR, msg_data);
return false;
}
if ((d->ct = cairo_create(d->cs)) == NULL) {
- LOG(("Failed to create Cairo drawing context for rsvg render."));
+ LOG("Failed to create Cairo drawing context for rsvg render.");
msg_data.error = messages_get("NoMemory");
content_broadcast(c, CONTENT_MSG_ERROR, msg_data);
return false;
diff --git a/javascript/jsapi.c b/javascript/jsapi.c
index f8e3889e9..fced53218 100644
--- a/javascript/jsapi.c
+++ b/javascript/jsapi.c
@@ -208,7 +208,7 @@ static struct heartbeat *enable_heartbeat(JSContext *cx)
} else {
free(hb);
hb = NULL;
- LOG(("Unable to set heartbeat"));
+ LOG("Unable to set heartbeat");
}
}
return hb;
diff --git a/monkey/browser.c b/monkey/browser.c
index 2b78537db..a13262170 100644
--- a/monkey/browser.c
+++ b/monkey/browser.c
@@ -437,7 +437,7 @@ monkey_window_handle_redraw(int argc, char **argv)
clip.y1 = atoi(argv[6]);
}
- LOG(("Issue redraw"));
+ LOG("Issue redraw");
fprintf(stdout, "WINDOW REDRAW WIN %d START\n", atoi(argv[2]));
browser_window_redraw(gw->bw, gw->scrollx, gw->scrolly, &clip, &ctx);
fprintf(stdout, "WINDOW REDRAW WIN %d STOP\n", atoi(argv[2]));
diff --git a/monkey/dispatch.c b/monkey/dispatch.c
index c70070d4e..563534d64 100644
--- a/monkey/dispatch.c
+++ b/monkey/dispatch.c
@@ -40,7 +40,7 @@ monkey_register_handler(const char *cmd, handle_command_fn fn)
{
monkey_cmdhandler_t *ret = calloc(sizeof(*ret), 1);
if (ret == NULL) {
- LOG(("Unable to allocate handler"));
+ LOG("Unable to allocate handler");
return NSERROR_NOMEM;
}
ret->cmd = strdup(cmd);
diff --git a/monkey/filetype.c b/monkey/filetype.c
index 8c5037781..891dcd30b 100644
--- a/monkey/filetype.c
+++ b/monkey/filetype.c
@@ -70,7 +70,7 @@ void monkey_fetch_filetype_init(const char *mimefile)
hash_add(mime_hash, "spr", "image/x-riscos-sprite");
if (fh == NULL) {
- LOG(("Unable to open a mime.types file, so using a minimal one for you."));
+ LOG("Unable to open a mime.types file, so using a minimal one for you.");
return;
}
diff --git a/monkey/poll.c b/monkey/poll.c
index 6e96919a1..3ec31af86 100644
--- a/monkey/poll.c
+++ b/monkey/poll.c
@@ -29,7 +29,7 @@
#ifdef DEBUG_POLL_LOOP
#include "utils/log.h"
#else
-#define LOG(X)
+#define LOG(fmt, args...) ((void) 0)
#endif
@@ -103,7 +103,7 @@ void monkey_poll(void)
fd->events = G_IO_IN | G_IO_HUP | G_IO_ERR;
g_main_context_add_poll(0, fd, 0);
fd_list[fd_count++] = fd;
- LOG(("Want to read %d", i));
+ LOG("Want to read %d", i);
}
if (FD_ISSET(i, &write_fd_set)) {
GPollFD *fd = malloc(sizeof *fd);
@@ -111,7 +111,7 @@ void monkey_poll(void)
fd->events = G_IO_OUT | G_IO_ERR;
g_main_context_add_poll(0, fd, 0);
fd_list[fd_count++] = fd;
- LOG(("Want to write %d", i));
+ LOG("Want to write %d", i);
}
if (FD_ISSET(i, &exc_fd_set)) {
GPollFD *fd = malloc(sizeof *fd);
@@ -119,13 +119,13 @@ void monkey_poll(void)
fd->events = G_IO_ERR;
g_main_context_add_poll(0, fd, 0);
fd_list[fd_count++] = fd;
- LOG(("Want to check %d", i));
+ LOG("Want to check %d", i);
}
}
schedule_run();
- LOG(("Iterate %sblocking", block?"":"non-"));
+ LOG("Iterate %sblocking", block ? "" : "non-");
if (block) {
fprintf(stdout, "GENERIC POLL BLOCKING\n");
}
diff --git a/monkey/schedule.c b/monkey/schedule.c
index e8ec1c6fa..d6f8e65dc 100644
--- a/monkey/schedule.c
+++ b/monkey/schedule.c
@@ -29,7 +29,7 @@
#ifdef DEBUG_MONKEY_SCHEDULE
#include "utils/log.h"
#else
-#define LOG(X)
+#define LOG(fmt, args...) ((void) 0)
#endif
/** Killable callback closure embodiment. */
@@ -52,10 +52,10 @@ nsgtk_schedule_generic_callback(gpointer data)
_nsgtk_callback_t *cb = (_nsgtk_callback_t *)(data);
if (cb->callback_killed) {
/* This callback instance has been killed. */
- LOG(("CB at %p already dead.", cb));
+ LOG("CB at %p already dead.", cb);
}
queued_callbacks = g_list_remove(queued_callbacks, cb);
- LOG(("CB %p(%p) now pending run", cb->callback, cb->context));
+ LOG("CB %p(%p) now pending run", cb->callback, cb->context);
pending_callbacks = g_list_append(pending_callbacks, cb);
return FALSE;
}
@@ -67,8 +67,7 @@ nsgtk_schedule_kill_callback(void *_target, void *_match)
_nsgtk_callback_t *match = (_nsgtk_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;
@@ -106,7 +105,7 @@ nserror monkey_schedule(int t, void (*callback)(void *p), void *p)
cb->context = p;
cb->callback_killed = false;
/* Prepend is faster right now. */
- LOG(("queued a callback to %p(%p) for %d msecs time", callback, p, t));
+ LOG("queued a callback to %p(%p) for %d msecs time", callback, p, t);
queued_callbacks = g_list_prepend(queued_callbacks, cb);
g_timeout_add(t, nsgtk_schedule_generic_callback, cb);
@@ -126,17 +125,17 @@ schedule_run(void)
/* Clear the pending list. */
pending_callbacks = NULL;
- LOG(("Captured a run of %d callbacks to fire.", g_list_length(this_run)));
+ LOG("Captured a run of %d callbacks to fire.", g_list_length(this_run));
/* Run all the callbacks which made it this far. */
while (this_run != NULL) {
_nsgtk_callback_t *cb = (_nsgtk_callback_t *)(this_run->data);
this_run = g_list_remove(this_run, this_run->data);
if (!cb->callback_killed) {
- LOG(("CB DO %p(%p)", cb->callback, cb->context));
+ LOG("CB DO %p(%p)", cb->callback, cb->context);
cb->callback(cb->context);
} else {
- LOG(("CB %p(%p) already dead, dropping", cb->callback, cb->context));
+ LOG("CB %p(%p) already dead, dropping", cb->callback, cb->context);
}
free(cb);
}
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;
}
diff --git a/riscos/401login.c b/riscos/401login.c
index 16d35c8f7..acb7a0165 100644
--- a/riscos/401login.c
+++ b/riscos/401login.c
@@ -194,8 +194,7 @@ void ro_gui_401login_close(wimp_w w)
error = xwimp_delete_window(w);
if (error) {
- LOG(("xwimp_delete_window: 0x%x:%s",
- error->errnum, error->errmess));
+ LOG("xwimp_delete_window: 0x%x:%s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
ro_gui_wimp_event_finalise(w);
@@ -216,7 +215,7 @@ bool ro_gui_401login_apply(wimp_w w)
auth = malloc(strlen(session->uname) + strlen(session->pwd) + 2);
if (!auth) {
- LOG(("calloc failed"));
+ LOG("calloc failed");
warn_user("NoMemory", 0);
return false;
}
diff --git a/riscos/bitmap.c b/riscos/bitmap.c
index 2cc85c4b7..384895d32 100644
--- a/riscos/bitmap.c
+++ b/riscos/bitmap.c
@@ -282,8 +282,7 @@ bool riscos_bitmap_save(void *vbitmap, const char *path, unsigned flags)
error = xosspriteop_save_sprite_file(osspriteop_USER_AREA,
(bitmap->sprite_area), path);
if (error) {
- LOG(("xosspriteop_save_sprite_file: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosspriteop_save_sprite_file: 0x%x: %s", error->errnum, error->errmess);
warn_user("SaveError", error->errmess);
return false;
}
@@ -343,8 +342,7 @@ bool riscos_bitmap_save(void *vbitmap, const char *path, unsigned flags)
error = xosfind_openoutw(0, path, NULL, &fw);
if (error) {
- LOG(("xosfind_openoutw: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfind_openoutw: 0x%x: %s", error->errnum, error->errmess);
free(chunk_buf);
warn_user("SaveError", error->errmess);
return false;
@@ -358,7 +356,7 @@ bool riscos_bitmap_save(void *vbitmap, const char *path, unsigned flags)
if (!error)
error = xosgbpb_writew(fw, (byte*)p, image_size, NULL);
if (error) {
- LOG(("xosgbpb_writew: 0x%x: %s", error->errnum, error->errmess));
+ LOG("xosgbpb_writew: 0x%x: %s", error->errnum, error->errmess);
free(chunk_buf);
xosfind_closew(fw);
warn_user("SaveError", error->errmess);
@@ -403,8 +401,7 @@ bool riscos_bitmap_save(void *vbitmap, const char *path, unsigned flags)
}
error = xosgbpb_writew(fw, (byte*)chunk_buf, dp-chunk_buf, NULL);
if (error) {
- LOG(("xosgbpb_writew: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosgbpb_writew: 0x%x: %s", error->errnum, error->errmess);
free(chunk_buf);
xosfind_closew(fw);
warn_user("SaveError", error->errmess);
@@ -414,15 +411,13 @@ bool riscos_bitmap_save(void *vbitmap, const char *path, unsigned flags)
error = xosfind_closew(fw);
if (error) {
- LOG(("xosfind_closew: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfind_closew: 0x%x: %s", error->errnum, error->errmess);
warn_user("SaveError", error->errmess);
}
error = xosfile_set_type(path, osfile_TYPE_SPRITE);
if (error) {
- LOG(("xosfile_set_type: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfile_set_type: 0x%x: %s", error->errnum, error->errmess);
warn_user("SaveError", error->errmess);
}
@@ -509,8 +504,7 @@ void riscos_bitmap_overlay_sprite(struct bitmap *bitmap,
(osspriteop_id)s,
&w, &h, NULL, NULL);
if (error) {
- LOG(("xosspriteop_read_sprite_info: 0x%x:%s",
- error->errnum, error->errmess));
+ LOG("xosspriteop_read_sprite_info: 0x%x:%s", error->errnum, error->errmess);
return;
}
sp_offset = ((s->width + 1) * 4) - w;
@@ -592,7 +586,7 @@ static osspriteop_area *thumbnail_create_8bpp(struct bitmap *bitmap)
sprite_area = (osspriteop_area *)malloc(area_size);
if (!sprite_area) {
- LOG(("no memory for malloc()"));
+ LOG("no memory for malloc()");
return NULL;
}
sprite_area->size = area_size;
@@ -760,7 +754,7 @@ static void thumbnail_test(void)
area_size = sizeof(osspriteop_area) +
sizeof(osspriteop_header) + sizeof(int);
if ((sprite_area = (osspriteop_area *)malloc(area_size)) == NULL) {
- LOG(("Insufficient memory to perform sprite test."));
+ LOG("Insufficient memory to perform sprite test.");
return;
}
sprite_area->size = area_size + 1;
@@ -792,7 +786,7 @@ nserror riscos_bitmap_render(struct bitmap *bitmap,
assert(content);
assert(bitmap);
- LOG(("content %p in bitmap %p", content, bitmap));
+ LOG("content %p in bitmap %p", content, bitmap);
/* check if we have access to 32bpp sprites natively */
if (thumbnail_32bpp_available == -1) {
diff --git a/riscos/buffer.c b/riscos/buffer.c
index a8cb7fdf5..e5c73359a 100644
--- a/riscos/buffer.c
+++ b/riscos/buffer.c
@@ -98,9 +98,7 @@ void ro_gui_buffer_open(wimp_draw *redraw)
*/
if ((clipping.x1 < clipping.x0) ||
(clipping.y1 < clipping.y0)) {
- LOG(("Invalid clipping rectangle (%i, %i) to (%i,%i)",
- clipping.x0, clipping.y0,
- clipping.x1, clipping.y1));
+ LOG("Invalid clipping rectangle (%i, %i) to (%i,%i)", clipping.x0, clipping.y0, clipping.x1, clipping.y1);
return;
}
@@ -131,7 +129,7 @@ void ro_gui_buffer_open(wimp_draw *redraw)
(word_width * sprite_size.y * 4) + palette_size;
buffer = (osspriteop_area *)malloc(total_size);
if (!buffer) {
- LOG(("Failed to allocate memory"));
+ LOG("Failed to allocate memory");
ro_gui_buffer_free();
return;
}
@@ -142,7 +140,7 @@ void ro_gui_buffer_open(wimp_draw *redraw)
mode = tinct_SPRITE_MODE;
#else
if ((error = xwimpreadsysinfo_wimp_mode(&mode)) != NULL) {
- LOG(("Error reading mode '%s'", error->errmess));
+ LOG("Error reading mode '%s'", error->errmess);
ro_gui_buffer_free();
return;
}
@@ -164,7 +162,7 @@ void ro_gui_buffer_open(wimp_draw *redraw)
error = xos_read_vdu_variables(PTR_OS_VDU_VAR_LIST(&vars), vals);
if (error) {
- LOG(("Error reading mode properties '%s'", error->errmess));
+ LOG("Error reading mode properties '%s'", error->errmess);
ro_gui_buffer_free();
return;
}
@@ -209,7 +207,7 @@ void ro_gui_buffer_open(wimp_draw *redraw)
buffer, buffer_name, palette,
clipping.x0, clipping.y0,
clipping.x1, clipping.y1)) != NULL) {
- LOG(("Grab error '%s'", error->errmess));
+ LOG("Grab error '%s'", error->errmess);
ro_gui_buffer_free();
return;
}
@@ -218,7 +216,7 @@ void ro_gui_buffer_open(wimp_draw *redraw)
*/
if ((error = xosspriteop_read_save_area_size(osspriteop_PTR,
buffer, (osspriteop_id)(buffer + 1), &size)) != NULL) {
- LOG(("Save area error '%s'", error->errmess));
+ LOG("Save area error '%s'", error->errmess);
ro_gui_buffer_free();
return;
}
@@ -233,7 +231,7 @@ void ro_gui_buffer_open(wimp_draw *redraw)
if ((error = xosspriteop_switch_output_to_sprite(osspriteop_PTR,
buffer, (osspriteop_id)(buffer + 1), save_area,
&context0, &context1, &context2, &context3)) != NULL) {
- LOG(("Switching error '%s'", error->errmess));
+ LOG("Switching error '%s'", error->errmess);
free(save_area);
ro_gui_buffer_free();
return;
@@ -249,7 +247,7 @@ void ro_gui_buffer_open(wimp_draw *redraw)
*/
if ((error = xos_set_ecf_origin(-ro_plot_origin_x,
-ro_plot_origin_y)) != NULL) {
- LOG(("Invalid ECF origin: '%s'", error->errmess));
+ LOG("Invalid ECF origin: '%s'", error->errmess);
}
}
diff --git a/riscos/configure.c b/riscos/configure.c
index 68aa3c0c6..62937b543 100644
--- a/riscos/configure.c
+++ b/riscos/configure.c
@@ -212,8 +212,7 @@ void ro_gui_configure_open_window(wimp_open *open)
y + configure_icon_height -
CONFIGURE_ICON_PADDING_V);
if (error) {
- LOG(("xwimp_resize_icon: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_resize_icon: 0x%x: %s", error->errnum, error->errmess);
}
x += configure_icon_width;
l++;
@@ -226,8 +225,7 @@ void ro_gui_configure_open_window(wimp_open *open)
error = xwimp_force_redraw(configure_window,
0, -16384, 16384, 0);
if (error) {
- LOG(("xwimp_force_redraw: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_force_redraw: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
}
@@ -250,8 +248,7 @@ void ro_gui_configure_open_window(wimp_open *open)
extent.y0 = -max_height;
error = xwimp_set_extent(open->w, &extent);
if (error) {
- LOG(("xwimp_set_extent: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_set_extent: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -262,8 +259,7 @@ void ro_gui_configure_open_window(wimp_open *open)
/* open the window */
error = xwimp_open_window(open);
if (error) {
- LOG(("xwimp_open_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -280,7 +276,7 @@ void ro_gui_configure_register(const char *window,
/* create our tool */
tool = calloc(sizeof(struct configure_tool), 1);
if (!tool) {
- LOG(("Insufficient memory for calloc()"));
+ LOG("Insufficient memory for calloc()");
die("Insufficient memory");
return; /* For the benefit of scan-build */
}
@@ -288,7 +284,7 @@ void ro_gui_configure_register(const char *window,
tool->translated[0] = '\0';
tool->validation = malloc(strlen(window) + 2);
if (!tool->validation) {
- LOG(("Insufficient memory for malloc()"));
+ LOG("Insufficient memory for malloc()");
die("Insufficient memory");
}
sprintf(tool->validation, "S%s", window);
@@ -315,8 +311,7 @@ void ro_gui_configure_register(const char *window,
CONFIGURE_TOOL_TRANSLATED_SIZE;
error = xwimp_create_icon(&new_icon, &tool->i);
if (error) {
- LOG(("xwimp_create_icon: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_create_icon: 0x%x: %s", error->errnum, error->errmess);
die(error->errmess);
}
@@ -365,8 +360,7 @@ bool ro_gui_configure_translate(void)
error = xosbyte1(osbyte_ALPHABET_NUMBER, 127, 0,
&alphabet);
if (error) {
- LOG(("failed reading alphabet: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("failed reading alphabet: 0x%x: %s", error->errnum, error->errmess);
/* assume Latin1 */
alphabet = territory_ALPHABET_LATIN1;
}
@@ -387,8 +381,7 @@ bool ro_gui_configure_translate(void)
error = xwimptextop_string_width(tool->translated,
strlen(tool->translated), &icon_width);
if (error) {
- LOG(("xwimptextop_string_width: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimptextop_string_width: 0x%x: %s", error->errnum, error->errmess);
return false;
}
icon_width += CONFIGURE_ICON_PADDING_H;
@@ -402,8 +395,7 @@ bool ro_gui_configure_translate(void)
configure_icon_width,
0);
if (error) {
- LOG(("xwimp_resize_icon: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_resize_icon: 0x%x: %s", error->errnum, error->errmess);
}
}
diff --git a/riscos/configure/con_language.c b/riscos/configure/con_language.c
index ace7a6fdf..48c20fc46 100644
--- a/riscos/configure/con_language.c
+++ b/riscos/configure/con_language.c
@@ -99,7 +99,7 @@ bool ro_gui_options_language_ok(wimp_w w)
if (temp) {
nsoption_set_charp(language, temp);
} else {
- LOG(("No memory to duplicate language code"));
+ LOG("No memory to duplicate language code");
warn_user("NoMemory", 0);
}
}
@@ -114,7 +114,7 @@ bool ro_gui_options_language_ok(wimp_w w)
if (temp) {
nsoption_set_charp(accept_language,temp);
} else {
- LOG(("No memory to duplicate language code"));
+ LOG("No memory to duplicate language code");
warn_user("NoMemory", 0);
}
}
diff --git a/riscos/configure/con_theme.c b/riscos/configure/con_theme.c
index 13ba3165c..bee2231cd 100644
--- a/riscos/configure/con_theme.c
+++ b/riscos/configure/con_theme.c
@@ -102,23 +102,20 @@ bool ro_gui_options_theme_initialise(wimp_w w)
return false;
error = xwimp_create_window(&theme_pane_definition, &theme_pane);
if (error) {
- LOG(("xwimp_create_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_create_window: 0x%x: %s", error->errnum, error->errmess);
return false;
}
state.w = w;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
return false;
}
icon_state.w = w;
icon_state.i = THEME_PANE_AREA;
error = xwimp_get_icon_state(&icon_state);
if (error) {
- LOG(("xwimp_get_icon_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess);
return false;
}
state.w = theme_pane;
@@ -127,7 +124,7 @@ bool ro_gui_options_theme_initialise(wimp_w w)
state.visible.x0 += icon_state.icon.extent.x0 + 16;
state.visible.y0 = state.visible.y1 + icon_state.icon.extent.y0 + 16;
state.visible.y1 += icon_state.icon.extent.y1 - 28;
- LOG(("Y0 = %i, y1 = %i", icon_state.icon.extent.y0, icon_state.icon.extent.y1));
+ LOG("Y0 = %i, y1 = %i", icon_state.icon.extent.y0, icon_state.icon.extent.y1);
error = xwimp_open_window_nested(PTR_WIMP_OPEN(&state), w,
wimp_CHILD_LINKS_PARENT_VISIBLE_BOTTOM_OR_LEFT
<< wimp_CHILD_XORIGIN_SHIFT |
@@ -142,8 +139,7 @@ bool ro_gui_options_theme_initialise(wimp_w w)
wimp_CHILD_LINKS_PARENT_VISIBLE_TOP_OR_RIGHT
<< wimp_CHILD_TS_EDGE_SHIFT);
if (error) {
- LOG(("xwimp_open_window_nested: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_open_window_nested: 0x%x: %s", error->errnum, error->errmess);
return false;
}
@@ -178,8 +174,7 @@ void ro_gui_options_theme_finalise(wimp_w w)
ro_gui_wimp_event_finalise(theme_pane);
error = xwimp_delete_window(theme_pane);
if (error) {
- LOG(("xwimp_delete_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_delete_window: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
theme_pane = 0;
@@ -272,7 +267,7 @@ void ro_gui_options_theme_load(void)
ro_toolbar_rebuild(toolbar);
toolbar_display = calloc(sizeof(struct toolbar_display), 1);
if (!toolbar_display) {
- LOG(("No memory for calloc()"));
+ LOG("No memory for calloc()");
warn_user("NoMemory", 0);
return;
}
@@ -294,8 +289,7 @@ void ro_gui_options_theme_load(void)
state.w = theme_pane;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
diff --git a/riscos/content-handlers/artworks.c b/riscos/content-handlers/artworks.c
index 80733c680..9ec04a7e5 100644
--- a/riscos/content-handlers/artworks.c
+++ b/riscos/content-handlers/artworks.c
@@ -179,7 +179,7 @@ bool artworks_convert(struct content *c)
xos_read_var_val_size("Alias$LoadArtWorksModules", 0, os_VARTYPE_STRING,
&used, NULL, NULL);
if (used >= 0) {
- LOG(("Alias$LoadArtWorksModules not defined"));
+ LOG("Alias$LoadArtWorksModules not defined");
msg_data.error = messages_get("AWNotSeen");
content_broadcast(c, CONTENT_MSG_ERROR, msg_data);
return false;
@@ -188,8 +188,7 @@ bool artworks_convert(struct content *c)
/* load the modules, or do nothing if they're already loaded */
error = xos_cli("LoadArtWorksModules");
if (error) {
- LOG(("xos_cli: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xos_cli: 0x%x: %s", error->errnum, error->errmess);
msg_data.error = error->errmess;
content_broadcast(c, CONTENT_MSG_ERROR, msg_data);
return false;
@@ -199,8 +198,7 @@ bool artworks_convert(struct content *c)
error = (os_error*)_swix(AWRender_FileInitAddress, _OUT(0) | _OUT(1),
&init_routine, &init_workspace);
if (error) {
- LOG(("AWRender_FileInitAddress: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("AWRender_FileInitAddress: 0x%x: %s", error->errnum, error->errmess);
msg_data.error = error->errmess;
content_broadcast(c, CONTENT_MSG_ERROR, msg_data);
return false;
@@ -210,8 +208,7 @@ bool artworks_convert(struct content *c)
&aw->render_routine,
&aw->render_workspace);
if (error) {
- LOG(("AWRender_RenderAddress: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("AWRender_RenderAddress: 0x%x: %s", error->errnum, error->errmess);
msg_data.error = error->errmess;
content_broadcast(c, CONTENT_MSG_ERROR, msg_data);
return false;
@@ -223,8 +220,7 @@ bool artworks_convert(struct content *c)
error = awrender_init(&source_data, &source_size,
init_routine, init_workspace);
if (error) {
- LOG(("awrender_init: 0x%x : %s",
- error->errnum, error->errmess));
+ LOG("awrender_init: 0x%x : %s", error->errnum, error->errmess);
msg_data.error = error->errmess;
content_broadcast(c, CONTENT_MSG_ERROR, msg_data);
return false;
@@ -239,14 +235,13 @@ bool artworks_convert(struct content *c)
&aw->y1);
if (error) {
- LOG(("AWRender_DocBounds: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("AWRender_DocBounds: 0x%x: %s", error->errnum, error->errmess);
msg_data.error = error->errmess;
content_broadcast(c, CONTENT_MSG_ERROR, msg_data);
return false;
}
- LOG(("bounding box: %d,%d,%d,%d", aw->x0, aw->y0, aw->x1, aw->y1));
+ LOG("bounding box: %d,%d,%d,%d", aw->x0, aw->y0, aw->x1, aw->y1);
/* create the resizable workspace required by the
ArtWorksRenderer rendering routine */
@@ -254,7 +249,7 @@ bool artworks_convert(struct content *c)
aw->size = INITIAL_BLOCK_SIZE;
aw->block = malloc(INITIAL_BLOCK_SIZE);
if (!aw->block) {
- LOG(("failed to create block for ArtworksRenderer"));
+ LOG("failed to create block for ArtworksRenderer");
msg_data.error = messages_get("NoMemory");
content_broadcast(c, CONTENT_MSG_ERROR, msg_data);
return false;
@@ -369,15 +364,13 @@ bool artworks_redraw(struct content *c, struct content_redraw_data *data,
error = xos_read_vdu_variables(PTR_OS_VDU_VAR_LIST(&vars), vals);
if (error) {
- LOG(("xos_read_vdu_variables: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xos_read_vdu_variables: 0x%x: %s", error->errnum, error->errmess);
return false;
}
error = xwimp_read_palette((os_palette*)&vals[3]);
if (error) {
- LOG(("xwimp_read_palette: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_read_palette: 0x%x: %s", error->errnum, error->errmess);
return false;
}
@@ -396,8 +389,7 @@ bool artworks_redraw(struct content *c, struct content_redraw_data *data,
aw->render_workspace);
if (error) {
- LOG(("awrender_render: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("awrender_render: 0x%x: %s", error->errnum, error->errmess);
return false;
}
diff --git a/riscos/content-handlers/draw.c b/riscos/content-handlers/draw.c
index 552423980..c2524d496 100644
--- a/riscos/content-handlers/draw.c
+++ b/riscos/content-handlers/draw.c
@@ -122,8 +122,7 @@ bool draw_convert(struct content *c)
error = xdrawfile_bbox(0, (drawfile_diagram *) data,
(int) source_size, 0, &bbox);
if (error) {
- LOG(("xdrawfile_bbox: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xdrawfile_bbox: 0x%x: %s", error->errnum, error->errmess);
msg_data.error = error->errmess;
content_broadcast(c, CONTENT_MSG_ERROR, msg_data);
return false;
@@ -205,8 +204,7 @@ bool draw_redraw(struct content *c, struct content_redraw_data *data,
error = xdrawfile_render(0, (drawfile_diagram *) src_data,
(int) source_size, &matrix, 0, 0);
if (error) {
- LOG(("xdrawfile_render: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xdrawfile_render: 0x%x: %s", error->errnum, error->errmess);
return false;
}
diff --git a/riscos/content-handlers/sprite.c b/riscos/content-handlers/sprite.c
index 3d669ad2d..2b2813273 100644
--- a/riscos/content-handlers/sprite.c
+++ b/riscos/content-handlers/sprite.c
@@ -131,8 +131,7 @@ bool sprite_convert(struct content *c)
(osspriteop_id) ((char *) area + area->first),
&w, &h, NULL, NULL);
if (error) {
- LOG(("xosspriteop_read_sprite_info: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosspriteop_read_sprite_info: 0x%x: %s", error->errnum, error->errmess);
msg_data.error = error->errmess;
content_broadcast(c, CONTENT_MSG_ERROR, msg_data);
return false;
diff --git a/riscos/cookies.c b/riscos/cookies.c
index 835229835..83462cbd6 100644
--- a/riscos/cookies.c
+++ b/riscos/cookies.c
@@ -109,7 +109,7 @@ void ro_gui_cookies_postinitialise(void)
cookies_window.toolbar, &ro_cookies_treeview_callbacks,
TREE_COOKIES);
if (cookies_window.tv == NULL) {
- LOG(("Failed to allocate treeview"));
+ LOG("Failed to allocate treeview");
return;
}
diff --git a/riscos/dialog.c b/riscos/dialog.c
index a8c05e801..e5c972f66 100644
--- a/riscos/dialog.c
+++ b/riscos/dialog.c
@@ -216,8 +216,7 @@ wimp_w ro_gui_dialog_create(const char *template_name)
window->sprite_area = gui_sprites;
error = xwimp_create_window(window, &w);
if (error) {
- LOG(("xwimp_create_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_create_window: 0x%x: %s", error->errnum, error->errmess);
xwimp_close_template();
die(error->errmess);
}
@@ -256,13 +255,12 @@ wimp_window * ro_gui_dialog_load_template(const char *template_name)
error = xwimp_load_template(wimp_GET_SIZE, 0, 0, wimp_NO_FONTS,
name, 0, &window_size, &data_size, &context);
if (error) {
- LOG(("xwimp_load_template: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_load_template: 0x%x: %s", error->errnum, error->errmess);
xwimp_close_template();
die(error->errmess);
}
if (!context) {
- LOG(("template '%s' missing", template_name));
+ LOG("template '%s' missing", template_name);
xwimp_close_template();
die("Template");
}
@@ -279,8 +277,7 @@ wimp_window * ro_gui_dialog_load_template(const char *template_name)
error = xwimp_load_template(window, data, data + data_size,
wimp_NO_FONTS, name, 0, 0, 0, 0);
if (error) {
- LOG(("xwimp_load_template: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_load_template: 0x%x: %s", error->errnum, error->errmess);
xwimp_close_template();
die(error->errmess);
}
@@ -308,8 +305,7 @@ void ro_gui_dialog_open(wimp_w w)
state.w = w;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -356,8 +352,7 @@ void ro_gui_dialog_close(wimp_w close)
*/
error = xwimp_get_caret_position(&caret);
if (error) {
- LOG(("xwimp_get_caret_position: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_caret_position: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
} else if (caret.w == close) {
/* Check if we are a persistent window */
@@ -368,9 +363,7 @@ void ro_gui_dialog_close(wimp_w close)
32, -1);
/* parent may have been closed first */
if ((error) && (error->errnum != 0x287)) {
- LOG(("xwimp_set_caret_position: 0x%x: %s",
- error->errnum,
- error->errmess));
+ LOG("xwimp_set_caret_position: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
}
@@ -378,8 +371,7 @@ void ro_gui_dialog_close(wimp_w close)
error = xwimp_close_window(close);
if (error) {
- LOG(("xwimp_close_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_close_window: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
}
@@ -464,8 +456,7 @@ void ro_gui_dialog_open_at_pointer(wimp_w w)
/* get the pointer position */
error = xwimp_get_pointer_info(&ptr);
if (error) {
- LOG(("xwimp_get_pointer_info: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_pointer_info: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -488,8 +479,7 @@ void ro_gui_dialog_open_xy(wimp_w w, int x, int y)
state.w = w;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -504,8 +494,7 @@ void ro_gui_dialog_open_xy(wimp_w w, int x, int y)
* on screen */
error = xwimp_close_window(w);
if (error) {
- LOG(("xwimp_close_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_close_window: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -533,8 +522,7 @@ void ro_gui_dialog_open_centre_parent(wimp_w parent, wimp_w child) {
state.w = parent;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -551,8 +539,7 @@ void ro_gui_dialog_open_centre_parent(wimp_w parent, wimp_w child) {
state.w = child;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -614,7 +601,7 @@ void ro_gui_dialog_add_persistent(wimp_w parent, wimp_w w) {
return;
}
}
- LOG(("Unable to map persistent dialog to parent."));
+ LOG("Unable to map persistent dialog to parent.");
return;
}
@@ -643,8 +630,7 @@ void ro_gui_dialog_close_persistent(wimp_w parent) {
w = persistent_dialog[i].dialog;
ro_gui_dialog_close(w);
if (ro_gui_wimp_event_close_window(w))
- LOG(("Persistent dialog close event: 0x%x",
- (unsigned) w));
+ LOG("Persistent dialog close event: 0x%x", (unsigned)w);
persistent_dialog[i].parent = NULL;
persistent_dialog[i].dialog = NULL;
}
@@ -722,7 +708,7 @@ static bool ro_gui_dialog_open_url_init(void)
if ((definition->icons[ICON_OPENURL_URL].flags & wimp_ICON_INDIRECTED)
== 0) {
- LOG(("open_url URL icon not indirected"));
+ LOG("open_url URL icon not indirected");
xwimp_close_template();
die("Template");
}
@@ -740,8 +726,7 @@ static bool ro_gui_dialog_open_url_init(void)
error = xwimp_create_window(definition, &dialog_openurl);
if (error != NULL) {
- LOG(("xwimp_create_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_create_window: 0x%x: %s", error->errnum, error->errmess);
xwimp_close_template();
die(error->errmess);
}
diff --git a/riscos/download.c b/riscos/download.c
index 7570a1ca0..659587455 100644
--- a/riscos/download.c
+++ b/riscos/download.c
@@ -259,8 +259,7 @@ static nserror download_ro_filetype(download_context *ctx, bits *ftype_out)
mime_type = download_context_get_mime_type(ctx);
error = xmimemaptranslate_mime_type_to_filetype(mime_type, &ftype);
if (error) {
- LOG(("xmimemaptranslate_mime_type_to_filetype: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xmimemaptranslate_mime_type_to_filetype: 0x%x: %s", error->errnum, error->errmess);
warn_user("MiscError", error->errmess);
ftype = 0xffd;
}
@@ -338,8 +337,7 @@ gui_download_window_create(download_context *ctx, struct gui_window *gui)
error = xosfind_openoutw(osfind_NO_PATH | osfind_ERROR_IF_DIR,
temp_name, 0, &dw->file);
if (error) {
- LOG(("xosfind_openoutw: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfind_openoutw: 0x%x: %s", error->errnum, error->errmess);
warn_user("SaveError", error->errmess);
free(dw);
return 0;
@@ -372,7 +370,7 @@ gui_download_window_create(download_context *ctx, struct gui_window *gui)
filename = strdup(temp_name);
if (filename == NULL) {
- LOG(("Failed to establish download filename."));
+ LOG("Failed to establish download filename.");
warn_user("SaveError", error->errmess);
free(dw);
return 0;
@@ -404,7 +402,7 @@ gui_download_window_create(download_context *ctx, struct gui_window *gui)
if (err != NSERROR_OK) {
/* badenc should never happen */
assert(err !=NSERROR_BAD_ENCODING);
- LOG(("utf8_to_local_encoding failed"));
+ LOG("utf8_to_local_encoding failed");
warn_user("NoMemory", 0);
free(dw);
return 0;
@@ -430,8 +428,7 @@ gui_download_window_create(download_context *ctx, struct gui_window *gui)
/* create and open the download window */
error = xwimp_create_window(download_template, &dw->window);
if (error) {
- LOG(("xwimp_create_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_create_window: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
free(dw);
return 0;
@@ -486,8 +483,7 @@ static void gui_download_window_error(struct gui_download_window *dw,
wimp_COLOUR_RED << wimp_ICON_FG_COLOUR_SHIFT,
wimp_ICON_FG_COLOUR);
if (error) {
- LOG(("xwimp_set_icon_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
@@ -495,8 +491,7 @@ static void gui_download_window_error(struct gui_download_window *dw,
error = xwimp_set_icon_state(dw->window, ICON_DOWNLOAD_PATH,
wimp_ICON_SHADED, 0);
if (error) {
- LOG(("xwimp_set_icon_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
@@ -504,8 +499,7 @@ static void gui_download_window_error(struct gui_download_window *dw,
error = xwimp_set_icon_state(dw->window, ICON_DOWNLOAD_ICON,
wimp_ICON_SHADED, wimp_ICON_SHADED);
if (error) {
- LOG(("xwimp_set_icon_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
@@ -532,12 +526,11 @@ static nserror gui_download_window_data(struct gui_download_window *dw,
error = xosgbpb_writew(dw->file, (const byte *) data, size,
&unwritten);
if (error) {
- LOG(("xosgbpb_writew: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosgbpb_writew: 0x%x: %s", error->errnum, error->errmess);
msg = error->errmess;
} else if (unwritten) {
- LOG(("xosgbpb_writew: unwritten %i", unwritten));
+ LOG("xosgbpb_writew: unwritten %i", unwritten);
msg = messages_get("Unwritten");
}
else {
@@ -560,23 +553,20 @@ static nserror gui_download_window_data(struct gui_download_window *dw,
error = xwimp_set_icon_state(dw->window, ICON_DOWNLOAD_ICON,
wimp_ICON_SHADED, 0);
if (error) {
- LOG(("xwimp_set_icon_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
error = xwimp_set_icon_state(dw->window, ICON_DOWNLOAD_DESTINATION,
wimp_ICON_DELETED, wimp_ICON_DELETED);
if (error) {
- LOG(("xwimp_set_icon_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
error = xwimp_set_icon_state(dw->window,
ICON_DOWNLOAD_PATH, wimp_ICON_DELETED, 0);
if (error) {
- LOG(("xwimp_set_icon_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
@@ -725,15 +715,13 @@ void ro_gui_download_update_status(struct gui_download_window *dw)
download_progress_x0 + width,
download_progress_y1);
if (error) {
- LOG(("xwimp_resize_icon: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_resize_icon: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
error = xwimp_set_icon_state(dw->window, ICON_DOWNLOAD_STATUS, 0, 0);
if (error) {
- LOG(("xwimp_set_icon_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
@@ -769,15 +757,13 @@ void ro_gui_download_window_hide_caret(struct gui_download_window *dw)
error = xwimp_get_caret_position(&caret);
if (error) {
- LOG(("xwimp_get_caret_position: 0x%x : %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_caret_position: 0x%x : %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
else if (caret.w == dw->window) {
error = xwimp_set_caret_position(dw->window, (wimp_i)-1, 0, 0, 1 << 25, -1);
if (error) {
- LOG(("xwimp_get_caret_position: 0x%x : %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_caret_position: 0x%x : %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
}
@@ -803,8 +789,7 @@ static void gui_download_window_done(struct gui_download_window *dw)
error = xosfind_closew(dw->file);
if (error) {
- LOG(("xosfind_closew: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfind_closew: 0x%x: %s", error->errnum, error->errmess);
warn_user("SaveError", error->errmess);
}
dw->file = 0;
@@ -813,8 +798,7 @@ static void gui_download_window_done(struct gui_download_window *dw)
error = xosfile_set_type(dw->path,
dw->file_type);
if (error) {
- LOG(("xosfile_set_type: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfile_set_type: 0x%x: %s", error->errnum, error->errmess);
warn_user("SaveError", error->errmess);
}
@@ -870,8 +854,7 @@ bool ro_gui_download_click(wimp_pointer *pointer)
*dot = 0;
error = xos_cli(command);
if (error) {
- LOG(("xos_cli: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xos_cli: 0x%x: %s", error->errnum, error->errmess);
warn_user("MiscError", error->errmess);
}
}
@@ -944,8 +927,7 @@ static void ro_gui_download_drag_end(wimp_dragged *drag, void *data)
error = xwimp_get_pointer_info(&pointer);
if (error) {
- LOG(("xwimp_get_pointer_info: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_pointer_info: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -975,8 +957,7 @@ static void ro_gui_download_drag_end(wimp_dragged *drag, void *data)
error = xwimp_send_message_to_window(wimp_USER_MESSAGE, &message,
pointer.w, pointer.i, 0);
if (error) {
- LOG(("xwimp_send_message_to_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_send_message_to_window: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
@@ -1028,8 +1009,7 @@ char *ro_gui_download_canonicalise(const char *path)
error = xosfscontrol_canonicalise_path(path, NULL, NULL, NULL, 0, &spare);
if (error) {
- LOG(("xosfscontrol_canonicalise_path: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfscontrol_canonicalise_path: 0x%x: %s", error->errnum, error->errmess);
return NULL;
}
@@ -1038,8 +1018,7 @@ char *ro_gui_download_canonicalise(const char *path)
error = xosfscontrol_canonicalise_path(path, buf, NULL, NULL,
1 - spare, NULL);
if (error) {
- LOG(("xosfscontrol_canonicalise_path: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfscontrol_canonicalise_path: 0x%x: %s", error->errnum, error->errmess);
free(buf);
return NULL;
@@ -1084,15 +1063,13 @@ bool ro_gui_download_check_space(struct gui_download_window *dw,
error = xosfscontrol_free_space64(dir, &free_lo, &free_hi,
&max_file, NULL, NULL);
if (error) {
- LOG(("xosfscontrol_free_space64: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfscontrol_free_space64: 0x%x: %s", error->errnum, error->errmess);
free_hi = 0;
error = xosfscontrol_free_space(dir, (int*)&free_lo,
&max_file, NULL);
if (error) {
- LOG(("xosfscontrol_free_space: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfscontrol_free_space: 0x%x: %s", error->errnum, error->errmess);
/* close our eyes and hope */
free(dir);
return true;
@@ -1129,8 +1106,7 @@ bool ro_gui_download_check_space(struct gui_download_window *dw,
error = xosargs_read_allocation(dw->file,
&allocation);
if (error) {
- LOG(("xosargs_read_allocation: 0x%x : %s",
- error->errnum, error->errmess));
+ LOG("xosargs_read_allocation: 0x%x : %s", error->errnum, error->errmess);
}
else {
space += allocation;
@@ -1169,8 +1145,7 @@ os_error *ro_gui_download_move(struct gui_download_window *dw,
error = xosfind_closew(dw->file);
dw->file = 0;
if (error) {
- LOG(("xosfind_closew: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfind_closew: 0x%x: %s", error->errnum, error->errmess);
return error;
}
}
@@ -1188,13 +1163,11 @@ os_error *ro_gui_download_move(struct gui_download_window *dw,
osfscontrol_COPY_LOOK,
0, 0, 0, 0, 0);
if (error) {
- LOG(("xosfscontrol_copy: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfscontrol_copy: 0x%x: %s", error->errnum, error->errmess);
return error;
}
} else if (error) {
- LOG(("xosfscontrol_rename: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfscontrol_rename: 0x%x: %s", error->errnum, error->errmess);
return error;
}
@@ -1204,23 +1177,20 @@ os_error *ro_gui_download_move(struct gui_download_window *dw,
fileswitch_ATTR_OWNER_READ |
fileswitch_ATTR_OWNER_WRITE);
if (error) {
- LOG(("xosfile_write: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfile_write: 0x%x: %s", error->errnum, error->errmess);
warn_user("SaveError", error->errmess);
}
error = xosfind_openupw(osfind_NO_PATH | osfind_ERROR_IF_DIR,
dest_file, 0, &dw->file);
if (error) {
- LOG(("xosfind_openupw: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfind_openupw: 0x%x: %s", error->errnum, error->errmess);
return error;
}
error = xosargs_set_ptrw(dw->file, dw->received);
if (error) {
- LOG(("xosargs_set_ptrw: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosargs_set_ptrw: 0x%x: %s", error->errnum, error->errmess);
return error;
}
@@ -1229,8 +1199,7 @@ os_error *ro_gui_download_move(struct gui_download_window *dw,
error = xosfile_set_type(dest_file,
dw->file_type);
if (error) {
- LOG(("xosfile_set_type: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfile_set_type: 0x%x: %s", error->errnum, error->errmess);
warn_user("SaveError", error->errmess);
}
}
@@ -1302,7 +1271,7 @@ bool ro_gui_download_save(struct gui_download_window *dw,
error = xosfile_read_stamped(file_name, &obj_type,
NULL, NULL, NULL, NULL, NULL);
if (error) {
- LOG(("xosfile_read_stamped: 0x%x:%s", error->errnum, error->errmess));
+ LOG("xosfile_read_stamped: 0x%x:%s", error->errnum, error->errmess);
return false;
}
@@ -1338,14 +1307,12 @@ bool ro_gui_download_save(struct gui_download_window *dw,
error = xosfind_openupw(osfind_NO_PATH | osfind_ERROR_IF_DIR,
temp_name, 0, &dw->file);
if (error) {
- LOG(("xosfind_openupw: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfind_openupw: 0x%x: %s", error->errnum, error->errmess);
} else {
error = xosargs_set_ptrw(dw->file, dw->received);
if (error) {
- LOG(("xosargs_set_ptrw: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosargs_set_ptrw: 0x%x: %s", error->errnum, error->errmess);
}
}
@@ -1367,8 +1334,7 @@ bool ro_gui_download_save(struct gui_download_window *dw,
error = xwimp_set_icon_state(dw->window, ICON_DOWNLOAD_ICON,
wimp_ICON_SHADED, wimp_ICON_SHADED);
if (error) {
- LOG(("xwimp_set_icon_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
@@ -1381,15 +1347,13 @@ bool ro_gui_download_save(struct gui_download_window *dw,
error = xwimp_set_icon_state(dw->window, ICON_DOWNLOAD_PATH,
wimp_ICON_DELETED, wimp_ICON_DELETED);
if (error) {
- LOG(("xwimp_set_icon_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
error = xwimp_set_icon_state(dw->window,
ICON_DOWNLOAD_DESTINATION, wimp_ICON_DELETED, 0);
if (error) {
- LOG(("xwimp_set_icon_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
@@ -1435,8 +1399,7 @@ void ro_gui_download_send_dataload(struct gui_download_window *dw)
* for the rather depressing details.
*/
if (error && error->errnum != error_WIMP_BAD_HANDLE) {
- LOG(("xwimp_set_icon_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
@@ -1517,8 +1480,7 @@ bool ro_gui_download_window_destroy(struct gui_download_window *dw, bool quit)
/* delete window */
error = xwimp_delete_window(dw->window);
if (error) {
- LOG(("xwimp_delete_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_delete_window: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
ro_gui_wimp_event_finalise(dw->window);
@@ -1527,8 +1489,7 @@ bool ro_gui_download_window_destroy(struct gui_download_window *dw, bool quit)
if (dw->file) {
error = xosfind_closew(dw->file);
if (error) {
- LOG(("xosfind_closew: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfind_closew: 0x%x: %s", error->errnum, error->errmess);
warn_user("SaveError", error->errmess);
}
}
@@ -1539,8 +1500,7 @@ bool ro_gui_download_window_destroy(struct gui_download_window *dw, bool quit)
error = xosfile_delete(temp_name, 0, 0, 0, 0, 0);
if (error) {
- LOG(("xosfile_delete: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfile_delete: 0x%x: %s", error->errnum, error->errmess);
warn_user("SaveError", error->errmess);
}
}
diff --git a/riscos/filetype.c b/riscos/filetype.c
index 0a546d833..a0de46ecf 100644
--- a/riscos/filetype.c
+++ b/riscos/filetype.c
@@ -72,26 +72,25 @@ const char *fetch_filetype(const char *unix_path)
int objtype;
if (!path) {
- LOG(("Insufficient memory for calloc"));
+ LOG("Insufficient memory for calloc");
warn_user("NoMemory", 0);
return "application/riscos";
}
- LOG(("unix_path = '%s'", unix_path));
+ LOG("unix_path = '%s'", unix_path);
/* convert path to RISC OS format and read file type */
r = __riscosify(unix_path, 0, __RISCOSIFY_NO_SUFFIX, path, len, 0);
if (r == 0) {
- LOG(("__riscosify failed"));
+ LOG("__riscosify failed");
free(path);
return "application/riscos";
}
- LOG(("riscos path '%s'", path));
+ LOG("riscos path '%s'", path);
error = xosfile_read_stamped_no_path(path, &objtype, 0, 0, 0, 0,
&file_type);
if (error) {
- LOG(("xosfile_read_stamped_no_path failed: %s",
- error->errmess));
+ LOG("xosfile_read_stamped_no_path failed: %s", error->errmess);
free(path);
return "application/riscos";
}
@@ -110,9 +109,7 @@ const char *fetch_filetype(const char *unix_path)
slash+1, &temp);
if (error)
/* ignore error and leave file_type alone */
- LOG(("xmimemaptranslate_extension_to_filetype: "
- "0x%x %s",
- error->errnum, error->errmess));
+ LOG("xmimemaptranslate_extension_to_filetype: ""0x%x %s", error->errnum, error->errmess);
else
file_type = temp;
}
@@ -130,7 +127,7 @@ const char *fetch_filetype(const char *unix_path)
/* not in internal table, so ask MimeMap */
error = xmimemaptranslate_filetype_to_mime_type(file_type, type_buf);
if (error) {
- LOG(("0x%x %s", error->errnum, error->errmess));
+ LOG("0x%x %s", error->errnum, error->errmess);
free(path);
return "application/riscos";
}
@@ -143,7 +140,7 @@ const char *fetch_filetype(const char *unix_path)
free(path);
- LOG(("mime type '%s'", type_buf));
+ LOG("mime type '%s'", type_buf);
return (const char *)type_buf;
}
@@ -159,15 +156,14 @@ char *fetch_mimetype(const char *ro_path)
struct type_entry *t;
if (!mime) {
- LOG(("Insufficient memory for calloc"));
+ LOG("Insufficient memory for calloc");
warn_user("NoMemory", 0);
return 0;
}
e = xosfile_read_no_path(ro_path, &objtype, &load, 0, 0, 0);
if (e) {
- LOG(("xosfile_read_no_path: 0x%x: %s",
- e->errnum, e->errmess));
+ LOG("xosfile_read_no_path: 0x%x: %s", e->errnum, e->errmess);
free(mime);
return 0;
}
@@ -193,7 +189,7 @@ char *fetch_mimetype(const char *ro_path)
if (e)
/* if we get an error here, simply ignore it and
* leave filetype unchanged */
- LOG(("0x%x %s", e->errnum, e->errmess));
+ LOG("0x%x %s", e->errnum, e->errmess);
else
filetype = load;
}
@@ -210,8 +206,7 @@ char *fetch_mimetype(const char *ro_path)
/* not in internal table, so ask MimeMap */
e = xmimemaptranslate_filetype_to_mime_type(filetype, mime);
if (e) {
- LOG(("xmimemaptranslate_filetype_to_mime_type: 0x%x: %s",
- e->errnum, e->errmess));
+ LOG("xmimemaptranslate_filetype_to_mime_type: 0x%x: %s", e->errnum, e->errmess);
free(mime);
return 0;
}
@@ -328,7 +323,7 @@ bits ro_filetype_from_unix_path(const char *unix_path)
bits file_type;
if (!path) {
- LOG(("Insufficient memory for calloc"));
+ LOG("Insufficient memory for calloc");
warn_user("NoMemory", 0);
return osfile_TYPE_DATA;
}
@@ -336,7 +331,7 @@ bits ro_filetype_from_unix_path(const char *unix_path)
/* convert path to RISC OS format and read file type */
r = __riscosify(unix_path, 0, __RISCOSIFY_NO_SUFFIX, path, len, 0);
if (r == 0) {
- LOG(("__riscosify failed"));
+ LOG("__riscosify failed");
free(path);
return osfile_TYPE_DATA;
}
@@ -344,8 +339,7 @@ bits ro_filetype_from_unix_path(const char *unix_path)
error = xosfile_read_stamped_no_path(path, 0, 0, 0, 0, 0,
&file_type);
if (error) {
- LOG(("xosfile_read_stamped_no_path failed: %s",
- error->errmess));
+ LOG("xosfile_read_stamped_no_path failed: %s", error->errmess);
free(path);
return osfile_TYPE_DATA;
}
diff --git a/riscos/font.c b/riscos/font.c
index db6376a88..7947365f9 100644
--- a/riscos/font.c
+++ b/riscos/font.c
@@ -79,19 +79,17 @@ void nsfont_init(void)
nsfont_check_fonts();
- LOG(("Initialise RUfl"));
+ LOG("Initialise RUfl");
code = rufl_init();
if (code != rufl_OK) {
if (code == rufl_FONT_MANAGER_ERROR)
- LOG(("rufl_init: rufl_FONT_MANAGER_ERROR: 0x%x: %s",
- rufl_fm_error->errnum,
- rufl_fm_error->errmess));
+ LOG("rufl_init: rufl_FONT_MANAGER_ERROR: 0x%x: %s", rufl_fm_error->errnum, rufl_fm_error->errmess);
else
- LOG(("rufl_init: 0x%x", code));
+ LOG("rufl_init: 0x%x", code);
die("The Unicode font library could not be initialized. "
"Please report this to the developers.");
}
- LOG(("RUfl initialised"));
+ LOG("RUfl initialised");
if (rufl_family_list_entries == 0)
die("No fonts could be found. At least one font must be "
@@ -125,9 +123,9 @@ const char *nsfont_fallback_font(void)
const char *fallback = "Homerton";
if (!nsfont_exists(fallback)) {
- LOG(("Homerton not found, dumping RUfl family list"));
+ LOG("Homerton not found, dumping RUfl family list");
for (unsigned int i = 0; i < rufl_family_list_entries; i++) {
- LOG(("'%s'", rufl_family_list[i]));
+ LOG("'%s'", rufl_family_list[i]);
}
fallback = rufl_family_list[0];
}
@@ -203,8 +201,7 @@ void nsfont_check_fonts(void)
"<NetSurf$Dir>.FixFonts", 0);
die("FontBadInst");
} else {
- LOG(("xfont_find_font: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xfont_find_font: 0x%x: %s", error->errnum, error->errmess);
snprintf(s, sizeof s, messages_get("FontError"),
error->errmess);
die(s);
@@ -213,8 +210,7 @@ void nsfont_check_fonts(void)
error = xfont_lose_font(font);
if (error) {
- LOG(("xfont_lose_font: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xfont_lose_font: 0x%x: %s", error->errnum, error->errmess);
snprintf(s, sizeof s, messages_get("FontError"),
error->errmess);
die(s);
@@ -252,11 +248,9 @@ bool nsfont_width(const plot_font_style_t *fstyle,
width);
if (code != rufl_OK) {
if (code == rufl_FONT_MANAGER_ERROR)
- LOG(("rufl_width: rufl_FONT_MANAGER_ERROR: 0x%x: %s",
- rufl_fm_error->errnum,
- rufl_fm_error->errmess));
+ LOG("rufl_width: rufl_FONT_MANAGER_ERROR: 0x%x: %s", rufl_fm_error->errnum, rufl_fm_error->errmess);
else
- LOG(("rufl_width: 0x%x", code));
+ LOG("rufl_width: 0x%x", code);
/* warn_user("MiscError", "font error"); */
*width = 0;
return false;
@@ -300,12 +294,9 @@ bool nsfont_position_in_string(const plot_font_style_t *fstyle,
x * 2, char_offset, actual_x);
if (code != rufl_OK) {
if (code == rufl_FONT_MANAGER_ERROR)
- LOG(("rufl_x_to_offset: rufl_FONT_MANAGER_ERROR: "
- "0x%x: %s",
- rufl_fm_error->errnum,
- rufl_fm_error->errmess));
+ LOG("rufl_x_to_offset: rufl_FONT_MANAGER_ERROR: ""0x%x: %s", rufl_fm_error->errnum, rufl_fm_error->errmess);
else
- LOG(("rufl_x_to_offset: 0x%x", code));
+ LOG("rufl_x_to_offset: 0x%x", code);
/* warn_user("MiscError", "font error"); */
*char_offset = 0;
*actual_x = 0;
@@ -361,12 +352,9 @@ bool nsfont_split(const plot_font_style_t *fstyle,
x * 2, char_offset, actual_x);
if (code != rufl_OK) {
if (code == rufl_FONT_MANAGER_ERROR)
- LOG(("rufl_split: rufl_FONT_MANAGER_ERROR: "
- "0x%x: %s",
- rufl_fm_error->errnum,
- rufl_fm_error->errmess));
+ LOG("rufl_split: rufl_FONT_MANAGER_ERROR: ""0x%x: %s", rufl_fm_error->errnum, rufl_fm_error->errmess);
else
- LOG(("rufl_split: 0x%x", code));
+ LOG("rufl_split: 0x%x", code);
/* warn_user("MiscError", "font error"); */
*char_offset = 0;
*actual_x = 0;
@@ -395,11 +383,9 @@ bool nsfont_split(const plot_font_style_t *fstyle,
actual_x);
if (code != rufl_OK) {
if (code == rufl_FONT_MANAGER_ERROR)
- LOG(("rufl_width: rufl_FONT_MANAGER_ERROR: 0x%x: %s",
- rufl_fm_error->errnum,
- rufl_fm_error->errmess));
+ LOG("rufl_width: rufl_FONT_MANAGER_ERROR: 0x%x: %s", rufl_fm_error->errnum, rufl_fm_error->errmess);
else
- LOG(("rufl_width: 0x%x", code));
+ LOG("rufl_width: 0x%x", code);
/* warn_user("MiscError", "font error"); */
*char_offset = 0;
*actual_x = 0;
@@ -442,11 +428,9 @@ bool nsfont_paint(const plot_font_style_t *fstyle, const char *string,
string, length, x, y, flags);
if (code != rufl_OK) {
if (code == rufl_FONT_MANAGER_ERROR)
- LOG(("rufl_paint: rufl_FONT_MANAGER_ERROR: 0x%x: %s",
- rufl_fm_error->errnum,
- rufl_fm_error->errmess));
+ LOG("rufl_paint: rufl_FONT_MANAGER_ERROR: 0x%x: %s", rufl_fm_error->errnum, rufl_fm_error->errmess);
else
- LOG(("rufl_paint: 0x%x", code));
+ LOG("rufl_paint: 0x%x", code);
}
return true;
@@ -539,8 +523,7 @@ void ro_gui_wimp_desktop_font(char *family, size_t family_size, int *psize,
error = xwimpreadsysinfo_font(&font_handle, NULL);
if (error) {
- LOG(("xwimpreadsysinfo_font: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimpreadsysinfo_font: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
goto failsafe;
}
@@ -552,22 +535,20 @@ void ro_gui_wimp_desktop_font(char *family, size_t family_size, int *psize,
error = xfont_read_identifier(font_handle, NULL, &used);
if (error) {
- LOG(("xfont_read_identifier: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xfont_read_identifier: 0x%x: %s", error->errnum, error->errmess);
warn_user("MiscError", error->errmess);
goto failsafe;
}
if (family_size < (size_t) used + 1) {
- LOG(("desktop font name too long"));
+ LOG("desktop font name too long");
goto failsafe;
}
error = xfont_read_defn(font_handle, (byte *) family,
&ptx, &pty, NULL, NULL, NULL, NULL);
if (error) {
- LOG(("xfont_read_defn: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xfont_read_defn: 0x%x: %s", error->errnum, error->errmess);
warn_user("MiscError", error->errmess);
goto failsafe;
}
@@ -579,7 +560,7 @@ void ro_gui_wimp_desktop_font(char *family, size_t family_size, int *psize,
}
}
- LOG(("desktop font \"%s\"", family));
+ LOG("desktop font \"%s\"", family);
if (strcasestr(family, ".Medium"))
style = rufl_WEIGHT_500;
@@ -595,7 +576,7 @@ void ro_gui_wimp_desktop_font(char *family, size_t family_size, int *psize,
*psize = max(ptx, pty);
*pstyle = style;
- LOG(("family \"%s\", size %i, style %i", family, *psize, style));
+ LOG("family \"%s\", size %i, style %i", family, *psize, style);
return;
diff --git a/riscos/global_history.c b/riscos/global_history.c
index 6482d1bba..7bbc53c2a 100644
--- a/riscos/global_history.c
+++ b/riscos/global_history.c
@@ -116,7 +116,7 @@ void ro_gui_global_history_postinitialise(void)
&ro_global_history_treeview_callbacks,
TREE_HISTORY);
if (global_history_window.tv == NULL) {
- LOG(("Failed to allocate treeview"));
+ LOG("Failed to allocate treeview");
return;
}
diff --git a/riscos/gui.c b/riscos/gui.c
index 6a861c295..49292cf85 100644
--- a/riscos/gui.c
+++ b/riscos/gui.c
@@ -305,7 +305,7 @@ static nserror set_defaults(struct nsoption_s *defaults)
if (nsoption_charp(ca_bundle) == NULL ||
nsoption_charp(cookie_file) == NULL ||
nsoption_charp(cookie_jar) == NULL) {
- LOG(("Failed initialising string options"));
+ LOG("Failed initialising string options");
return NSERROR_BAD_PARAMETER;
}
@@ -417,7 +417,7 @@ static void ro_gui_signal(int sig)
if (used) {
int curr_slot;
xwimp_slot_size(-1, -1, &curr_slot, 0, 0);
- LOG(("saving WimpSlot, size 0x%x", curr_slot));
+ LOG("saving WimpSlot, size 0x%x", curr_slot);
xosfile_save("$.NetSurf_Slot", 0x8000, 0,
(byte *) 0x8000,
(byte *) 0x8000 + curr_slot);
@@ -427,9 +427,7 @@ static void ro_gui_signal(int sig)
byte *base_address;
xosdynamicarea_read(__dynamic_num, &size,
&base_address, 0, 0, 0, 0, 0);
- LOG(("saving DA %i, base %p, size 0x%x",
- __dynamic_num,
- base_address, size));
+ LOG("saving DA %i, base %p, size 0x%x", __dynamic_num, base_address, size);
xosfile_save("$.NetSurf_DA",
(bits) base_address, 0,
base_address,
@@ -441,7 +439,7 @@ static void ro_gui_signal(int sig)
* defines a coredump directory. */
const _kernel_oserror *err = __unixlib_write_coredump (NULL);
if (err != NULL)
- LOG(("Coredump failed: %s", err->errmess));
+ LOG("Coredump failed: %s", err->errmess);
#endif
xhourglass_colours(old_sand, old_glass, 0, 0);
@@ -525,8 +523,7 @@ static char *ro_gui_uri_file_parse(const char *file_name, char **uri_title)
*uri_title = NULL;
fp = fopen(file_name, "rb");
if (!fp) {
- LOG(("fopen(\"%s\", \"rb\"): %i: %s",
- file_name, errno, strerror(errno)));
+ LOG("fopen(\"%s\", \"rb\"): %i: %s", file_name, errno, strerror(errno));
warn_user("LoadError", strerror(errno));
return 0;
}
@@ -587,16 +584,14 @@ static char *ro_gui_url_file_parse(const char *file_name)
fp = fopen(file_name, "r");
if (!fp) {
- LOG(("fopen(\"%s\", \"r\"): %i: %s",
- file_name, errno, strerror(errno)));
+ LOG("fopen(\"%s\", \"r\"): %i: %s", file_name, errno, strerror(errno));
warn_user("LoadError", strerror(errno));
return 0;
}
if (!fgets(line, sizeof line, fp)) {
if (ferror(fp)) {
- LOG(("fgets: %i: %s",
- errno, strerror(errno)));
+ LOG("fgets: %i: %s", errno, strerror(errno));
warn_user("LoadError", strerror(errno));
} else
warn_user("LoadError", messages_get("EmptyError"));
@@ -633,8 +628,7 @@ static char *ro_gui_ieurl_file_parse(const char *file_name)
fp = fopen(file_name, "r");
if (!fp) {
- LOG(("fopen(\"%s\", \"r\"): %i: %s",
- file_name, errno, strerror(errno)));
+ LOG("fopen(\"%s\", \"r\"): %i: %s", file_name, errno, strerror(errno));
warn_user("LoadError", strerror(errno));
return 0;
}
@@ -653,8 +647,7 @@ static char *ro_gui_ieurl_file_parse(const char *file_name)
}
}
if (ferror(fp)) {
- LOG(("fgets: %i: %s",
- errno, strerror(errno)));
+ LOG("fgets: %i: %s", errno, strerror(errno));
warn_user("LoadError", strerror(errno));
fclose(fp);
return 0;
@@ -726,8 +719,7 @@ static void ro_msg_dataopen(wimp_message *message)
message->your_ref = message->my_ref;
oserror = xwimp_send_message(wimp_USER_MESSAGE, message, message->sender);
if (oserror) {
- LOG(("xwimp_send_message: 0x%x: %s",
- oserror->errnum, oserror->errmess));
+ LOG("xwimp_send_message: 0x%x: %s", oserror->errnum, oserror->errmess);
warn_user("WimpError", oserror->errmess);
return;
}
@@ -850,8 +842,7 @@ static void ro_msg_dataload(wimp_message *message)
oserror = xwimp_send_message(wimp_USER_MESSAGE, message,
message->sender);
if (oserror) {
- LOG(("xwimp_send_message: 0x%x: %s",
- oserror->errnum, oserror->errmess));
+ LOG("xwimp_send_message: 0x%x: %s", oserror->errnum, oserror->errmess);
warn_user("WimpError", oserror->errmess);
return;
}
@@ -921,7 +912,7 @@ static void ro_msg_datasave(wimp_message *message)
error = xwimp_send_message(wimp_USER_MESSAGE, (wimp_message*)dataxfer, message->sender);
if (error) {
- LOG(("xwimp_send_message: 0x%x: %s", error->errnum, error->errmess));
+ LOG("xwimp_send_message: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
}
@@ -973,7 +964,7 @@ static void ro_msg_prequit(wimp_message *message)
error = xwimp_send_message(wimp_USER_MESSAGE_ACKNOWLEDGE,
message, message->sender);
if (error) {
- LOG(("xwimp_send_message: 0x%x:%s", error->errnum, error->errmess));
+ LOG("xwimp_send_message: 0x%x:%s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
}
@@ -999,7 +990,7 @@ static void ro_msg_save_desktop(wimp_message *message)
}
if (error) {
- LOG(("xosgbpb_writew/xos_bputw: 0x%x:%s", error->errnum, error->errmess));
+ LOG("xosgbpb_writew/xos_bputw: 0x%x:%s", error->errnum, error->errmess);
warn_user("SaveError", error->errmess);
/* we must cancel the save by acknowledging the message */
@@ -1007,7 +998,7 @@ static void ro_msg_save_desktop(wimp_message *message)
error = xwimp_send_message(wimp_USER_MESSAGE_ACKNOWLEDGE,
message, message->sender);
if (error) {
- LOG(("xwimp_send_message: 0x%x:%s", error->errnum, error->errmess));
+ LOG("xwimp_send_message: 0x%x:%s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
}
@@ -1058,8 +1049,7 @@ static void ro_gui_get_screen_properties(void)
error = xos_read_vdu_variables(PTR_OS_VDU_VAR_LIST(&vars), vals);
if (error) {
- LOG(("xos_read_vdu_variables: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xos_read_vdu_variables: 0x%x: %s", error->errnum, error->errmess);
warn_user("MiscError", error->errmess);
return;
}
@@ -1076,9 +1066,9 @@ static void ro_gui_check_resolvers(void)
char *resolvers;
resolvers = getenv("Inet$Resolvers");
if (resolvers && resolvers[0]) {
- LOG(("Inet$Resolvers '%s'", resolvers));
+ LOG("Inet$Resolvers '%s'", resolvers);
} else {
- LOG(("Inet$Resolvers not set or empty"));
+ LOG("Inet$Resolvers not set or empty");
warn_user("Resolvers", 0);
}
}
@@ -1183,8 +1173,7 @@ static nserror gui_init(int argc, char** argv)
PTR_WIMP_MESSAGE_LIST(&task_messages), 0,
&task_handle);
if (error) {
- LOG(("xwimp_initialise: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_initialise: 0x%x: %s", error->errnum, error->errmess);
die(error->errmess);
}
/* Register message handlers */
@@ -1225,8 +1214,7 @@ static nserror gui_init(int argc, char** argv)
die("Failed to locate Templates resource.");
error = xwimp_open_template(path);
if (error) {
- LOG(("xwimp_open_template failed: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_open_template failed: 0x%x: %s", error->errnum, error->errmess);
die(error->errmess);
}
@@ -1287,7 +1275,7 @@ static nserror gui_init(int argc, char** argv)
/* parse command-line arguments */
if (argc == 2) {
- LOG(("parameters: '%s'", argv[1]));
+ LOG("parameters: '%s'", argv[1]);
/* this is needed for launching URI files */
if (strcasecmp(argv[1], "-nowin") == 0) {
return NSERROR_OK;
@@ -1295,7 +1283,7 @@ static nserror gui_init(int argc, char** argv)
ret = nsurl_create(NETSURF_HOMEPAGE, &url);
}
else if (argc == 3) {
- LOG(("parameters: '%s' '%s'", argv[1], argv[2]));
+ LOG("parameters: '%s' '%s'", argv[1], argv[2]);
open_window = true;
/* HTML files */
@@ -1306,7 +1294,7 @@ static nserror gui_init(int argc, char** argv)
else if (strcasecmp(argv[1], "-urlf") == 0) {
char *urlf = ro_gui_url_file_parse(argv[2]);
if (!urlf) {
- LOG(("allocation failed"));
+ LOG("allocation failed");
die("Insufficient memory for URL");
}
ret = nsurl_create(urlf, &url);
@@ -1318,8 +1306,7 @@ static nserror gui_init(int argc, char** argv)
}
/* Unknown => exit here. */
else {
- LOG(("Unknown parameters: '%s' '%s'",
- argv[1], argv[2]));
+ LOG("Unknown parameters: '%s' '%s'", argv[1], argv[2]);
return NSERROR_BAD_PARAMETER;
}
}
@@ -1367,8 +1354,7 @@ const char *ro_gui_default_language(void)
/* choose a language from the configured country number */
error = xosbyte_read(osbyte_VAR_COUNTRY_NUMBER, &country);
if (error) {
- LOG(("xosbyte_read failed: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosbyte_read failed: 0x%x: %s", error->errnum, error->errmess);
country = 1;
}
switch (country) {
@@ -1419,8 +1405,7 @@ static nserror ro_path_to_nsurl(const char *path, struct nsurl **url_out)
/* calculate the canonical risc os path */
error = xosfscontrol_canonicalise_path(path, 0, 0, 0, 0, &spare);
if (error) {
- LOG(("xosfscontrol_canonicalise_path failed: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfscontrol_canonicalise_path failed: 0x%x: %s", error->errnum, error->errmess);
warn_user("PathToURL", error->errmess);
return NSERROR_NOT_FOUND;
}
@@ -1433,8 +1418,7 @@ static nserror ro_path_to_nsurl(const char *path, struct nsurl **url_out)
error = xosfscontrol_canonicalise_path(path, canonical_path, 0, 0, 1 - spare, 0);
if (error) {
- LOG(("xosfscontrol_canonicalise_path failed: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfscontrol_canonicalise_path failed: 0x%x: %s", error->errnum, error->errmess);
warn_user("PathToURL", error->errmess);
free(canonical_path);
return NSERROR_NOT_FOUND;
@@ -1444,7 +1428,7 @@ static nserror ro_path_to_nsurl(const char *path, struct nsurl **url_out)
unix_path = __unixify(canonical_path, __RISCOSIFY_NO_REVERSE_SUFFIX, NULL, 0, 0);
if (unix_path == NULL) {
- LOG(("__unixify failed: %s", canonical_path));
+ LOG("__unixify failed: %s", canonical_path);
free(canonical_path);
return NSERROR_BAD_PARAMETER;
}
@@ -1454,7 +1438,7 @@ static nserror ro_path_to_nsurl(const char *path, struct nsurl **url_out)
urllen = strlen(unix_path) + FILE_SCHEME_PREFIX_LEN + 1;
url = malloc(urllen);
if (url == NULL) {
- LOG(("Unable to allocate url"));
+ LOG("Unable to allocate url");
free(unix_path);
return NSERROR_NOMEM;
}
@@ -1604,8 +1588,7 @@ static void ro_gui_keypress_cb(void *pw)
if (ro_gui_wimp_event_keypress(key) == false) {
os_error *error = xwimp_process_key(key->c);
if (error) {
- LOG(("xwimp_process_key: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_process_key: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
}
@@ -1642,8 +1625,7 @@ static void ro_gui_keypress(wimp_key *key)
} else if (ro_gui_wimp_event_keypress(key) == false) {
os_error *error = xwimp_process_key(key->c);
if (error) {
- LOG(("xwimp_process_key: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_process_key: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
}
@@ -1915,8 +1897,7 @@ void ro_gui_open_window_request(wimp_open *open)
error = xwimp_open_window(open);
if (error) {
- LOG(("xwimp_open_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -1937,8 +1918,7 @@ static void ro_gui_view_source_bounce(wimp_message *message)
sprintf(command, "@RunType_FFF %s", filename);
error = xwimp_start_task(command, 0);
if (error) {
- LOG(("xwimp_start_task failed: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_start_task failed: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
}
@@ -2001,7 +1981,7 @@ void ro_gui_view_source(hlcache_handle *c)
r = __riscosify(full_name, 0, __RISCOSIFY_NO_SUFFIX,
message.file_name, 212, 0);
if (r == 0) {
- LOG(("__riscosify failed"));
+ LOG("__riscosify failed");
return;
}
message.file_name[211] = '\0';
@@ -2011,8 +1991,7 @@ void ro_gui_view_source(hlcache_handle *c)
(byte *) source_data,
(byte *) source_data + source_size);
if (error) {
- LOG(("xosfile_save_stamped failed: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfile_save_stamped failed: 0x%x: %s", error->errnum, error->errmess);
warn_user("MiscError", error->errmess);
return;
}
@@ -2082,7 +2061,7 @@ static void ro_gui_choose_language(void)
*/
void warn_user(const char *warning, const char *detail)
{
- LOG(("%s %s", warning, detail));
+ LOG("%s %s", warning, detail);
if (dialog_warning) {
char warn_buffer[300];
@@ -2125,7 +2104,7 @@ void die(const char * const error)
{
os_error warn_error;
- LOG(("%s", error));
+ LOG("%s", error);
warn_error.errnum = 1; /* \todo: reasonable ? */
strncpy(warn_error.errmess, messages_get(error),
@@ -2362,7 +2341,7 @@ void ro_gui_dump_browser_window(struct browser_window *bw)
/* open file for dump */
FILE *stream = fopen("<Wimp$ScrapDir>.WWW.NetSurf.dump", "w");
if (!stream) {
- LOG(("fopen: errno %i", errno));
+ LOG("fopen: errno %i", errno);
warn_user("SaveError", strerror(errno));
return;
}
@@ -2375,8 +2354,7 @@ void ro_gui_dump_browser_window(struct browser_window *bw)
error = xwimp_start_task("Filer_Run <Wimp$ScrapDir>.WWW.NetSurf.dump",
0);
if (error) {
- LOG(("xwimp_start_task failed: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_start_task failed: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
}
@@ -2415,7 +2393,7 @@ static char *get_cachepath(void)
cachedir = getenv("Cache$Dir");
if ((cachedir == NULL) || (cachedir[0] == 0)) {
- LOG(("cachedir was null"));
+ LOG("cachedir was null");
return NULL;
}
ret = netsurf_mkpath(&cachepath, NULL, 2, cachedir, "NetSurf");
diff --git a/riscos/gui/button_bar.c b/riscos/gui/button_bar.c
index d92433d0b..e04bfc270 100644
--- a/riscos/gui/button_bar.c
+++ b/riscos/gui/button_bar.c
@@ -139,7 +139,7 @@ struct button_bar *ro_gui_button_bar_create(struct theme_descriptor *theme,
button_bar = malloc(sizeof(struct button_bar));
if (button_bar == NULL) {
- LOG(("No memory for malloc()"));
+ LOG("No memory for malloc()");
return NULL;
}
@@ -539,8 +539,7 @@ bool ro_gui_button_bar_icon_update(struct button_bar *button_bar)
error = xwimp_create_icon(&icon, &button->icon);
if (error) {
- LOG(("xwimp_create_icon: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_create_icon: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
button->icon = -1;
return false;
@@ -550,8 +549,7 @@ bool ro_gui_button_bar_icon_update(struct button_bar *button_bar)
error = xwimp_delete_icon(button_bar->window,
button->icon);
if (error != NULL) {
- LOG(("xwimp_delete_icon: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_delete_icon: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
@@ -601,8 +599,7 @@ bool ro_gui_button_bar_icon_resize(struct button_bar *button_bar)
button->y_pos +
button->y_size);
if (error != NULL) {
- LOG(("xwimp_resize_icon: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_resize_icon: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
button->icon = -1;
return false;
@@ -773,8 +770,7 @@ bool ro_gui_button_bar_click(struct button_bar *button_bar,
button_bar->sprites,
sprite, &box, NULL);
if (error)
- LOG(("xdragasprite_start: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xdragasprite_start: 0x%x: %s", error->errnum, error->errmess);
ro_mouse_drag_start(ro_gui_button_bar_drag_end,
NULL, NULL, NULL);
@@ -875,8 +871,7 @@ void ro_gui_button_bar_drag_end(wimp_dragged *drag, void *data)
error = xwimp_get_pointer_info(&pointer);
if (error) {
- LOG(("xwimp_get_pointer_info: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_pointer_info: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -886,8 +881,7 @@ void ro_gui_button_bar_drag_end(wimp_dragged *drag, void *data)
state.w = drag_start->window;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -1075,7 +1069,7 @@ char *ro_gui_button_bar_get_config(struct button_bar *button_bar)
config = malloc(size);
if (config == NULL) {
- LOG(("No memory for malloc()"));
+ LOG("No memory for malloc()");
warn_user("NoMemory", 0);
return NULL;
}
diff --git a/riscos/gui/progress_bar.c b/riscos/gui/progress_bar.c
index 09b3edb45..3ec6b3aa8 100644
--- a/riscos/gui/progress_bar.c
+++ b/riscos/gui/progress_bar.c
@@ -137,8 +137,7 @@ struct progress_bar *ro_gui_progress_bar_create(void)
error = xwimp_create_window((wimp_window *)&progress_bar_definition,
&pb->w);
if (error) {
- LOG(("xwimp_create_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_create_window: 0x%x: %s", error->errnum, error->errmess);
free(pb);
return NULL;
}
@@ -166,8 +165,7 @@ void ro_gui_progress_bar_destroy(struct progress_bar *pb)
ro_gui_wimp_event_finalise(pb->w);
error = xwimp_delete_window(pb->w);
if (error) {
- LOG(("xwimp_delete_window: 0x%x:%s",
- error->errnum, error->errmess));
+ LOG("xwimp_delete_window: 0x%x:%s", error->errnum, error->errmess);
}
free(pb);
@@ -329,8 +327,7 @@ void ro_gui_progress_bar_update(struct progress_bar *pb, int width, int height)
redraw.box.x0 = cur.x1;
error = xwimp_update_window(&redraw, &more);
if (error) {
- LOG(("Error getting update window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("Error getting update window: 0x%x: %s", error->errnum, error->errmess);
return;
}
if (more)
@@ -354,8 +351,7 @@ void ro_gui_progress_bar_redraw(wimp_draw *redraw)
error = xwimp_redraw_window(redraw, &more);
if (error) {
- LOG(("xwimp_redraw_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_redraw_window: 0x%x: %s", error->errnum, error->errmess);
return;
}
if (more)
@@ -389,7 +385,7 @@ void ro_gui_progress_bar_animate(void *p)
redraw.box = pb->visible;
error = xwimp_update_window(&redraw, &more);
if (error != NULL) {
- LOG(("Error getting update window: '%s'", error->errmess));
+ LOG("Error getting update window: '%s'", error->errmess);
return;
}
if (more)
@@ -532,8 +528,7 @@ void ro_gui_progress_bar_redraw_window(wimp_draw *redraw,
}
error = xwimp_get_rectangle(redraw, &more);
if (error) {
- LOG(("xwimp_get_rectangle: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_rectangle: 0x%x: %s", error->errnum, error->errmess);
return;
}
}
diff --git a/riscos/gui/status_bar.c b/riscos/gui/status_bar.c
index e7dc54279..cbc404658 100644
--- a/riscos/gui/status_bar.c
+++ b/riscos/gui/status_bar.c
@@ -130,8 +130,7 @@ struct status_bar *ro_gui_status_bar_create(wimp_w parent, unsigned int width)
error = xwimp_create_window((wimp_window *)&status_bar_definition,
&sb->w);
if (error) {
- LOG(("xwimp_create_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_create_window: 0x%x: %s", error->errnum, error->errmess);
free(sb);
return NULL;
}
@@ -165,8 +164,7 @@ void ro_gui_status_bar_destroy(struct status_bar *sb)
ro_gui_wimp_event_finalise(sb->w);
error = xwimp_delete_window(sb->w);
if (error) {
- LOG(("xwimp_delete_window: 0x%x:%s",
- error->errnum, error->errmess));
+ LOG("xwimp_delete_window: 0x%x:%s", error->errnum, error->errmess);
}
ro_gui_progress_bar_destroy(sb->pb);
@@ -223,8 +221,7 @@ void ro_gui_status_bar_set_visible(struct status_bar *sb, bool visible)
} else {
os_error *error = xwimp_close_window(sb->w);
if (error) {
- LOG(("xwimp_close_window: 0x%x:%s",
- error->errnum, error->errmess));
+ LOG("xwimp_close_window: 0x%x:%s", error->errnum, error->errmess);
}
}
}
@@ -277,15 +274,14 @@ void ro_gui_status_bar_set_progress_range(struct status_bar *sb,
old_range = ro_gui_progress_bar_get_range(sb->pb);
ro_gui_progress_bar_set_range(sb->pb, range);
- LOG(("Ranges are %i vs %i", old_range, range));
+ LOG("Ranges are %i vs %i", old_range, range);
if ((old_range == 0) && (range != 0)) {
ro_gui_status_position_progress_bar(sb);
} else if ((old_range != 0) && (range == 0)) {
os_error *error = xwimp_close_window(
ro_gui_progress_bar_get_window(sb->pb));
if (error) {
- LOG(("xwimp_close_window: 0x%x:%s",
- error->errnum, error->errmess));
+ LOG("xwimp_close_window: 0x%x:%s", error->errnum, error->errmess);
}
}
}
@@ -357,8 +353,7 @@ void ro_gui_status_bar_resize(struct status_bar *sb)
state.w = sb->parent;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
return;
}
window_width = state.visible.x1 - state.visible.x0;
@@ -381,8 +376,7 @@ void ro_gui_status_bar_resize(struct status_bar *sb)
extent.y1 = status_height - 4;
error = xwimp_set_extent(sb->w, &extent);
if (error) {
- LOG(("xwimp_set_extent: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_set_extent: 0x%x: %s", error->errnum, error->errmess);
return;
}
@@ -410,8 +404,7 @@ void ro_gui_status_bar_resize(struct status_bar *sb)
wimp_CHILD_LINKS_PARENT_VISIBLE_BOTTOM_OR_LEFT
<< wimp_CHILD_TS_EDGE_SHIFT);
if (error) {
- LOG(("xwimp_open_window_nested: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_open_window_nested: 0x%x: %s", error->errnum, error->errmess);
return;
}
ro_gui_status_position_progress_bar(sb);
@@ -419,8 +412,7 @@ void ro_gui_status_bar_resize(struct status_bar *sb)
status_width - WIDGET_WIDTH, 0,
status_width, status_height - 4);
if (error) {
- LOG(("xwimp_resize_icon: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_resize_icon: 0x%x: %s", error->errnum, error->errmess);
return;
}
@@ -455,8 +447,7 @@ void ro_gui_status_bar_redraw(wimp_draw *redraw)
/* redraw the window */
error = xwimp_redraw_window(redraw, &more);
if (error) {
- LOG(("xwimp_redraw_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_redraw_window: 0x%x: %s", error->errnum, error->errmess);
return;
}
while (more) {
@@ -465,8 +456,7 @@ void ro_gui_status_bar_redraw(wimp_draw *redraw)
error = xcolourtrans_set_font_colours(font_CURRENT,
0xeeeeee00, 0x00000000, 14, 0, 0, 0);
if (error) {
- LOG(("xcolourtrans_set_font_colours: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xcolourtrans_set_font_colours: 0x%x: %s", error->errnum, error->errmess);
return;
}
code = rufl_paint(ro_gui_desktop_font_family,
@@ -477,11 +467,9 @@ void ro_gui_status_bar_redraw(wimp_draw *redraw)
rufl_BLEND_FONT);
if (code != rufl_OK) {
if (code == rufl_FONT_MANAGER_ERROR)
- LOG(("rufl_FONT_MANAGER_ERROR: 0x%x: %s",
- rufl_fm_error->errnum,
- rufl_fm_error->errmess));
+ LOG("rufl_FONT_MANAGER_ERROR: 0x%x: %s", rufl_fm_error->errnum, rufl_fm_error->errmess);
else
- LOG(("rufl_paint: 0x%x", code));
+ LOG("rufl_paint: 0x%x", code);
}
}
@@ -494,8 +482,7 @@ void ro_gui_status_bar_redraw(wimp_draw *redraw)
error = xwimp_get_rectangle(redraw, &more);
if (error) {
- LOG(("xwimp_get_rectangle: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_rectangle: 0x%x: %s", error->errnum, error->errmess);
return;
}
}
@@ -534,8 +521,7 @@ bool ro_gui_status_bar_click(wimp_pointer *pointer)
drag.initial.y1 = pointer->pos.y;
error = xwimp_drag_box(&drag);
if (error) {
- LOG(("xwimp_drag_box: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_drag_box: 0x%x: %s", error->errnum, error->errmess);
}
break;
}
@@ -560,8 +546,7 @@ void ro_gui_status_bar_open(wimp_open *open)
state.w = sb->parent;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
return;
}
window_width = state.visible.x1 - state.visible.x0;
@@ -600,8 +585,7 @@ void ro_gui_status_position_progress_bar(struct status_bar *sb)
state.w = sb->w;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
return;
}
@@ -631,8 +615,7 @@ void ro_gui_status_position_progress_bar(struct status_bar *sb)
wimp_CHILD_LINKS_PARENT_VISIBLE_BOTTOM_OR_LEFT
<< wimp_CHILD_TS_EDGE_SHIFT);
if (error) {
- LOG(("xwimp_open_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess);
}
/* update the progress bar display on non-standard width */
diff --git a/riscos/gui/throbber.c b/riscos/gui/throbber.c
index 5e2c87678..2eabb3e7e 100644
--- a/riscos/gui/throbber.c
+++ b/riscos/gui/throbber.c
@@ -79,7 +79,7 @@ struct throbber *ro_gui_throbber_create(struct theme_descriptor *theme)
throbber = malloc(sizeof(struct throbber));
if (throbber == NULL) {
- LOG(("No memory for malloc()"));
+ LOG("No memory for malloc()");
return NULL;
}
@@ -246,8 +246,7 @@ bool ro_gui_throbber_icon_update(struct throbber *throbber)
error = xwimp_create_icon(&icon, &throbber->icon);
if (error != NULL) {
- LOG(("xwimp_create_icon: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_create_icon: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
throbber->icon = -1;
return false;
@@ -258,8 +257,7 @@ bool ro_gui_throbber_icon_update(struct throbber *throbber)
} else if (throbber->hidden && throbber->icon != -1) {
error = xwimp_delete_icon(throbber->window, throbber->icon);
if (error != NULL) {
- LOG(("xwimp_delete_icon: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_delete_icon: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
@@ -295,8 +293,7 @@ bool ro_gui_throbber_icon_resize(struct throbber *throbber)
throbber->extent.x0, throbber->extent.y0,
throbber->extent.x1, throbber->extent.y1);
if (error != NULL) {
- LOG(("xwimp_resize_icon: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_resize_icon: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
throbber->icon = -1;
return false;
diff --git a/riscos/gui/url_bar.c b/riscos/gui/url_bar.c
index 29eddedca..5eccd602e 100644
--- a/riscos/gui/url_bar.c
+++ b/riscos/gui/url_bar.c
@@ -133,7 +133,7 @@ struct url_bar *ro_gui_url_bar_create(struct theme_descriptor *theme)
url_bar = malloc(sizeof(struct url_bar));
if (url_bar == NULL) {
- LOG(("No memory for malloc()"));
+ LOG("No memory for malloc()");
return NULL;
}
@@ -228,8 +228,7 @@ static bool ro_gui_url_bar_icon_resize(struct url_bar *url_bar, bool full)
url_bar->container_icon,
x0, y0, x1, y1);
if (error != NULL) {
- LOG(("xwimp_resize_icon: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_resize_icon: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
url_bar->container_icon = -1;
return false;
@@ -249,8 +248,7 @@ static bool ro_gui_url_bar_icon_resize(struct url_bar *url_bar, bool full)
url_bar->suggest_icon,
x0, y0, x1, y1);
if (error != NULL) {
- LOG(("xwimp_resize_icon: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_resize_icon: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
url_bar->suggest_icon = -1;
return false;
@@ -271,8 +269,7 @@ static bool ro_gui_url_bar_icon_resize(struct url_bar *url_bar, bool full)
url_bar->text_icon,
x0, y0, x1, y1);
if (error != NULL) {
- LOG(("xwimp_resize_icon: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_resize_icon: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
url_bar->text_icon = -1;
return false;
@@ -353,8 +350,7 @@ static bool ro_gui_url_bar_icon_update(struct url_bar *url_bar)
wimp_ICON_BUTTON_TYPE_SHIFT);
error = xwimp_create_icon(&icon, &url_bar->container_icon);
if (error != NULL) {
- LOG(("xwimp_create_icon: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_create_icon: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
url_bar->container_icon = -1;
return false;
@@ -365,8 +361,7 @@ static bool ro_gui_url_bar_icon_update(struct url_bar *url_bar)
error = xwimp_delete_icon(url_bar->window,
url_bar->container_icon);
if (error != NULL) {
- LOG(("xwimp_delete_icon: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_delete_icon: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
@@ -392,8 +387,7 @@ static bool ro_gui_url_bar_icon_update(struct url_bar *url_bar)
wimp_ICON_BUTTON_TYPE_SHIFT);
error = xwimp_create_icon(&icon, &url_bar->text_icon);
if (error) {
- LOG(("xwimp_create_icon: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_create_icon: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
url_bar->text_icon = -1;
return false;
@@ -404,8 +398,7 @@ static bool ro_gui_url_bar_icon_update(struct url_bar *url_bar)
error = xwimp_delete_icon(url_bar->window,
url_bar->text_icon);
if (error != NULL) {
- LOG(("xwimp_delete_icon: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_delete_icon: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
@@ -425,8 +418,7 @@ static bool ro_gui_url_bar_icon_update(struct url_bar *url_bar)
wimp_ICON_BUTTON_TYPE_SHIFT);
error = xwimp_create_icon(&icon, &url_bar->suggest_icon);
if (error) {
- LOG(("xwimp_create_icon: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_create_icon: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
@@ -446,8 +438,7 @@ static bool ro_gui_url_bar_icon_update(struct url_bar *url_bar)
error = xwimp_delete_icon(url_bar->window,
url_bar->suggest_icon);
if (error != NULL) {
- LOG(("xwimp_delete_icon: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_delete_icon: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
@@ -931,8 +922,7 @@ bool ro_gui_url_bar_take_caret(struct url_bar *url_bar)
error = xwimp_set_caret_position(url_bar->window, url_bar->text_icon,
-1, -1, -1, 0);
if (error) {
- LOG(("xwimp_set_caret_position: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_set_caret_position: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
@@ -969,7 +959,7 @@ void ro_gui_url_bar_set_url(struct url_bar *url_bar, const char *url,
if (err != NSERROR_OK) {
/* A bad encoding should never happen, so assert this */
assert(err != NSERROR_BAD_ENCODING);
- LOG(("utf8_to_enc failed"));
+ LOG("utf8_to_enc failed");
/* Paranoia */
local_text = NULL;
}
@@ -986,7 +976,7 @@ void ro_gui_url_bar_set_url(struct url_bar *url_bar, const char *url,
strncpy(url_bar->text_buffer, "", url_bar->text_size - 1);
url_bar->text_buffer[url_bar->text_size - 1] = '\0';
warn_user("LongURL", NULL);
- LOG(("Long URL (%d chars): %s", strlen(url), url));
+ LOG("Long URL (%d chars): %s", strlen(url), url);
} else {
strncpy(url_bar->text_buffer, local_url,
url_bar->text_size - 1);
@@ -1014,8 +1004,7 @@ void ro_gui_url_bar_set_url(struct url_bar *url_bar, const char *url,
error = xwimp_get_caret_position(&caret);
if (error) {
- LOG(("xwimp_get_caret_position: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_caret_position: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -1028,8 +1017,7 @@ void ro_gui_url_bar_set_url(struct url_bar *url_bar, const char *url,
error = xwimp_set_caret_position(url_bar->window,
url_bar->text_icon, 0, 0, -1, strlen(set_url));
if (error) {
- LOG(("xwimp_set_caret_position: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_set_caret_position: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
}
@@ -1106,8 +1094,7 @@ bool ro_gui_url_bar_get_url_extent(struct url_bar *url_bar, os_box *extent)
state.i = url_bar->container_icon;
error = xwimp_get_icon_state(&state);
if (error) {
- LOG(("xwimp_get_icon_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
diff --git a/riscos/help.c b/riscos/help.c
index 76d75db9f..c54af1ded 100644
--- a/riscos/help.c
+++ b/riscos/help.c
@@ -167,8 +167,7 @@ void ro_gui_interactive_help_request(wimp_message *message)
error = xwimp_get_menu_state(wimp_GIVEN_WINDOW_AND_ICON,
&menu_tree, window, icon);
if (error) {
- LOG(("xwimp_get_menu_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_menu_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -271,8 +270,7 @@ static void ro_gui_interactive_help_broadcast(wimp_message *message,
error = xwimp_send_message(wimp_USER_MESSAGE, (wimp_message *)reply,
reply->sender);
if (error) {
- LOG(("xwimp_send_message: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_send_message: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
}
@@ -300,8 +298,7 @@ bool ro_gui_interactive_help_available(void)
error = xtaskmanager_enumerate_tasks(context, &task,
sizeof(taskmanager_task), &context, 0);
if (error) {
- LOG(("xtaskmanager_enumerate_tasks: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xtaskmanager_enumerate_tasks: 0x%x: %s", error->errnum, error->errmess);
warn_user("MiscError", error->errmess);
}
@@ -338,8 +335,7 @@ void ro_gui_interactive_help_start(void)
if ((help_start) && (help_start[0])) {
error = xwimp_start_task("<Help$Start>", &task);
if (error) {
- LOG(("xwimp_start_tast: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_start_tast: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -349,8 +345,7 @@ void ro_gui_interactive_help_start(void)
if (!task) {
error = xwimp_start_task("Resources:$.Apps.!Help", &task);
if (error) {
- LOG(("xwimp_start_tast: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_start_tast: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -360,8 +355,7 @@ void ro_gui_interactive_help_start(void)
if (task) {
error = xos_read_monotonic_time(&help_time);
if (error) {
- LOG(("xwimp_read_monotonic_time: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_read_monotonic_time: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
}
diff --git a/riscos/history.c b/riscos/history.c
index 3b8b63ae1..3dc9f0d7d 100644
--- a/riscos/history.c
+++ b/riscos/history.c
@@ -100,8 +100,7 @@ void ro_gui_history_open(struct gui_window *g, bool at_pointer)
box.y0 = -height;
error = xwimp_set_extent(history_window, &box);
if (error) {
- LOG(("xwimp_set_extent: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_set_extent: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -110,8 +109,7 @@ void ro_gui_history_open(struct gui_window *g, bool at_pointer)
state.w = history_window;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -122,8 +120,7 @@ void ro_gui_history_open(struct gui_window *g, bool at_pointer)
state.next = wimp_HIDDEN;
error = xwimp_open_window(PTR_WIMP_OPEN(&state));
if (error) {
- LOG(("xwimp_open_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -148,8 +145,7 @@ void ro_gui_history_redraw(wimp_draw *redraw)
error = xwimp_redraw_window(redraw, &more);
if (error) {
- LOG(("xwimp_redraw_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_redraw_window: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -159,8 +155,7 @@ void ro_gui_history_redraw(wimp_draw *redraw)
browser_window_history_redraw(history_bw, &ctx);
error = xwimp_get_rectangle(redraw, &more);
if (error) {
- LOG(("xwimp_get_rectangle: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_rectangle: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -209,7 +204,7 @@ void ro_gui_history_mouse_at(wimp_pointer *pointer, void *data)
os_box box = {0, 0, 0, 0};
os_error *error;
- LOG(("Mouse at..."));
+ LOG("Mouse at...");
/* If the mouse hasn't moved, or if we don't want tooltips, exit */
if ((mouse_x == pointer->pos.x && mouse_y == pointer->pos.y) ||
@@ -224,8 +219,7 @@ void ro_gui_history_mouse_at(wimp_pointer *pointer, void *data)
state.w = history_window;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -237,8 +231,7 @@ void ro_gui_history_mouse_at(wimp_pointer *pointer, void *data)
/* not over a tree entry => close tooltip window. */
error = xwimp_close_window(dialog_tooltip);
if (error) {
- LOG(("xwimp_close_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_close_window: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -250,8 +243,7 @@ void ro_gui_history_mouse_at(wimp_pointer *pointer, void *data)
strlen(url) > 256 ? 256 : strlen(url),
&width);
if (error) {
- LOG(("xwimptextop_string_width: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimptextop_string_width: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -263,8 +255,7 @@ void ro_gui_history_mouse_at(wimp_pointer *pointer, void *data)
ic.i = 0;
error = xwimp_get_icon_state(&ic);
if (error) {
- LOG(("xwimp_get_icon_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -272,8 +263,7 @@ void ro_gui_history_mouse_at(wimp_pointer *pointer, void *data)
ic.icon.extent.x0, ic.icon.extent.y0,
width + 16, ic.icon.extent.y1);
if (error) {
- LOG(("xwimp_resize_icon: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_resize_icon: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -281,8 +271,7 @@ void ro_gui_history_mouse_at(wimp_pointer *pointer, void *data)
state.w = dialog_tooltip;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -292,8 +281,7 @@ void ro_gui_history_mouse_at(wimp_pointer *pointer, void *data)
box.y0 = -36;
error = xwimp_set_extent(dialog_tooltip, &box);
if (error) {
- LOG(("xwimp_set_extent: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_set_extent: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -307,8 +295,7 @@ void ro_gui_history_mouse_at(wimp_pointer *pointer, void *data)
/* open window */
error = xwimp_open_window(PTR_WIMP_OPEN(&state));
if (error) {
- LOG(("xwimp_open_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -335,8 +322,7 @@ bool ro_gui_history_click(wimp_pointer *pointer)
state.w = history_window;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return true;
}
diff --git a/riscos/hotlist.c b/riscos/hotlist.c
index 38df65ef7..0ddc3c858 100644
--- a/riscos/hotlist.c
+++ b/riscos/hotlist.c
@@ -150,7 +150,7 @@ void ro_gui_hotlist_postinitialise(void)
hotlist_window.toolbar, &ro_hotlist_treeview_callbacks,
TREE_HOTLIST);
if (hotlist_window.tv == NULL) {
- LOG(("Failed to allocate treeview"));
+ LOG("Failed to allocate treeview");
return;
}
@@ -233,7 +233,7 @@ void ro_gui_hotlist_open(void)
if (error == NULL)
return;
- LOG(("xos_cli: 0x%x: %s", error->errnum, error->errmess));
+ LOG("xos_cli: 0x%x: %s", error->errnum, error->errmess);
warn_user("Failed to launch external hotlist: %s",
error->errmess);
}
diff --git a/riscos/iconbar.c b/riscos/iconbar.c
index 23df24c3d..7b7bb250e 100644
--- a/riscos/iconbar.c
+++ b/riscos/iconbar.c
@@ -95,8 +95,7 @@ void ro_gui_iconbar_initialise(void)
{ "!netsurf" } } };
error = xwimp_create_icon(&icon, 0);
if (error) {
- LOG(("xwimp_create_icon: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_create_icon: 0x%x: %s", error->errnum, error->errmess);
die(error->errmess);
}
@@ -238,7 +237,7 @@ bool ro_gui_iconbar_menu_select(wimp_w w, wimp_i i, wimp_menu *menu,
return true;
case APPLICATION_QUIT:
if (ro_gui_prequit()) {
- LOG(("QUIT in response to user request"));
+ LOG("QUIT in response to user request");
riscos_done = true;
}
return true;
diff --git a/riscos/image.c b/riscos/image.c
index 18ad4859e..63e65f27b 100644
--- a/riscos/image.c
+++ b/riscos/image.c
@@ -142,8 +142,7 @@ bool image_redraw_tinct(osspriteop_id header, int x, int y,
}
if (error) {
- LOG(("xtinct_plotscaled%s: 0x%x: %s", (alpha ? "alpha" : ""),
- error->errnum, error->errmess));
+ LOG("xtinct_plotscaled%s: 0x%x: %s", (alpha ? "alpha" : ""), error->errnum, error->errmess);
return false;
}
@@ -177,14 +176,13 @@ bool image_redraw_os(osspriteop_id header, int x, int y, int req_width,
colourtrans_CURRENT_PALETTE,
0, colourtrans_GIVEN_SPRITE, 0, 0, &size);
if (error) {
- LOG(("xcolourtrans_generate_table_for_sprite: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xcolourtrans_generate_table_for_sprite: 0x%x: %s", error->errnum, error->errmess);
return false;
}
table = calloc(size, sizeof(char));
if (!table) {
- LOG(("malloc failed"));
+ LOG("malloc failed");
warn_user("NoMemory", 0);
return false;
}
@@ -195,8 +193,7 @@ bool image_redraw_os(osspriteop_id header, int x, int y, int req_width,
colourtrans_CURRENT_PALETTE,
table, colourtrans_GIVEN_SPRITE, 0, 0, 0);
if (error) {
- LOG(("xcolourtrans_generate_table_for_sprite: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xcolourtrans_generate_table_for_sprite: 0x%x: %s", error->errnum, error->errmess);
free(table);
return false;
}
@@ -211,8 +208,7 @@ bool image_redraw_os(osspriteop_id header, int x, int y, int req_width,
x, (int)(y - req_height),
8, &f, table);
if (error) {
- LOG(("xosspriteop_put_sprite_scaled: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosspriteop_put_sprite_scaled: 0x%x: %s", error->errnum, error->errmess);
free(table);
return false;
}
diff --git a/riscos/menus.c b/riscos/menus.c
index a7926ff70..b803f8cf8 100644
--- a/riscos/menus.c
+++ b/riscos/menus.c
@@ -238,8 +238,7 @@ void ro_gui_menu_create(wimp_menu *menu, int x, int y, wimp_w w)
current_menu_open = true;
error = xwimp_create_menu(menu, x - 64, y);
if (error) {
- LOG(("xwimp_create_menu: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_create_menu: 0x%x: %s", error->errnum, error->errmess);
warn_user("MenuError", error->errmess);
ro_gui_menu_closed();
}
@@ -265,16 +264,14 @@ void ro_gui_popup_menu(wimp_menu *menu, wimp_w w, wimp_i i)
icon_state.i = i;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("MenuError", error->errmess);
return;
}
error = xwimp_get_icon_state(&icon_state);
if (error) {
- LOG(("xwimp_get_icon_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("MenuError", error->errmess);
return;
}
@@ -300,8 +297,7 @@ void ro_gui_menu_destroy(void)
error = xwimp_create_menu(wimp_CLOSE_MENU, 0, 0);
if (error) {
- LOG(("xwimp_create_menu: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_create_menu: 0x%x: %s", error->errnum, error->errmess);
warn_user("MenuError", error->errmess);
}
@@ -364,8 +360,7 @@ void ro_gui_menu_selection(wimp_selection *selection)
/* re-open the menu for Adjust clicks */
error = xwimp_get_pointer_info(&pointer);
if (error) {
- LOG(("xwimp_get_pointer_info: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_pointer_info: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
ro_gui_menu_closed();
return;
@@ -431,8 +426,7 @@ void ro_gui_menu_warning(wimp_message_menu_warning *warning)
error = xwimp_create_sub_menu(menu_entry->sub_menu,
warning->pos.x, warning->pos.y);
if (error) {
- LOG(("xwimp_create_sub_menu: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_create_sub_menu: 0x%x: %s", error->errnum, error->errmess);
warn_user("MenuError", error->errmess);
}
}
@@ -497,8 +491,7 @@ void ro_gui_menu_refresh(wimp_menu *menu)
os_error *error;
error = xwimp_create_menu(current_menu, 0, 0);
if (error) {
- LOG(("xwimp_create_menu: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_create_menu: 0x%x: %s", error->errnum, error->errmess);
warn_user("MenuError", error->errmess);
}
}
@@ -864,8 +857,7 @@ int ro_gui_menu_get_checksum(void)
error = xwimp_get_menu_state((wimp_menu_state_flags)0,
&menu_tree, 0, 0);
if (error) {
- LOG(("xwimp_get_menu_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_menu_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("MenuError", error->errmess);
return 0;
}
@@ -908,8 +900,7 @@ bool ro_gui_menu_translate(struct menu_definition *menu)
/* read current alphabet */
error = xosbyte1(osbyte_ALPHABET_NUMBER, 127, 0, &alphabet);
if (error) {
- LOG(("failed reading alphabet: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("failed reading alphabet: 0x%x: %s", error->errnum, error->errmess);
/* assume Latin1 */
alphabet = territory_ALPHABET_LATIN1;
}
@@ -924,7 +915,7 @@ bool ro_gui_menu_translate(struct menu_definition *menu)
0, &translated);
if (err != NSERROR_OK) {
assert(err != NSERROR_BAD_ENCODING);
- LOG(("utf8_to_enc failed"));
+ LOG("utf8_to_enc failed");
return false;
}
@@ -941,7 +932,7 @@ bool ro_gui_menu_translate(struct menu_definition *menu)
0, &translated);
if (err != NSERROR_OK) {
assert(err != NSERROR_BAD_ENCODING);
- LOG(("utf8_to_enc failed"));
+ LOG("utf8_to_enc failed");
return false;
}
diff --git a/riscos/message.c b/riscos/message.c
index d129d5d31..c97434b8a 100644
--- a/riscos/message.c
+++ b/riscos/message.c
@@ -63,8 +63,7 @@ bool ro_message_send_message(wimp_event_no event, wimp_message *message,
/* send a message */
error = xwimp_send_message(event, message, task);
if (error) {
- LOG(("xwimp_send_message: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_send_message: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
@@ -101,8 +100,7 @@ bool ro_message_send_message_to_window(wimp_event_no event, wimp_message *messag
/* send a message */
error = xwimp_send_message_to_window(event, message, to_w, to_i, to_t);
if (error) {
- LOG(("xwimp_send_message_to_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_send_message_to_window: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
diff --git a/riscos/mouse.c b/riscos/mouse.c
index 92b65add3..e53a593ae 100644
--- a/riscos/mouse.c
+++ b/riscos/mouse.c
@@ -79,8 +79,7 @@ void ro_mouse_poll(void)
error = xwimp_get_pointer_info(&pointer);
if (error) {
- LOG(("xwimp_get_pointer_info: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_pointer_info: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -193,7 +192,7 @@ void ro_mouse_track_start(void (*poll_end)(wimp_leaving *leaving, void *data),
ro_mouse_ignore_leaving_event == false)
ro_mouse_poll_end_callback(NULL, ro_mouse_poll_data);
- LOG(("Unexpected mouse track termination."));
+ LOG("Unexpected mouse track termination.");
ro_mouse_ignore_leaving_event = false;
ro_mouse_poll_end_callback = NULL;
diff --git a/riscos/plotters.c b/riscos/plotters.c
index e23242e74..38fd9d74a 100644
--- a/riscos/plotters.c
+++ b/riscos/plotters.c
@@ -85,8 +85,7 @@ bool ro_plot_rectangle(int x0, int y0, int x1, int y1, const plot_style_t *style
colourtrans_USE_ECFS_GCOL,
os_ACTION_OVERWRITE, 0, 0);
if (error) {
- LOG(("xcolourtrans_set_gcol: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xcolourtrans_set_gcol: 0x%x: %s", error->errnum, error->errmess);
return false;
}
@@ -94,7 +93,7 @@ bool ro_plot_rectangle(int x0, int y0, int x1, int y1, const plot_style_t *style
ro_plot_origin_x + x0 * 2,
ro_plot_origin_y - y0 * 2 - 1);
if (error) {
- LOG(("xos_plot: 0x%x: %s", error->errnum, error->errmess));
+ LOG("xos_plot: 0x%x: %s", error->errnum, error->errmess);
return false;
}
@@ -102,7 +101,7 @@ bool ro_plot_rectangle(int x0, int y0, int x1, int y1, const plot_style_t *style
ro_plot_origin_x + x1 * 2 - 1,
ro_plot_origin_y - y1 * 2);
if (error) {
- LOG(("xos_plot: 0x%x: %s", error->errnum, error->errmess));
+ LOG("xos_plot: 0x%x: %s", error->errnum, error->errmess);
return false;
}
}
@@ -197,16 +196,14 @@ bool ro_plot_draw_path(const draw_path * const path, int width,
error = xcolourtrans_set_gcol(c << 8, 0, os_ACTION_OVERWRITE, 0, 0);
if (error) {
- LOG(("xcolourtrans_set_gcol: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xcolourtrans_set_gcol: 0x%x: %s", error->errnum, error->errmess);
return false;
}
error = xdraw_stroke(path, 0, 0, 0, width * 2 * 256,
&line_style, dash_pattern);
if (error) {
- LOG(("xdraw_stroke: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xdraw_stroke: 0x%x: %s", error->errnum, error->errmess);
return false;
}
@@ -231,14 +228,12 @@ bool ro_plot_polygon(const int *p, unsigned int n, const plot_style_t *style)
error = xcolourtrans_set_gcol(style->fill_colour << 8, 0, os_ACTION_OVERWRITE, 0, 0);
if (error) {
- LOG(("xcolourtrans_set_gcol: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xcolourtrans_set_gcol: 0x%x: %s", error->errnum, error->errmess);
return false;
}
error = xdraw_fill((draw_path *) path, 0, 0, 0);
if (error) {
- LOG(("xdraw_fill: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xdraw_fill: 0x%x: %s", error->errnum, error->errmess);
return false;
}
@@ -261,13 +256,13 @@ bool ro_plot_path(const float *p, unsigned int n, colour fill, float width,
return true;
if (p[0] != PLOTTER_PATH_MOVE) {
- LOG(("path doesn't start with a move"));
+ LOG("path doesn't start with a move");
goto error;
}
path = malloc(sizeof *path * (n + 10));
if (!path) {
- LOG(("out of memory"));
+ LOG("out of memory");
goto error;
}
@@ -295,7 +290,7 @@ bool ro_plot_path(const float *p, unsigned int n, colour fill, float width,
path[i + 6] = -p[i + 6] * 2 * 256;
i += 7;
} else {
- LOG(("bad path command %f", p[i]));
+ LOG("bad path command %f", p[i]);
goto error;
}
}
@@ -313,15 +308,13 @@ bool ro_plot_path(const float *p, unsigned int n, colour fill, float width,
error = xcolourtrans_set_gcol(fill << 8, 0,
os_ACTION_OVERWRITE, 0, 0);
if (error) {
- LOG(("xcolourtrans_set_gcol: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xcolourtrans_set_gcol: 0x%x: %s", error->errnum, error->errmess);
goto error;
}
error = xdraw_fill((draw_path *) path, 0, &trfm, 0);
if (error) {
- LOG(("xdraw_stroke: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xdraw_stroke: 0x%x: %s", error->errnum, error->errmess);
goto error;
}
}
@@ -330,16 +323,14 @@ bool ro_plot_path(const float *p, unsigned int n, colour fill, float width,
error = xcolourtrans_set_gcol(c << 8, 0,
os_ACTION_OVERWRITE, 0, 0);
if (error) {
- LOG(("xcolourtrans_set_gcol: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xcolourtrans_set_gcol: 0x%x: %s", error->errnum, error->errmess);
goto error;
}
error = xdraw_stroke((draw_path *) path, 0, &trfm, 0,
width * 2 * 256, &line_style, 0);
if (error) {
- LOG(("xdraw_stroke: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xdraw_stroke: 0x%x: %s", error->errnum, error->errmess);
goto error;
}
}
@@ -366,8 +357,7 @@ bool ro_plot_clip(const struct rect *clip)
int clip_y1 = ro_plot_origin_y - clip->y1 * 2;
if (clip_x1 < clip_x0 || clip_y0 < clip_y1) {
- 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);
return false;
}
@@ -383,7 +373,7 @@ bool ro_plot_clip(const struct rect *clip)
error = xos_writen(buf, 9);
if (error) {
- LOG(("xos_writen: 0x%x: %s", error->errnum, error->errmess));
+ LOG("xos_writen: 0x%x: %s", error->errnum, error->errmess);
return false;
}
@@ -400,8 +390,7 @@ bool ro_plot_text(int x, int y, const char *text, size_t length,
fstyle->background << 8, fstyle->foreground << 8,
14, 0, 0, 0);
if (error) {
- LOG(("xcolourtrans_set_font_colours: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xcolourtrans_set_font_colours: 0x%x: %s", error->errnum, error->errmess);
return false;
}
@@ -418,20 +407,19 @@ bool ro_plot_disc(int x, int y, int radius, const plot_style_t *style)
error = xcolourtrans_set_gcol(style->fill_colour << 8, 0,
os_ACTION_OVERWRITE, 0, 0);
if (error) {
- LOG(("xcolourtrans_set_gcol: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xcolourtrans_set_gcol: 0x%x: %s", error->errnum, error->errmess);
return false;
}
error = xos_plot(os_MOVE_TO,
ro_plot_origin_x + x * 2,
ro_plot_origin_y - y * 2);
if (error) {
- LOG(("xos_plot: 0x%x: %s", error->errnum, error->errmess));
+ LOG("xos_plot: 0x%x: %s", error->errnum, error->errmess);
return false;
}
error = xos_plot(os_PLOT_CIRCLE | os_PLOT_BY, radius * 2, 0);
if (error) {
- LOG(("xos_plot: 0x%x: %s", error->errnum, error->errmess));
+ LOG("xos_plot: 0x%x: %s", error->errnum, error->errmess);
return false;
}
}
@@ -441,22 +429,21 @@ bool ro_plot_disc(int x, int y, int radius, const plot_style_t *style)
error = xcolourtrans_set_gcol(style->stroke_colour << 8, 0,
os_ACTION_OVERWRITE, 0, 0);
if (error) {
- LOG(("xcolourtrans_set_gcol: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xcolourtrans_set_gcol: 0x%x: %s", error->errnum, error->errmess);
return false;
}
error = xos_plot(os_MOVE_TO,
ro_plot_origin_x + x * 2,
ro_plot_origin_y - y * 2);
if (error) {
- LOG(("xos_plot: 0x%x: %s", error->errnum, error->errmess));
+ LOG("xos_plot: 0x%x: %s", error->errnum, error->errmess);
return false;
}
error = xos_plot(os_PLOT_CIRCLE_OUTLINE | os_PLOT_BY,
radius * 2, 0);
if (error) {
- LOG(("xos_plot: 0x%x: %s", error->errnum, error->errmess));
+ LOG("xos_plot: 0x%x: %s", error->errnum, error->errmess);
return false;
}
}
@@ -477,8 +464,7 @@ bool ro_plot_arc(int x, int y, int radius, int angle1, int angle2, const plot_st
os_ACTION_OVERWRITE, 0, 0);
if (error) {
- LOG(("xcolourtrans_set_gcol: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xcolourtrans_set_gcol: 0x%x: %s", error->errnum, error->errmess);
return false;
}
@@ -492,19 +478,19 @@ bool ro_plot_arc(int x, int y, int radius, int angle1, int angle2, const plot_st
error = xos_plot(os_MOVE_TO, x, y); /* move to centre */
if (error) {
- LOG(("xos_plot: 0x%x: %s", error->errnum, error->errmess));
+ LOG("xos_plot: 0x%x: %s", error->errnum, error->errmess);
return false;
}
error = xos_plot(os_MOVE_TO, sx, sy); /* move to start */
if (error) {
- LOG(("xos_plot: 0x%x: %s", error->errnum, error->errmess));
+ LOG("xos_plot: 0x%x: %s", error->errnum, error->errmess);
return false;
}
error = xos_plot(os_PLOT_ARC | os_PLOT_TO, ex, ey); /* arc to end */
if (error) {
- LOG(("xos_plot: 0x%x: %s", error->errnum, error->errmess));
+ LOG("xos_plot: 0x%x: %s", error->errnum, error->errmess);
return false;
}
@@ -521,7 +507,7 @@ bool ro_plot_bitmap(int x, int y, int width, int height,
buffer = riscos_bitmap_get_buffer(bitmap);
if (!buffer) {
- LOG(("bitmap_get_buffer failed"));
+ LOG("bitmap_get_buffer failed");
return false;
}
diff --git a/riscos/print.c b/riscos/print.c
index 829029eda..0fb9a9a44 100644
--- a/riscos/print.c
+++ b/riscos/print.c
@@ -196,7 +196,7 @@ void ro_gui_print_prepare(struct gui_window *g)
/* Read Printer Driver name */
error = xpdriver_info(0, 0, 0, 0, &desc, 0, 0, 0);
if (error) {
- LOG(("xpdriver_info: 0x%x: %s", error->errnum, error->errmess));
+ LOG("xpdriver_info: 0x%x: %s", error->errnum, error->errmess);
printers_exists = false;
}
@@ -333,8 +333,7 @@ void print_send_printsave(hlcache_handle *h)
e = xwimp_send_message(wimp_USER_MESSAGE_RECORDED,
(wimp_message *)&m, 0);
if (e) {
- LOG(("xwimp_send_message: 0x%x: %s",
- e->errnum, e->errmess));
+ LOG("xwimp_send_message: 0x%x: %s", e->errnum, e->errmess);
warn_user("WimpError", e->errmess);
ro_print_cleanup();
}
@@ -358,8 +357,7 @@ bool print_send_printtypeknown(wimp_message *m)
m->action = message_PRINT_TYPE_KNOWN;
e = xwimp_send_message(wimp_USER_MESSAGE, m, m->sender);
if (e) {
- LOG(("xwimp_send_message: 0x%x: %s",
- e->errnum, e->errmess));
+ LOG("xwimp_send_message: 0x%x: %s", e->errnum, e->errmess);
warn_user("WimpError", e->errmess);
return false;
}
@@ -465,8 +463,7 @@ bool ro_print_ack(wimp_message *m)
/* read printer driver type */
error = xpdriver_info(&info_type, 0, 0, 0, 0, 0, 0, 0);
if (error) {
- LOG(("xpdriver_info: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xpdriver_info: 0x%x: %s", error->errnum, error->errmess);
warn_user("PrintError", error->errmess);
ro_print_cleanup();
return true;
@@ -491,8 +488,7 @@ bool ro_print_ack(wimp_message *m)
error = xwimp_send_message(wimp_USER_MESSAGE_RECORDED, m, m->sender);
if (error) {
- LOG(("xwimp_send_message: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_send_message: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
/* and delete temporary file */
xosfile_delete(m->data.data_xfer.file_name,
@@ -564,8 +560,7 @@ bool print_document(struct gui_window *g, const char *filename)
/* read printer driver features */
error = xpdriver_info(0, 0, 0, &features, 0, 0, 0, 0);
if (error) {
- LOG(("xpdriver_info: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xpdriver_info: 0x%x: %s", error->errnum, error->errmess);
warn_user("PrintError", error->errmess);
return false;
}
@@ -573,8 +568,7 @@ bool print_document(struct gui_window *g, const char *filename)
/* read page size */
error = xpdriver_page_size(0, 0, &left, &bottom, &right, &top);
if (error) {
- LOG(("xpdriver_page_size: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xpdriver_page_size: 0x%x: %s", error->errnum, error->errmess);
warn_user("PrintError", error->errmess);
return false;
}
@@ -597,8 +591,7 @@ bool print_document(struct gui_window *g, const char *filename)
error = xosfind_openoutw(osfind_NO_PATH | osfind_ERROR_IF_DIR |
osfind_ERROR_IF_ABSENT, filename, 0, &fhandle);
if (error) {
- LOG(("xosfind_openoutw: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfind_openoutw: 0x%x: %s", error->errnum, error->errmess);
warn_user("PrintError", error->errmess);
return false;
}
@@ -606,8 +599,7 @@ bool print_document(struct gui_window *g, const char *filename)
/* select print job */
error = xpdriver_select_jobw(fhandle, "NetSurf", &old_job);
if (error) {
- LOG(("xpdriver_select_jobw: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xpdriver_select_jobw: 0x%x: %s", error->errnum, error->errmess);
warn_user("PrintError", error->errmess);
xosfind_closew(fhandle);
return false;
@@ -667,21 +659,18 @@ bool print_document(struct gui_window *g, const char *filename)
/* give page rectangle */
error = xpdriver_give_rectangle(0, &b, &t, &p, os_COLOUR_WHITE);
if (error) {
- LOG(("xpdriver_give_rectangle: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xpdriver_give_rectangle: 0x%x: %s", error->errnum, error->errmess);
error_message = error->errmess;
goto error;
}
- LOG(("given rectangle: [(%d, %d), (%d, %d)]",
- b.x0, b.y0, b.x1, b.y1));
+ LOG("given rectangle: [(%d, %d), (%d, %d)]", b.x0, b.y0, b.x1, b.y1);
/* and redraw the document */
error = xpdriver_draw_page(print_num_copies, &b, 0, 0,
&more, 0);
if (error) {
- LOG(("xpdriver_draw_page: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xpdriver_draw_page: 0x%x: %s", error->errnum, error->errmess);
error_message = error->errmess;
goto error;
}
@@ -695,8 +684,7 @@ bool print_document(struct gui_window *g, const char *filename)
.plot = &ro_plotters
};
- LOG(("redrawing area: [(%d, %d), (%d, %d)]",
- b.x0, b.y0, b.x1, b.y1));
+ LOG("redrawing area: [(%d, %d), (%d, %d)]", b.x0, b.y0, b.x1, b.y1);
clip.x0 = (b.x0 - ro_plot_origin_x) / 2;
clip.y0 = (ro_plot_origin_y - b.y1) / 2;
clip.x1 = (b.x1 - ro_plot_origin_x) / 2;
@@ -718,8 +706,7 @@ bool print_document(struct gui_window *g, const char *filename)
error = xpdriver_get_rectangle(&b, &more, 0);
if (error) {
- LOG(("xpdriver_get_rectangle: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xpdriver_get_rectangle: 0x%x: %s", error->errnum, error->errmess);
error_message = error->errmess;
goto error;
}
@@ -741,16 +728,14 @@ bool print_document(struct gui_window *g, const char *filename)
error = (os_error *) _swix(PDriver_EndJob, _IN(0), (int) fhandle);
if (error) {
- LOG(("xpdriver_end_jobw: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xpdriver_end_jobw: 0x%x: %s", error->errnum, error->errmess);
error_message = error->errmess;
goto error;
}
error = xosfind_closew(fhandle);
if (error) {
- LOG(("xosfind_closew: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfind_closew: 0x%x: %s", error->errnum, error->errmess);
warn_user("PrintError", error->errmess);
return false;
}
@@ -758,8 +743,7 @@ bool print_document(struct gui_window *g, const char *filename)
if (old_job) {
error = xpdriver_select_jobw(old_job, 0, 0);
if (error) {
- LOG(("xpdriver_select_jobw: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xpdriver_select_jobw: 0x%x: %s", error->errnum, error->errmess);
warn_user("PrintError", error->errmess);
/* the printing succeeded anyway */
return true;
@@ -840,20 +824,18 @@ const char *print_declare_fonts(hlcache_handle *h)
}
for (i = 0; i != print_fonts_count; ++i) {
- LOG(("%u %s", i, print_fonts_list[i]));
+ LOG("%u %s", i, print_fonts_list[i]);
error = xpdriver_declare_font(0, print_fonts_list[i],
pdriver_KERNED);
if (error) {
- LOG(("xpdriver_declare_font: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xpdriver_declare_font: 0x%x: %s", error->errnum, error->errmess);
error_message = error->errmess;
goto end;
}
}
error = xpdriver_declare_font(0, 0, 0);
if (error) {
- LOG(("xpdriver_declare_font: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xpdriver_declare_font: 0x%x: %s", error->errnum, error->errmess);
error_message = error->errmess;
goto end;
}
@@ -932,13 +914,10 @@ bool print_fonts_plot_text(int x, int y, const char *text, size_t length,
text, length, 0, 0, print_fonts_callback, 0);
if (code != rufl_OK) {
if (code == rufl_FONT_MANAGER_ERROR) {
- LOG(("rufl_paint_callback: rufl_FONT_MANAGER_ERROR: "
- "0x%x: %s",
- rufl_fm_error->errnum,
- rufl_fm_error->errmess));
+ LOG("rufl_paint_callback: rufl_FONT_MANAGER_ERROR: ""0x%x: %s", rufl_fm_error->errnum, rufl_fm_error->errmess);
print_fonts_error = rufl_fm_error->errmess;
} else {
- LOG(("rufl_paint_callback: 0x%x", code));
+ LOG("rufl_paint_callback: 0x%x", code);
}
return false;
}
diff --git a/riscos/query.c b/riscos/query.c
index aa7492196..178dcaf5b 100644
--- a/riscos/query.c
+++ b/riscos/query.c
@@ -175,7 +175,7 @@ query_id query_user_xy(const char *query, const char *detail,
err = utf8_to_local_encoding(yes, 0, &local_text);
if (err != NSERROR_OK) {
assert(err != NSERROR_BAD_ENCODING);
- LOG(("utf8_to_local_encoding_failed"));
+ LOG("utf8_to_local_encoding_failed");
local_text = NULL;
}
@@ -191,8 +191,7 @@ query_id query_user_xy(const char *query, const char *detail,
error = xwimptextop_string_width(icn->data.indirected_text.text, len, &width);
if (error) {
- LOG(("xwimptextop_string_width: 0x%x:%s",
- error->errnum, error->errmess));
+ LOG("xwimptextop_string_width: 0x%x:%s", error->errnum, error->errmess);
width = len * 16;
}
if (!query_yes_width) query_yes_width = icn->extent.x1 - icn->extent.x0;
@@ -205,7 +204,7 @@ query_id query_user_xy(const char *query, const char *detail,
err = utf8_to_local_encoding(no, 0, &local_text);
if (err != NSERROR_OK) {
assert(err != NSERROR_BAD_ENCODING);
- LOG(("utf8_to_local_encoding_failed"));
+ LOG("utf8_to_local_encoding_failed");
local_text = NULL;
}
@@ -223,8 +222,7 @@ query_id query_user_xy(const char *query, const char *detail,
icn->extent.x1 = tx - 16;
error = xwimptextop_string_width(icn->data.indirected_text.text, len, &width);
if (error) {
- LOG(("xwimptextop_string_width: 0x%x:%s",
- error->errnum, error->errmess));
+ LOG("xwimptextop_string_width: 0x%x:%s", error->errnum, error->errmess);
width = len * 16;
}
width += 28;
@@ -265,8 +263,7 @@ query_id query_user_xy(const char *query, const char *detail,
error = xwimp_set_caret_position(qw->window, (wimp_i)-1, 0, 0, 1 << 25, -1);
if (error) {
- LOG(("xwimp_get_caret_position: 0x%x : %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_caret_position: 0x%x : %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
@@ -310,8 +307,7 @@ void ro_gui_query_window_bring_to_front(query_id id)
error = xwimp_set_caret_position(qw->window, (wimp_i)-1, 0, 0, 1 << 25, -1);
if (error) {
- LOG(("xwimp_get_caret_position: 0x%x : %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_caret_position: 0x%x : %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
}
@@ -331,8 +327,7 @@ void ro_gui_query_close(wimp_w w)
ro_gui_dialog_close(w);
error = xwimp_delete_window(qw->window);
if (error) {
- LOG(("xwimp_delete_window: 0x%x:%s",
- error->errnum, error->errmess));
+ LOG("xwimp_delete_window: 0x%x:%s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
ro_gui_wimp_event_finalise(w);
diff --git a/riscos/save.c b/riscos/save.c
index 1d2fce484..1816cec0d 100644
--- a/riscos/save.c
+++ b/riscos/save.c
@@ -180,7 +180,7 @@ wimp_w ro_gui_saveas_create(const char *template_name)
error = xosmodule_alloc(area_size, (void **) &area);
if (error) {
- LOG(("xosmodule_alloc: 0x%x: %s", error->errnum, error->errmess));
+ LOG("xosmodule_alloc: 0x%x: %s", error->errnum, error->errmess);
xwimp_close_template();
die(error->errmess);
} else {
@@ -190,8 +190,7 @@ wimp_w ro_gui_saveas_create(const char *template_name)
error = xosspriteop_clear_sprites(osspriteop_USER_AREA, saveas_area);
if (error) {
- LOG(("xosspriteop_clear_sprites: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosspriteop_clear_sprites: 0x%x: %s", error->errnum, error->errmess);
warn_user("MiscError", error->errmess);
xosmodule_free(saveas_area);
@@ -207,8 +206,7 @@ wimp_w ro_gui_saveas_create(const char *template_name)
/* create window */
error = xwimp_create_window(window, &w);
if (error) {
- LOG(("xwimp_create_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_create_window: 0x%x: %s", error->errnum, error->errmess);
xwimp_close_template();
die(error->errmess);
}
@@ -229,7 +227,7 @@ void ro_gui_saveas_quit(void)
if (saveas_area) {
os_error *error = xosmodule_free(saveas_area);
if (error) {
- LOG(("xosmodule_free: 0x%x: %s", error->errnum, error->errmess));
+ LOG("xosmodule_free: 0x%x: %s", error->errnum, error->errmess);
warn_user("MiscError", error->errmess);
}
saveas_area = NULL;
@@ -384,8 +382,7 @@ void gui_drag_save_object(struct gui_window *g, hlcache_handle *c,
error = xwimp_get_pointer_info(&pointer);
if (error) {
- LOG(("xwimp_get_pointer_info: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_pointer_info: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -423,8 +420,7 @@ void gui_drag_save_selection(struct gui_window *g, const char *selection)
error = xwimp_get_pointer_info(&pointer);
if (error) {
- LOG(("xwimp_get_pointer_info: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_pointer_info: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -477,8 +473,7 @@ void ro_gui_drag_save_link(gui_save_type save_type, const nsurl *url,
error = xwimp_get_pointer_info(&pointer);
if (error) {
- LOG(("xwimp_get_pointer_info: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_pointer_info: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -516,8 +511,7 @@ void ro_gui_drag_icon(int x, int y, const char *sprite)
saveas_area, (osspriteop_id)sprite, NULL);
if (error) {
if (error->errnum != error_SPRITE_OP_DOESNT_EXIST) {
- LOG(("xosspriteop_select_sprite: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosspriteop_select_sprite: 0x%x: %s", error->errnum, error->errmess);
warn_user("MiscError", error->errmess);
}
}
@@ -537,8 +531,7 @@ void ro_gui_drag_icon(int x, int y, const char *sprite)
return;
}
- LOG(("xdragasprite_start: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xdragasprite_start: 0x%x: %s", error->errnum, error->errmess);
}
drag.type = wimp_DRAG_USER_FIXED;
@@ -551,8 +544,7 @@ void ro_gui_drag_icon(int x, int y, const char *sprite)
error = xwimp_drag_box(&drag);
if (error) {
- LOG(("xwimp_drag_box: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_drag_box: 0x%x: %s", error->errnum, error->errmess);
warn_user("DragError", error->errmess);
}
else
@@ -591,16 +583,14 @@ void ro_gui_drag_box_cancel(void)
if (using_dragasprite) {
error = xdragasprite_stop();
if (error) {
- LOG(("xdragasprite_stop: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xdragasprite_stop: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
}
else {
error = xwimp_drag_box(NULL);
if (error) {
- LOG(("xwimp_drag_box: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_drag_box: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
}
@@ -630,8 +620,7 @@ static void ro_gui_save_drag_end(wimp_dragged *drag, void *data)
error = xwimp_get_pointer_info(&pointer);
if (error) {
- LOG(("xwimp_get_pointer_info: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_pointer_info: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -768,7 +757,7 @@ void ro_gui_save_datasave_ack(wimp_message *message)
default:
if (!gui_save_content) {
- LOG(("unexpected DataSaveAck: gui_save_content not set"));
+ LOG("unexpected DataSaveAck: gui_save_content not set");
return;
}
break;
@@ -818,7 +807,7 @@ bool ro_gui_save_content(hlcache_handle *h, char *path, bool force_overwrite)
error = xosfile_read_stamped(path, &obj_type,
NULL, NULL, NULL, NULL, NULL);
if (error) {
- LOG(("xosfile_read_stamped: 0x%x:%s", error->errnum, error->errmess));
+ LOG("xosfile_read_stamped: 0x%x:%s", error->errnum, error->errmess);
warn_user("SaveError", error->errmess);
return false;
}
@@ -875,8 +864,7 @@ bool ro_gui_save_content(hlcache_handle *h, char *path, bool force_overwrite)
(byte *) source_data,
(byte *) source_data + source_size);
if (error) {
- LOG(("xosfile_save_stamped: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfile_save_stamped: 0x%x: %s", error->errnum, error->errmess);
warn_user("SaveError", error->errmess);
return false;
}
@@ -902,16 +890,14 @@ bool ro_gui_save_content(hlcache_handle *h, char *path, bool force_overwrite)
return false;
error = xosfile_set_type(path, 0xfaf);
if (error)
- LOG(("xosfile_set_type: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfile_set_type: 0x%x: %s", error->errnum, error->errmess);
break;
case GUI_SAVE_HISTORY_EXPORT_HTML:
if (global_history_export(path, NULL) != NSERROR_OK)
return false;
error = xosfile_set_type(path, 0xfaf);
if (error)
- LOG(("xosfile_set_type: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfile_set_type: 0x%x: %s", error->errnum, error->errmess);
break;
case GUI_SAVE_TEXT_SELECTION:
@@ -931,8 +917,7 @@ bool ro_gui_save_content(hlcache_handle *h, char *path, bool force_overwrite)
return ro_gui_save_clipboard(path);
default:
- LOG(("Unexpected content type: %d, path %s",
- gui_save_current_type, path));
+ LOG("Unexpected content type: %d, path %s", gui_save_current_type, path);
return false;
}
return true;
@@ -955,8 +940,7 @@ void ro_gui_save_done(void)
error = xwimp_send_message(wimp_USER_MESSAGE, message,
message->sender);
if (error) {
- LOG(("xwimp_send_message: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_send_message: 0x%x: %s", error->errnum, error->errmess);
warn_user("SaveError", error->errmess);
}
}
@@ -996,8 +980,7 @@ void ro_gui_save_done(void)
ro_gui_dialog_close(dialog_saveas);
error = xwimp_create_menu(wimp_CLOSE_MENU, 0, 0);
if (error) {
- LOG(("xwimp_create_menu: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_create_menu: 0x%x: %s", error->errnum, error->errmess);
warn_user("MenuError", error->errmess);
}
}
@@ -1014,8 +997,7 @@ static void ro_gui_save_set_file_type(const char *path, lwc_string *mime_type)
error = xosfile_set_type(path, rotype);
if (error != NULL) {
- LOG(("xosfile_set_type: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfile_set_type: 0x%x: %s", error->errnum, error->errmess);
}
}
@@ -1042,8 +1024,7 @@ bool ro_gui_save_complete(hlcache_handle *h, char *path)
/* Create dir */
error = xosfile_create_dir(path, 0);
if (error) {
- LOG(("xosfile_create_dir: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfile_create_dir: 0x%x: %s", error->errnum, error->errmess);
warn_user("SaveError", error->errmess);
return false;
}
@@ -1052,7 +1033,7 @@ bool ro_gui_save_complete(hlcache_handle *h, char *path)
snprintf(buf, sizeof buf, "%s.!Run", path);
fp = fopen(buf, "w");
if (!fp) {
- LOG(("fopen(): errno = %i", errno));
+ LOG("fopen(): errno = %i", errno);
warn_user("SaveError", strerror(errno));
return false;
}
@@ -1061,8 +1042,7 @@ bool ro_gui_save_complete(hlcache_handle *h, char *path)
fclose(fp);
error = xosfile_set_type(buf, 0xfeb);
if (error) {
- LOG(("xosfile_set_type: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfile_set_type: 0x%x: %s", error->errnum, error->errmess);
warn_user("SaveError", error->errmess);
return false;
}
@@ -1071,7 +1051,7 @@ bool ro_gui_save_complete(hlcache_handle *h, char *path)
snprintf(buf, sizeof buf, "%s.!RunImage", path);
fp = fopen(buf, "w");
if (!fp) {
- LOG(("Creating !RunImage failed: errno = %i", errno));
+ LOG("Creating !RunImage failed: errno = %i", errno);
} else {
fclose(fp);
}
@@ -1097,8 +1077,7 @@ bool ro_gui_save_complete(hlcache_handle *h, char *path)
error = xosspriteop_save_sprite_file(osspriteop_NAME, saveas_area, buf);
if (error) {
- LOG(("xosspriteop_save_sprite_file: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosspriteop_save_sprite_file: 0x%x: %s", error->errnum, error->errmess);
warn_user("SaveError", error->errmess);
return false;
}
@@ -1130,8 +1109,7 @@ bool ro_gui_save_object_native(hlcache_handle *h, char *path)
(byte *) source_data,
(byte *) source_data + source_size);
if (error != NULL) {
- LOG(("xosfile_save_stamped: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfile_save_stamped: 0x%x: %s", error->errnum, error->errmess);
warn_user("SaveError", error->errmess);
return false;
}
@@ -1330,8 +1308,7 @@ void ro_gui_save_set_state(hlcache_handle *h, gui_save_type save_type,
}
if (error) {
- LOG(("ro_gui_wimp_get_sprite: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("ro_gui_wimp_get_sprite: 0x%x: %s", error->errnum, error->errmess);
warn_user("MiscError", error->errmess);
} else {
/* the sprite area should always be large enough for
@@ -1370,14 +1347,14 @@ bool ro_gui_save_create_thumbnail(hlcache_handle *h, const char *name)
bitmap = riscos_bitmap_create(34, 34, BITMAP_NEW | BITMAP_OPAQUE | BITMAP_CLEAR_MEMORY);
if (!bitmap) {
- LOG(("Thumbnail initialisation failed."));
+ LOG("Thumbnail initialisation failed.");
return false;
}
riscos_bitmap_render(bitmap, h);
area = riscos_bitmap_convert_8bpp(bitmap);
riscos_bitmap_destroy(bitmap);
if (!area) {
- LOG(("Thumbnail conversion failed."));
+ LOG("Thumbnail conversion failed.");
return false;
}
diff --git a/riscos/save_draw.c b/riscos/save_draw.c
index bf81bca10..8b8d72cd6 100644
--- a/riscos/save_draw.c
+++ b/riscos/save_draw.c
@@ -142,8 +142,7 @@ bool save_as_draw(hlcache_handle *h, const char *path)
(byte *) drawfile_buffer,
(byte *) drawfile_buffer + drawfile_size);
if (error) {
- LOG(("xosfile_save_stamped failed: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfile_save_stamped failed: 0x%x: %s", error->errnum, error->errmess);
warn_user("SaveError", error->errmess);
pencil_free(ro_save_draw_diagram);
return false;
@@ -271,13 +270,13 @@ bool ro_save_draw_path(const float *p, unsigned int n, colour fill,
return true;
if (p[0] != PLOTTER_PATH_MOVE) {
- LOG(("path doesn't start with a move"));
+ LOG("path doesn't start with a move");
return false;
}
int *path = malloc(sizeof *path * (n + 10));
if (!path) {
- LOG(("out of memory"));
+ LOG("out of memory");
return false;
}
@@ -329,7 +328,7 @@ bool ro_save_draw_path(const float *p, unsigned int n, colour fill,
i += 7;
empty_path = false;
} else {
- LOG(("bad path command %f", p[i]));
+ LOG("bad path command %f", p[i]);
free(path);
return false;
}
@@ -450,7 +449,7 @@ bool ro_save_draw_group_end(void)
bool ro_save_draw_error(pencil_code code)
{
- LOG(("code %i", code));
+ LOG("code %i", code);
switch (code) {
case pencil_OK:
diff --git a/riscos/schedule.c b/riscos/schedule.c
index 59cb97d9b..54308b7a9 100644
--- a/riscos/schedule.c
+++ b/riscos/schedule.c
@@ -108,7 +108,7 @@ nserror riscos_schedule(int t, void (*callback)(void *p), void *p)
entry = malloc(sizeof *entry);
if (!entry) {
- LOG(("malloc failed"));
+ LOG("malloc failed");
return NSERROR_NOMEM;
}
diff --git a/riscos/sslcert.c b/riscos/sslcert.c
index d8d94a32c..5812dff12 100644
--- a/riscos/sslcert.c
+++ b/riscos/sslcert.c
@@ -122,7 +122,7 @@ void gui_cert_verify(nsurl *url,
sslcert_window = malloc(sizeof(struct ro_sslcert));
if (sslcert_window == NULL) {
- LOG(("Failed to allocate memory for SSL Cert Dialog"));
+ LOG("Failed to allocate memory for SSL Cert Dialog");
return;
}
@@ -131,8 +131,7 @@ void gui_cert_verify(nsurl *url,
error = xwimp_create_window(ro_gui_cert_dialog_template,
&(sslcert_window->window));
if (error) {
- LOG(("xwimp_create_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_create_window: 0x%x: %s", error->errnum, error->errmess);
free(sslcert_window);
return;
}
@@ -140,8 +139,7 @@ void gui_cert_verify(nsurl *url,
error = xwimp_create_window(ro_gui_cert_tree_template,
&(sslcert_window->pane));
if (error) {
- LOG(("xwimp_create_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_create_window: 0x%x: %s", error->errnum, error->errmess);
free(sslcert_window);
return;
}
@@ -154,7 +152,7 @@ void gui_cert_verify(nsurl *url,
sslcert_window->tv = ro_treeview_create(sslcert_window->pane,
NULL, NULL, TREE_SSLCERT);
if (sslcert_window->tv == NULL) {
- LOG(("Failed to allocate treeview"));
+ LOG("Failed to allocate treeview");
free(sslcert_window);
return;
}
@@ -189,8 +187,7 @@ void gui_cert_verify(nsurl *url,
error = xwimp_get_window_info_header_only(&info);
if (error) {
ro_gui_cert_release_window(sslcert_window);
- LOG(("xwimp_get_window_info: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_info: 0x%x: %s", error->errnum, error->errmess);
return;
}
@@ -198,8 +195,7 @@ void gui_cert_verify(nsurl *url,
error = xwimp_get_window_state(&state);
if (error) {
ro_gui_cert_release_window(sslcert_window);
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
return;
}
@@ -208,8 +204,7 @@ void gui_cert_verify(nsurl *url,
error = xwimp_get_icon_state(&istate);
if (error) {
ro_gui_cert_release_window(sslcert_window);
- LOG(("xwimp_get_icon_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess);
return;
}
@@ -240,8 +235,7 @@ void gui_cert_verify(nsurl *url,
error = xwimp_set_extent(sslcert_window->pane, &(info.extent));
if (error) {
ro_gui_cert_release_window(sslcert_window);
- LOG(("xwimp_set_extent: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_set_extent: 0x%x: %s", error->errnum, error->errmess);
return;
}
}
@@ -258,8 +252,7 @@ void gui_cert_verify(nsurl *url,
<< wimp_CHILD_RS_EDGE_SHIFT);
if (error) {
ro_gui_cert_release_window(sslcert_window);
- LOG(("xwimp_open_window_nested: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_open_window_nested: 0x%x: %s", error->errnum, error->errmess);
ro_gui_cert_release_window(sslcert_window);
return;
}
@@ -335,21 +328,19 @@ void ro_gui_cert_release_window(struct ro_sslcert *s)
if (s == NULL)
return;
- LOG(("Releasing SSL data: 0x%x", (unsigned) s));
+ LOG("Releasing SSL data: 0x%x", (unsigned)s);
ro_gui_wimp_event_finalise(s->window);
ro_treeview_destroy(s->tv);
error = xwimp_delete_window(s->window);
if (error) {
- LOG(("xwimp_delete_window: 0x%x:%s",
- error->errnum, error->errmess));
+ LOG("xwimp_delete_window: 0x%x:%s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
error = xwimp_delete_window(s->pane);
if (error) {
- LOG(("xwimp_delete_window: 0x%x:%s",
- error->errnum, error->errmess));
+ LOG("xwimp_delete_window: 0x%x:%s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
diff --git a/riscos/textarea.c b/riscos/textarea.c
index bec6711b9..ecf3e0c3d 100644
--- a/riscos/textarea.c
+++ b/riscos/textarea.c
@@ -139,7 +139,7 @@ uintptr_t ro_textarea_create(wimp_w parent, wimp_i icon, unsigned int flags,
ret = malloc(sizeof(struct text_area));
if (!ret) {
- LOG(("malloc failed"));
+ LOG("malloc failed");
return 0;
}
@@ -149,7 +149,7 @@ uintptr_t ro_textarea_create(wimp_w parent, wimp_i icon, unsigned int flags,
ret->flags = flags;
ret->text = malloc(64);
if (!ret->text) {
- LOG(("malloc failed"));
+ LOG("malloc failed");
free(ret);
return 0;
}
@@ -161,7 +161,7 @@ uintptr_t ro_textarea_create(wimp_w parent, wimp_i icon, unsigned int flags,
// ret->selection_end = (unsigned int)-1;
ret->font_family = strdup(font_family ? font_family : "Corpus");
if (!ret->font_family) {
- LOG(("strdup failed"));
+ LOG("strdup failed");
free(ret->text);
free(ret);
return 0;
@@ -182,8 +182,7 @@ uintptr_t ro_textarea_create(wimp_w parent, wimp_i icon, unsigned int flags,
text_area_definition.title_fg = wimp_COLOUR_BLACK;
error = xwimp_create_window(&text_area_definition, &ret->window);
if (error) {
- LOG(("xwimp_create_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_create_window: 0x%x: %s", error->errnum, error->errmess);
free(ret->font_family);
free(ret->text);
free(ret);
@@ -230,8 +229,7 @@ bool ro_textarea_update(uintptr_t self)
state.w = ta->parent;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
return false;
}
@@ -239,8 +237,7 @@ bool ro_textarea_update(uintptr_t self)
istate.i = ta->icon;
error = xwimp_get_icon_state(&istate);
if (error) {
- LOG(("xwimp_get_icon_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess);
return false;
}
@@ -271,8 +268,7 @@ bool ro_textarea_update(uintptr_t self)
error = xwimp_set_extent(ta->window, &extent);
if (error) {
- LOG(("xwimp_set_extent: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_set_extent: 0x%x: %s", error->errnum, error->errmess);
return false;
}
@@ -287,8 +283,7 @@ bool ro_textarea_update(uintptr_t self)
wimp_CHILD_LINKS_PARENT_VISIBLE_BOTTOM_OR_LEFT
<< wimp_CHILD_RS_EDGE_SHIFT);
if (error) {
- LOG(("xwimp_open_window_nested: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_open_window_nested: 0x%x: %s", error->errnum, error->errmess);
return false;
}
@@ -313,8 +308,7 @@ void ro_textarea_destroy(uintptr_t self)
error = xwimp_delete_window(ta->window);
if (error) {
- LOG(("xwimp_delete_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_delete_window: 0x%x: %s", error->errnum, error->errmess);
}
ro_gui_wimp_event_finalise(ta->window);
@@ -338,14 +332,14 @@ bool ro_textarea_set_text(uintptr_t self, const char *text)
ta = (struct text_area *)self;
if (!ta || ta->magic != MAGIC) {
- LOG(("magic doesn't match"));
+ LOG("magic doesn't match");
return true;
}
if (len >= ta->text_alloc) {
char *temp = realloc(ta->text, len + 64);
if (!temp) {
- LOG(("realloc failed"));
+ LOG("realloc failed");
return false;
}
ta->text = temp;
@@ -375,7 +369,7 @@ int ro_textarea_get_text(uintptr_t self, char *buf, unsigned int len)
ta = (struct text_area *)self;
if (!ta || ta->magic != MAGIC) {
- LOG(("magic doesn't match"));
+ LOG("magic doesn't match");
return -1;
}
@@ -385,7 +379,7 @@ int ro_textarea_get_text(uintptr_t self, char *buf, unsigned int len)
}
if (len < ta->text_len) {
- LOG(("buffer too small"));
+ LOG("buffer too small");
return -1;
}
@@ -410,7 +404,7 @@ void ro_textarea_insert_text(uintptr_t self, unsigned int index,
ta = (struct text_area *)self;
if (!ta || ta->magic != MAGIC) {
- LOG(("magic doesn't match"));
+ LOG("magic doesn't match");
return;
}
@@ -427,7 +421,7 @@ void ro_textarea_insert_text(uintptr_t self, unsigned int index,
if (b_len + ta->text_len >= ta->text_alloc) {
char *temp = realloc(ta->text, b_len + ta->text_len + 64);
if (!temp) {
- LOG(("realloc failed"));
+ LOG("realloc failed");
return;
}
@@ -464,7 +458,7 @@ void ro_textarea_replace_text(uintptr_t self, unsigned int start,
ta = (struct text_area *)self;
if (!ta || ta->magic != MAGIC) {
- LOG(("magic doesn't match"));
+ LOG("magic doesn't match");
return;
}
@@ -498,7 +492,7 @@ void ro_textarea_replace_text(uintptr_t self, unsigned int start,
char *temp = realloc(ta->text,
b_len + ta->text_len - (b_end - b_start) + 64);
if (!temp) {
- LOG(("realloc failed"));
+ LOG("realloc failed");
return;
}
@@ -539,7 +533,7 @@ void ro_textarea_set_caret(uintptr_t self, unsigned int caret)
ta = (struct text_area *)self;
if (!ta || ta->magic != MAGIC) {
- LOG(("magic doesn't match"));
+ LOG("magic doesn't match");
return;
}
@@ -581,11 +575,9 @@ void ro_textarea_set_caret(uintptr_t self, unsigned int caret)
b_off - ta->lines[ta->caret_pos.line].b_start, &x);
if (code != rufl_OK) {
if (code == rufl_FONT_MANAGER_ERROR)
- LOG(("rufl_width: 0x%x: %s",
- rufl_fm_error->errnum,
- rufl_fm_error->errmess));
+ LOG("rufl_width: 0x%x: %s", rufl_fm_error->errnum, rufl_fm_error->errmess);
else
- LOG(("rufl_width: 0x%x", code));
+ LOG("rufl_width: 0x%x", code);
return;
}
@@ -594,8 +586,7 @@ void ro_textarea_set_caret(uintptr_t self, unsigned int caret)
ta->line_height / 4 + ta->line_spacing,
os_line_height.y, -1);
if (error) {
- LOG(("xwimp_set_caret_position: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_set_caret_position: 0x%x: %s", error->errnum, error->errmess);
return;
}
}
@@ -619,7 +610,7 @@ void ro_textarea_set_caret_xy(uintptr_t self, int x, int y)
ta = (struct text_area *)self;
if (!ta || ta->magic != MAGIC) {
- LOG(("magic doesn't match"));
+ LOG("magic doesn't match");
return;
}
@@ -633,8 +624,7 @@ void ro_textarea_set_caret_xy(uintptr_t self, int x, int y)
state.w = ta->window;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
return;
}
@@ -655,11 +645,9 @@ void ro_textarea_set_caret_xy(uintptr_t self, int x, int y)
x, &b_off, &x);
if (code != rufl_OK) {
if (code == rufl_FONT_MANAGER_ERROR)
- LOG(("rufl_x_to_offset: 0x%x: %s",
- rufl_fm_error->errnum,
- rufl_fm_error->errmess));
+ LOG("rufl_x_to_offset: 0x%x: %s", rufl_fm_error->errnum, rufl_fm_error->errmess);
else
- LOG(("rufl_x_to_offset: 0x%x", code));
+ LOG("rufl_x_to_offset: 0x%x", code);
return;
}
@@ -683,7 +671,7 @@ unsigned int ro_textarea_get_caret(uintptr_t self)
ta = (struct text_area *)self;
if (!ta || ta->magic != MAGIC) {
- LOG(("magic doesn't match"));
+ LOG("magic doesn't match");
return -1;
}
@@ -724,7 +712,7 @@ void ro_textarea_reflow(struct text_area *ta, unsigned int line)
ta->lines =
malloc(LINE_CHUNK_SIZE * sizeof(struct line_info));
if (!ta->lines) {
- LOG(("malloc failed"));
+ LOG("malloc failed");
return;
}
}
@@ -747,11 +735,9 @@ void ro_textarea_reflow(struct text_area *ta, unsigned int line)
&b_off, &x);
if (code != rufl_OK) {
if (code == rufl_FONT_MANAGER_ERROR)
- LOG(("rufl_x_to_offset: 0x%x: %s",
- rufl_fm_error->errnum,
- rufl_fm_error->errmess));
+ LOG("rufl_x_to_offset: 0x%x: %s", rufl_fm_error->errnum, rufl_fm_error->errmess);
else
- LOG(("rufl_x_to_offset: 0x%x", code));
+ LOG("rufl_x_to_offset: 0x%x", code);
return;
}
@@ -760,7 +746,7 @@ void ro_textarea_reflow(struct text_area *ta, unsigned int line)
(line_count + LINE_CHUNK_SIZE) *
sizeof(struct line_info));
if (!temp) {
- LOG(("realloc failed"));
+ LOG("realloc failed");
return;
}
@@ -824,8 +810,7 @@ void ro_textarea_reflow(struct text_area *ta, unsigned int line)
error = xwimp_set_extent(ta->window, &extent);
if (error) {
- LOG(("xwimp_set_extent: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_set_extent: 0x%x: %s", error->errnum, error->errmess);
return;
}
@@ -842,8 +827,7 @@ void ro_textarea_reflow(struct text_area *ta, unsigned int line)
error = xwimp_get_window_state_and_nesting(&state,
&parent, &linkage);
if (error) {
- LOG(("xwimp_get_window_state_and_nesting: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state_and_nesting: 0x%x: %s", error->errnum, error->errmess);
return;
}
@@ -856,8 +840,7 @@ void ro_textarea_reflow(struct text_area *ta, unsigned int line)
state.w = ta->window;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
return;
}
@@ -871,8 +854,7 @@ void ro_textarea_reflow(struct text_area *ta, unsigned int line)
error = xwimp_open_window_nested(PTR_WIMP_OPEN(&state),
parent, linkage);
if (error) {
- LOG(("xwimp_open_window_nested: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_open_window_nested: 0x%x: %s", error->errnum, error->errmess);
return;
}
@@ -1028,8 +1010,7 @@ bool ro_textarea_key_press(wimp_key *key)
(wimp_message*)&keypress, ta->parent,
ta->icon, 0);
if (error) {
- LOG(("xwimp_send_message: 0x%x:%s",
- error->errnum, error->errmess));
+ LOG("xwimp_send_message: 0x%x:%s", error->errnum, error->errmess);
}
break;
}
@@ -1080,8 +1061,7 @@ void ro_textarea_redraw_internal(wimp_draw *redraw, bool update)
else
error = xwimp_redraw_window(redraw, &more);
if (error) {
- LOG(("xwimp_redraw_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_redraw_window: 0x%x: %s", error->errnum, error->errmess);
return;
}
@@ -1097,15 +1077,13 @@ void ro_textarea_redraw_internal(wimp_draw *redraw, bool update)
colourtrans_SET_BG_GCOL | colourtrans_USE_ECFS_GCOL,
os_ACTION_OVERWRITE, 0, 0);
if (error) {
- LOG(("xcolourtrans_set_gcol: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xcolourtrans_set_gcol: 0x%x: %s", error->errnum, error->errmess);
return;
}
error = xos_clg();
if (error) {
- LOG(("xos_clg: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xos_clg: 0x%x: %s", error->errnum, error->errmess);
return;
}
@@ -1136,8 +1114,7 @@ void ro_textarea_redraw_internal(wimp_draw *redraw, bool update)
0xD9D9D900 : 0xFFFFFF00,
0x00000000, 14, 0, 0, 0);
if (error) {
- LOG(("xcolourtrans_set_font_colours: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xcolourtrans_set_font_colours: 0x%x: %s", error->errnum, error->errmess);
return;
}
@@ -1152,18 +1129,15 @@ void ro_textarea_redraw_internal(wimp_draw *redraw, bool update)
rufl_BLEND_FONT);
if (code != rufl_OK) {
if (code == rufl_FONT_MANAGER_ERROR)
- LOG(("rufl_paint: rufl_FONT_MANAGER_ERROR: 0x%x: %s",
- rufl_fm_error->errnum,
- rufl_fm_error->errmess));
+ LOG("rufl_paint: rufl_FONT_MANAGER_ERROR: 0x%x: %s", rufl_fm_error->errnum, rufl_fm_error->errmess);
else
- LOG(("rufl_paint: 0x%x", code));
+ LOG("rufl_paint: 0x%x", code);
}
}
error = xwimp_get_rectangle(redraw, &more);
if (error) {
- LOG(("xwimp_get_rectangle: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_rectangle: 0x%x: %s", error->errnum, error->errmess);
return;
}
}
@@ -1180,8 +1154,7 @@ void ro_textarea_open(wimp_open *open)
error = xwimp_open_window(open);
if (error) {
- LOG(("xwimp_open_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess);
return;
}
}
diff --git a/riscos/textselection.c b/riscos/textselection.c
index 1222bb490..2ee7a6949 100644
--- a/riscos/textselection.c
+++ b/riscos/textselection.c
@@ -91,13 +91,12 @@ void gui_start_selection(struct gui_window *g)
wimp_drag drag;
os_error *error;
- LOG(("starting text_selection drag"));
+ LOG("starting text_selection drag");
state.w = g->window;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -111,8 +110,7 @@ void gui_start_selection(struct gui_window *g)
error = xwimp_send_message(wimp_USER_MESSAGE,
(wimp_message*)&msg, wimp_BROADCAST);
if (error) {
- LOG(("xwimp_send_message: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_send_message: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
owns_caret_and_selection = true;
@@ -128,8 +126,7 @@ void gui_start_selection(struct gui_window *g)
wimp_AUTO_SCROLL_ENABLE_HORIZONTAL,
&scroll, 0);
if (error)
- LOG(("xwimp_auto_scroll: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_auto_scroll: 0x%x: %s", error->errnum, error->errmess);
ro_mouse_drag_start(ro_gui_selection_drag_end, ro_gui_window_mouse_at,
NULL, g);
@@ -143,8 +140,7 @@ void gui_start_selection(struct gui_window *g)
error = xwimp_drag_box(&drag);
if (error) {
- LOG(("xwimp_drag_box: 0x%x : %s",
- error->errnum, error->errmess));
+ LOG("xwimp_drag_box: 0x%x : %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
last_start_window = g;
@@ -169,20 +165,17 @@ static void ro_gui_selection_drag_end(wimp_dragged *drag, void *data)
scroll.w = g->window;
error = xwimp_auto_scroll(0, &scroll, 0);
if (error)
- LOG(("xwimp_auto_scroll: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_auto_scroll: 0x%x: %s", error->errnum, error->errmess);
error = xwimp_drag_box((wimp_drag*)-1);
if (error) {
- LOG(("xwimp_drag_box: 0x%x : %s",
- error->errnum, error->errmess));
+ LOG("xwimp_drag_box: 0x%x : %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
error = xwimp_get_pointer_info(&pointer);
if (error) {
- LOG(("xwimp_get_pointer_info 0x%x : %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_pointer_info 0x%x : %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -223,7 +216,7 @@ static void gui_set_clipboard(const char *buffer, size_t length,
wimp_full_message_claim_entity msg;
os_error *error;
- LOG(("claiming clipboard"));
+ LOG("claiming clipboard");
msg.size = sizeof(msg);
msg.your_ref = 0;
@@ -233,14 +226,13 @@ static void gui_set_clipboard(const char *buffer, size_t length,
error = xwimp_send_message(wimp_USER_MESSAGE,
(wimp_message*)&msg, wimp_BROADCAST);
if (error) {
- LOG(("xwimp_send_message: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_send_message: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
owns_clipboard = true;
}
- LOG(("clipboard now holds %zd bytes", clip_length));
+ LOG("clipboard now holds %zd bytes", clip_length);
}
@@ -448,7 +440,7 @@ void ro_gui_selection_claim_entity(wimp_full_message_claim_entity *claim)
/* ignore our own broadcasts! */
if (claim->sender != task_handle) {
- LOG(("%x", claim->flags));
+ LOG("%x", claim->flags);
if (claim->flags & wimp_CLAIM_CARET_OR_SELECTION) {
owns_caret_and_selection = false;
@@ -531,8 +523,7 @@ bool ro_gui_save_clipboard(const char *path)
free(local_cb);
if (error) {
- LOG(("xosfile_save_stamped: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfile_save_stamped: 0x%x: %s", error->errnum, error->errmess);
warn_user("SaveError", error->errmess);
return false;
}
@@ -614,7 +605,7 @@ void ro_gui_selection_send_dragging(wimp_pointer *pointer)
{
wimp_full_message_dragging dragmsg;
- LOG(("sending DRAGGING to %p, %d", pointer->w, pointer->i));
+ LOG("sending DRAGGING to %p, %d", pointer->w, pointer->i);
dragmsg.size = offsetof(wimp_full_message_dragging, file_types) + 8;
dragmsg.your_ref = 0;
diff --git a/riscos/theme.c b/riscos/theme.c
index 40c374704..592fa0a7c 100644
--- a/riscos/theme.c
+++ b/riscos/theme.c
@@ -366,7 +366,7 @@ bool ro_gui_theme_add_descriptor(const char *folder, const char *leafname)
/* create a full filename */
filename = malloc(strlen(folder) + strlen(leafname) + 2);
if (!filename) {
- LOG(("No memory for malloc"));
+ LOG("No memory for malloc");
warn_user("NoMemory", 0);
return false;
}
@@ -376,8 +376,7 @@ bool ro_gui_theme_add_descriptor(const char *folder, const char *leafname)
error = xosfind_openinw(osfind_NO_PATH, filename, 0,
&file_handle);
if (error) {
- LOG(("xosfind_openinw: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfind_openinw: 0x%x: %s", error->errnum, error->errmess);
warn_user("FileError", error->errmess);
free(filename);
return false;
@@ -392,8 +391,7 @@ bool ro_gui_theme_add_descriptor(const char *folder, const char *leafname)
0, &output_left);
xosfind_closew(file_handle);
if (error) {
- LOG(("xosbgpb_read_atw: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosbgpb_read_atw: 0x%x: %s", error->errnum, error->errmess);
warn_user("FileError", error->errmess);
free(filename);
return false;
@@ -407,7 +405,7 @@ bool ro_gui_theme_add_descriptor(const char *folder, const char *leafname)
current = (struct theme_descriptor *)calloc(1,
sizeof(struct theme_descriptor));
if (!current) {
- LOG(("calloc failed"));
+ LOG("calloc failed");
warn_user("NoMemory", 0);
free(filename);
return false;
@@ -525,7 +523,7 @@ bool ro_gui_theme_open(struct theme_descriptor *descriptor, bool list)
descriptor->theme = (struct theme *)calloc(1,
sizeof(struct theme));
if (!descriptor->theme) {
- LOG(("calloc() failed"));
+ LOG("calloc() failed");
warn_user("NoMemory", 0);
continue;
}
@@ -535,8 +533,7 @@ bool ro_gui_theme_open(struct theme_descriptor *descriptor, bool list)
error = xosfile_read_stamped_no_path(descriptor->filename,
&obj_type, 0, 0, &file_size, 0, 0);
if (error) {
- LOG(("xosfile_read_stamped_no_path: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfile_read_stamped_no_path: 0x%x: %s", error->errnum, error->errmess);
warn_user("FileError", error->errmess);
continue;
}
@@ -544,7 +541,7 @@ bool ro_gui_theme_open(struct theme_descriptor *descriptor, bool list)
continue;
raw_data = malloc(file_size);
if (!raw_data) {
- LOG(("malloc() failed"));
+ LOG("malloc() failed");
warn_user("NoMemory", 0);
continue;
}
@@ -552,8 +549,7 @@ bool ro_gui_theme_open(struct theme_descriptor *descriptor, bool list)
(byte *)raw_data, 0, 0, 0, 0, 0);
if (error) {
free(raw_data);
- LOG(("xosfile_load_stamped_no_path: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfile_load_stamped_no_path: 0x%x: %s", error->errnum, error->errmess);
warn_user("FileError", error->errmess);
continue;
}
@@ -562,8 +558,7 @@ bool ro_gui_theme_open(struct theme_descriptor *descriptor, bool list)
error = xsquash_decompress_return_sizes(-1, &workspace_size, 0);
if (error) {
free(raw_data);
- LOG(("xsquash_decompress_return_sizes: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xsquash_decompress_return_sizes: 0x%x: %s", error->errnum, error->errmess);
warn_user("MiscError", error->errmess);
continue;
}
@@ -573,7 +568,7 @@ bool ro_gui_theme_open(struct theme_descriptor *descriptor, bool list)
if ((!decompressed) || (!workspace)) {
free(decompressed);
free(raw_data);
- LOG(("malloc() failed"));
+ LOG("malloc() failed");
warn_user("NoMemory", 0);
continue;
}
@@ -588,8 +583,7 @@ bool ro_gui_theme_open(struct theme_descriptor *descriptor, bool list)
free(raw_data);
if (error) {
free(decompressed);
- LOG(("xsquash_decompress: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xsquash_decompress: 0x%x: %s", error->errnum, error->errmess);
warn_user("MiscError", error->errmess);
continue;
}
@@ -607,8 +601,7 @@ bool ro_gui_theme_open(struct theme_descriptor *descriptor, bool list)
descriptor->theme->sprite_area,
sprite_name, 16, i, 0);
if (error) {
- LOG(("xosspriteop_return_name: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosspriteop_return_name: 0x%x: %s", error->errnum, error->errmess);
warn_user("MiscError", error->errmess);
continue;
}
@@ -623,8 +616,7 @@ bool ro_gui_theme_open(struct theme_descriptor *descriptor, bool list)
&dimensions.x, &dimensions.y,
(osbool *) 0, &mode);
if (error) {
- LOG(("xosspriteop_read_sprite_info: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosspriteop_read_sprite_info: 0x%x: %s", error->errnum, error->errmess);
warn_user("MiscError", error->errmess);
continue;
}
diff --git a/riscos/theme_install.c b/riscos/theme_install.c
index c161943ba..5270bd3c2 100644
--- a/riscos/theme_install.c
+++ b/riscos/theme_install.c
@@ -184,7 +184,7 @@ bool ro_gui_theme_install_apply(wimp_w w)
/* convert spaces to hard spaces */
theme_file = strdup(theme_install_descriptor.name);
if (!theme_file) {
- LOG(("malloc failed"));
+ LOG("malloc failed");
warn_user("NoMemory", 0);
return false;
}
@@ -205,8 +205,7 @@ bool ro_gui_theme_install_apply(wimp_w w)
(byte *) source_data,
(byte *) source_data + source_size);
if (error) {
- LOG(("xosfile_save_stamped: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfile_save_stamped: 0x%x: %s", error->errnum, error->errmess);
warn_user("ThemeInstallErr", 0);
free(theme_file);
return false;
diff --git a/riscos/toolbar.c b/riscos/toolbar.c
index 757513c88..b6e1d917e 100644
--- a/riscos/toolbar.c
+++ b/riscos/toolbar.c
@@ -231,7 +231,7 @@ struct toolbar *ro_toolbar_create(struct theme_descriptor *descriptor,
toolbar = calloc(sizeof(struct toolbar), 1);
if (toolbar == NULL) {
- LOG(("No memory for malloc()"));
+ LOG("No memory for malloc()");
warn_user("NoMemory", 0);
return NULL;
}
@@ -370,8 +370,7 @@ bool ro_toolbar_rebuild(struct toolbar *toolbar)
old_window = toolbar->toolbar_handle;
error = xwimp_delete_window(toolbar->toolbar_handle);
if (error)
- LOG(("xwimp_delete_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_delete_window: 0x%x: %s", error->errnum, error->errmess);
toolbar->toolbar_handle = NULL;
}
@@ -380,8 +379,7 @@ bool ro_toolbar_rebuild(struct toolbar *toolbar)
error = xwimp_create_window(&ro_toolbar_window,
&toolbar->toolbar_handle);
if (error) {
- LOG(("xwimp_create_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_create_window: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
@@ -499,8 +497,7 @@ bool ro_toolbar_rebuild(struct toolbar *toolbar)
icon.icon.data.indirected_text.size = 1;
error = xwimp_create_icon(&icon, &toolbar->editor_div1);
if (error) {
- LOG(("xwimp_create_icon: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_create_icon: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
toolbar->editor_div1 = -1;
}
@@ -565,8 +562,7 @@ bool ro_toolbar_attach(struct toolbar *toolbar, wimp_w parent)
wimp_CHILD_LINKS_PARENT_VISIBLE_TOP_OR_RIGHT
<< wimp_CHILD_TS_EDGE_SHIFT);
if (error) {
- LOG(("xwimp_open_window_nested: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_open_window_nested: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
@@ -576,8 +572,7 @@ bool ro_toolbar_attach(struct toolbar *toolbar, wimp_w parent)
error = xwimp_close_window(toolbar->toolbar_handle);
if (error) {
- LOG(("xwimp_close_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_close_window: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
@@ -610,8 +605,7 @@ bool ro_toolbar_process(struct toolbar *toolbar, int width, bool reformat)
outline.w = toolbar->parent_handle;
error = xwimp_get_window_outline(&outline);
if (error) {
- LOG(("xwimp_get_window_outline: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_outline: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
@@ -631,8 +625,7 @@ bool ro_toolbar_process(struct toolbar *toolbar, int width, bool reformat)
state.w = toolbar->parent_handle;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
@@ -658,8 +651,7 @@ bool ro_toolbar_process(struct toolbar *toolbar, int width, bool reformat)
error = xwimp_set_extent(toolbar->toolbar_handle,
&extent);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
@@ -947,7 +939,7 @@ void ro_toolbar_destroy(struct toolbar *toolbar)
if (toolbar == NULL)
return;
- LOG(("Destroying toolbar 0x%x", (unsigned int) toolbar));
+ LOG("Destroying toolbar 0x%x", (unsigned int)toolbar);
/* Destroy the widgets. */
@@ -1006,8 +998,7 @@ void ro_toolbar_redraw(wimp_draw *redraw)
error = xwimp_redraw_window(redraw, &more);
if (error) {
- LOG(("xwimp_redraw_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_redraw_window: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -1026,8 +1017,7 @@ void ro_toolbar_redraw(wimp_draw *redraw)
error = xwimp_get_rectangle(redraw, &more);
if (error) {
- LOG(("xwimp_get_rectangle: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_rectangle: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -1060,8 +1050,7 @@ bool ro_toolbar_click(wimp_pointer *pointer)
state.w = toolbar->toolbar_handle;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
@@ -1340,8 +1329,7 @@ const char *ro_toolbar_get_help_suffix(wimp_w w, wimp_i i, os_coord *pos,
state.w = toolbar->toolbar_handle;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return NULL;
}
diff --git a/riscos/treeview.c b/riscos/treeview.c
index 39c601413..aa86d209c 100644
--- a/riscos/treeview.c
+++ b/riscos/treeview.c
@@ -311,8 +311,7 @@ void ro_treeview_redraw_request(int x, int y, int width, int height,
error = xwimp_update_window(&update, &more);
if (error) {
- LOG(("xwimp_update_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_update_window: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -334,8 +333,7 @@ void ro_treeview_redraw(wimp_draw *redraw)
tv = (ro_treeview *) ro_gui_wimp_event_get_user_data(redraw->w);
if (tv == NULL) {
- LOG(("NULL treeview block for window: 0x%x",
- (unsigned int) redraw->w));
+ LOG("NULL treeview block for window: 0x%x", (unsigned int)redraw->w);
/* Don't return, as not servicing redraw events isn't a good
* idea. The following code must handle (tv == NULL)
* gracefully while clearing the redraw queue.
@@ -344,8 +342,7 @@ void ro_treeview_redraw(wimp_draw *redraw)
error = xwimp_redraw_window(redraw, &more);
if (error) {
- LOG(("xwimp_redraw_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_redraw_window: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -411,8 +408,7 @@ void ro_treeview_scroll(wimp_scroll *scroll)
error = xwimp_open_window((wimp_open *) scroll);
if (error) {
- LOG(("xwimp_open_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess);
}
}
@@ -460,8 +456,7 @@ void ro_treeview_redraw_loop(wimp_draw *redraw, ro_treeview *tv, osbool more)
error = xwimp_get_rectangle(redraw, &more);
if (error) {
- LOG(("xwimp_redraw_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_redraw_window: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -514,8 +509,7 @@ void ro_treeview_scroll_visible(int y, int height, void *pw)
state.w = tv->w;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -553,8 +547,7 @@ void ro_treeview_scroll_visible(int y, int height, void *pw)
error = xwimp_open_window((wimp_open *) &state);
if (error) {
- LOG(("xwimp_open_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -581,8 +574,7 @@ void ro_treeview_get_window_dimensions(int *width, int *height,
state.w = tv->w;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -624,8 +616,7 @@ void ro_treeview_set_window_extent(ro_treeview *tv, int width, int height)
state.w = tv->w;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -684,8 +675,7 @@ void ro_treeview_set_window_extent(ro_treeview *tv, int width, int height)
error = xwimp_open_window((wimp_open *) &state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -709,8 +699,7 @@ void ro_treeview_set_window_extent(ro_treeview *tv, int width, int height)
error = xwimp_set_extent(tv->w, &extent);
if (error) {
- LOG(("xwimp_set_extent: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_set_extent: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -735,8 +724,7 @@ static void ro_treeview_open(wimp_open *open)
tv = (ro_treeview *) ro_gui_wimp_event_get_user_data(open->w);
if (tv == NULL) {
- LOG(("NULL treeview block for window: ox%x",
- (unsigned int) open->w));
+ LOG("NULL treeview block for window: ox%x", (unsigned int)open->w);
return;
}
@@ -764,8 +752,7 @@ static void ro_treeview_open(wimp_open *open)
error = xwimp_set_extent(tv->w, &extent);
if (error) {
- LOG(("xwimp_set_extent: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_set_extent: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -778,8 +765,7 @@ static void ro_treeview_open(wimp_open *open)
error = xwimp_open_window(open);
if (error) {
- LOG(("xwimp_open_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
@@ -806,16 +792,14 @@ static bool ro_treeview_mouse_click(wimp_pointer *pointer)
tv = (ro_treeview *) ro_gui_wimp_event_get_user_data(pointer->w);
if (tv == NULL) {
- LOG(("NULL treeview block for window: 0x%x",
- (unsigned int) pointer->w));
+ LOG("NULL treeview block for window: 0x%x", (unsigned int)pointer->w);
return false;
}
state.w = tv->w;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
@@ -939,8 +923,7 @@ void ro_treeview_mouse_at(wimp_pointer *pointer, void *data)
tv = (ro_treeview *) ro_gui_wimp_event_get_user_data(pointer->w);
if (tv == NULL) {
- LOG(("NULL treeview block for window: 0x%x",
- (unsigned int) pointer->w));
+ LOG("NULL treeview block for window: 0x%x", (unsigned int)pointer->w);
return;
}
@@ -954,8 +937,7 @@ void ro_treeview_mouse_at(wimp_pointer *pointer, void *data)
state.w = tv->w;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -1034,13 +1016,12 @@ static void ro_treeview_drag_start(ro_treeview *tv, wimp_pointer *pointer,
break;
}
- LOG(("Drag start..."));
+ LOG("Drag start...");
error = xwimp_drag_box_with_flags(&drag,
wimp_DRAG_BOX_KEEP_IN_LINE | wimp_DRAG_BOX_CLIP);
if (error) {
- LOG(("xwimp_drag_box: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_drag_box: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
} else {
auto_scroll.w = tv->w;
@@ -1055,8 +1036,7 @@ static void ro_treeview_drag_start(ro_treeview *tv, wimp_pointer *pointer,
error = xwimp_auto_scroll(wimp_AUTO_SCROLL_ENABLE_VERTICAL,
&auto_scroll, NULL);
if (error) {
- LOG(("xwimp_auto_scroll: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_auto_scroll: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
@@ -1080,15 +1060,13 @@ static void ro_treeview_drag_end(wimp_dragged *drag, void *data)
error = xwimp_drag_box((wimp_drag *) -1);
if (error) {
- LOG(("xwimp_drag_box: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_drag_box: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
error = xwimp_auto_scroll(0, NULL, NULL);
if (error) {
- LOG(("xwimp_auto_scroll: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_auto_scroll: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
}
@@ -1108,8 +1086,7 @@ static bool ro_treeview_keypress(wimp_key *key)
tv = (ro_treeview *) ro_gui_wimp_event_get_user_data(key->w);
if (tv == NULL) {
- LOG(("NULL treeview block for window: 0x%x",
- (unsigned int) key->w));
+ LOG("NULL treeview block for window: 0x%x", (unsigned int)key->w);
return false;
}
diff --git a/riscos/ucstables.c b/riscos/ucstables.c
index e8bc25080..c881437ca 100644
--- a/riscos/ucstables.c
+++ b/riscos/ucstables.c
@@ -622,7 +622,7 @@ nserror utf8_from_local_encoding(const char *string, size_t len, char **result)
off - prev_off, &temp, NULL);
if (err != NSERROR_OK) {
assert(err != NSERROR_BAD_ENCODING);
- LOG(("utf8_from_enc failed"));
+ LOG("utf8_from_enc failed");
free(*result);
return NSERROR_NOMEM;
}
@@ -664,7 +664,7 @@ nserror utf8_from_local_encoding(const char *string, size_t len, char **result)
&temp, NULL);
if (err != NSERROR_OK) {
assert(err != NSERROR_BAD_ENCODING);
- LOG(("utf8_from_enc failed"));
+ LOG("utf8_from_enc failed");
free(*result);
return NSERROR_NOMEM;
}
@@ -679,7 +679,7 @@ nserror utf8_from_local_encoding(const char *string, size_t len, char **result)
/* and copy into more reasonably-sized buffer */
temp = realloc((*result), cur_off + 1);
if (!temp) {
- LOG(("realloc failed"));
+ LOG("realloc failed");
free(*result);
return NSERROR_NOMEM;
}
diff --git a/riscos/uri.c b/riscos/uri.c
index c065a9c62..2c45d75a9 100644
--- a/riscos/uri.c
+++ b/riscos/uri.c
@@ -116,7 +116,7 @@ void ro_uri_bounce(wimp_message *msg)
/* Get required buffer size */
e = xuri_request_uri(0, NULL, 0, message->handle, &size);
if (e) {
- LOG(("xuri_request_uri: %d: %s", e->errnum, e->errmess));
+ LOG("xuri_request_uri: %d: %s", e->errnum, e->errmess);
return;
}
@@ -127,7 +127,7 @@ void ro_uri_bounce(wimp_message *msg)
/* Get URI */
e = xuri_request_uri(0, uri_buf, size, message->handle, 0);
if (e) {
- LOG(("xuri_request_uri: %d: %s", e->errnum, e->errmess));
+ LOG("xuri_request_uri: %d: %s", e->errnum, e->errmess);
free(uri_buf);
return;
}
diff --git a/riscos/url_complete.c b/riscos/url_complete.c
index c4d689654..3d189a01d 100644
--- a/riscos/url_complete.c
+++ b/riscos/url_complete.c
@@ -168,8 +168,7 @@ bool ro_gui_url_complete_keypress(struct toolbar *toolbar, uint32_t key)
-(url_complete_matches_selection + 1) * 44,
65536, -url_complete_matches_selection * 44);
if (error) {
- LOG(("xwimp_force_redraw: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_force_redraw: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
@@ -208,8 +207,7 @@ bool ro_gui_url_complete_keypress(struct toolbar *toolbar, uint32_t key)
state.w = parent;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
@@ -227,9 +225,7 @@ bool ro_gui_url_complete_keypress(struct toolbar *toolbar, uint32_t key)
error = xwimp_force_redraw(dialog_url_complete,
0, -(i + 1) * 44, 65536, -i * 44);
if (error) {
- LOG(("xwimp_force_redraw: 0x%x: %s",
- error->errnum,
- error->errmess));
+ LOG("xwimp_force_redraw: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError",
error->errmess);
}
@@ -282,8 +278,7 @@ bool ro_gui_url_complete_keypress(struct toolbar *toolbar, uint32_t key)
0, -(old_selection + 1) * 44,
65536, -old_selection * 44);
if (error) {
- LOG(("xwimp_force_redraw: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_force_redraw: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
@@ -291,8 +286,7 @@ bool ro_gui_url_complete_keypress(struct toolbar *toolbar, uint32_t key)
0, -(url_complete_matches_selection + 1) * 44,
65536, -url_complete_matches_selection * 44);
if (error) {
- LOG(("xwimp_force_redraw: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_force_redraw: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
@@ -323,8 +317,7 @@ bool ro_gui_url_complete_keypress(struct toolbar *toolbar, uint32_t key)
state.w = dialog_url_complete;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return true;
}
@@ -339,8 +332,7 @@ bool ro_gui_url_complete_keypress(struct toolbar *toolbar, uint32_t key)
error = xwimp_open_window(PTR_WIMP_OPEN(&state));
if (error) {
- LOG(("xwimp_open_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return true;
}
@@ -416,8 +408,7 @@ void ro_gui_url_complete_resize(struct toolbar *toolbar, wimp_open *open)
state.w = dialog_url_complete;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -429,14 +420,13 @@ void ro_gui_url_complete_resize(struct toolbar *toolbar, wimp_open *open)
toolbar_state.w = ro_toolbar_get_window(toolbar);
error = xwimp_get_window_state(&toolbar_state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
if (!ro_toolbar_get_url_field_extent(toolbar, &url_extent)) {
- LOG(("Failed to read URL field extent."));
+ LOG("Failed to read URL field extent.");
return;
}
@@ -445,8 +435,7 @@ void ro_gui_url_complete_resize(struct toolbar *toolbar, wimp_open *open)
extent.x1 = 65536;
error = xwimp_set_extent(dialog_url_complete, &extent);
if (error) {
- LOG(("xwimp_set_extent: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_set_extent: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -468,16 +457,14 @@ void ro_gui_url_complete_resize(struct toolbar *toolbar, wimp_open *open)
if (state.visible.x1 - state.visible.x0 < 0) {
error = xwimp_close_window(dialog_url_complete);
if (error) {
- LOG(("xwimp_close_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_close_window: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
} else {
error = xwimp_open_window_nested_with_flags(&state,
(wimp_w)-1, 0);
if (error) {
- LOG(("xwimp_open_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -517,8 +504,7 @@ bool ro_gui_url_complete_close(void)
error = xwimp_close_window(dialog_url_complete);
if (error) {
- LOG(("xwimp_close_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_close_window: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
@@ -558,7 +544,7 @@ void ro_gui_url_complete_redraw(wimp_draw *redraw)
/* no matches? no redraw */
if (!url_complete_matches) {
- LOG(("Attempt to redraw with no matches made"));
+ LOG("Attempt to redraw with no matches made");
/* Fill is never used, so make it something obvious */
ro_gui_user_redraw(redraw, false, os_COLOUR_BLACK);
return;
@@ -593,9 +579,7 @@ void ro_gui_url_complete_redraw(wimp_draw *redraw)
error = xwimp_plot_icon(&url_complete_icon);
if (error) {
- LOG(("xwimp_plot_icon: 0x%x: %s",
- error->errnum,
- error->errmess));
+ LOG("xwimp_plot_icon: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
@@ -617,9 +601,7 @@ void ro_gui_url_complete_redraw(wimp_draw *redraw)
url_complete_sprite.extent.y0 = -(line + 1) * 44;
error = xwimp_plot_icon(&url_complete_sprite);
if (error) {
- LOG(("xwimp_plot_icon: 0x%x: %s",
- error->errnum,
- error->errmess));
+ LOG("xwimp_plot_icon: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
}
@@ -673,8 +655,7 @@ bool ro_gui_url_complete_click(wimp_pointer *pointer)
state.w = dialog_url_complete;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
@@ -701,16 +682,14 @@ bool ro_gui_url_complete_click(wimp_pointer *pointer)
0, -(old_selection + 1) * 44,
65536, -old_selection * 44);
if (error) {
- LOG(("xwimp_force_redraw: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_force_redraw: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
error = xwimp_force_redraw(dialog_url_complete,
0, -(url_complete_matches_selection + 1) * 44,
65536, -url_complete_matches_selection * 44);
if (error) {
- LOG(("xwimp_force_redraw: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_force_redraw: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
}
diff --git a/riscos/url_protocol.c b/riscos/url_protocol.c
index 6c5bdac9a..9fa888269 100644
--- a/riscos/url_protocol.c
+++ b/riscos/url_protocol.c
@@ -74,17 +74,17 @@ void ro_url_message_received(wimp_message *message)
} else {
if (!url_message->indirect.url.offset) {
- LOG(("no URL in message"));
+ LOG("no URL in message");
return;
}
if (28 < message->size &&
url_message->indirect.body_file.offset) {
- LOG(("POST for URL message not implemented"));
+ LOG("POST for URL message not implemented");
return;
}
if (url_message->indirect.url.offset < 28 ||
236 <= url_message->indirect.url.offset) {
- LOG(("external pointers in URL message unimplemented"));
+ LOG("external pointers in URL message unimplemented");
/* these messages have never been seen in the wild,
* and there is the problem of invalid addresses which
* would cause an abort */
@@ -121,8 +121,7 @@ void ro_url_message_received(wimp_message *message)
error = xwimp_send_message(wimp_USER_MESSAGE_ACKNOWLEDGE, message,
message->sender);
if (error) {
- LOG(("xwimp_send_message: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_send_message: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
@@ -165,8 +164,7 @@ void ro_url_broadcast(const char *url)
error = xwimp_send_message(wimp_USER_MESSAGE_RECORDED,
(wimp_message *) &message, 0);
if (error) {
- LOG(("xwimp_send_message: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_send_message: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
}
@@ -185,7 +183,7 @@ void ro_url_load(const char *url)
colon = strchr(url, ':');
if (!colon) {
- LOG(("invalid url '%s'", url));
+ LOG("invalid url '%s'", url);
return;
}
@@ -205,8 +203,7 @@ void ro_url_load(const char *url)
error = xwimp_start_task(command, 0);
if (error) {
- LOG(("xwimp_start_task: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_start_task: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
diff --git a/riscos/wimp.c b/riscos/wimp.c
index db6c2dbbb..93fedc3dc 100644
--- a/riscos/wimp.c
+++ b/riscos/wimp.c
@@ -104,8 +104,7 @@ void ro_gui_wimp_cache_furniture_sizes(wimp_w w)
furniture_sizes.border_widths.x1 = 40;
error = xwimpextend_get_furniture_sizes(&furniture_sizes);
if (error) {
- LOG(("xwimpextend_get_furniture_sizes: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimpextend_get_furniture_sizes: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
}
@@ -125,15 +124,13 @@ bool ro_gui_wimp_read_eig_factors(os_mode mode, int *xeig, int *yeig)
error = xos_read_mode_variable(mode, os_MODEVAR_XEIG_FACTOR, xeig, 0);
if (error) {
- LOG(("xos_read_mode_variable: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xos_read_mode_variable: 0x%x: %s", error->errnum, error->errmess);
warn_user("MiscError", error->errmess);
return false;
}
error = xos_read_mode_variable(mode, os_MODEVAR_YEIG_FACTOR, yeig, 0);
if (error) {
- LOG(("xos_read_mode_variable: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xos_read_mode_variable: 0x%x: %s", error->errnum, error->errmess);
warn_user("MiscError", error->errmess);
return false;
}
@@ -200,16 +197,14 @@ void ro_gui_force_redraw_icon(wimp_w w, wimp_i i)
ic.i = i;
error = xwimp_get_icon_state(&ic);
if (error) {
- LOG(("xwimp_get_icon_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
error = xwimp_force_redraw(w, ic.icon.extent.x0, ic.icon.extent.y0,
ic.icon.extent.x1, ic.icon.extent.y1);
if (error) {
- LOG(("xwimp_force_redraw: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_force_redraw: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
}
@@ -241,8 +236,7 @@ const char *ro_gui_get_icon_string(wimp_w w, wimp_i i)
ic.i = i;
error = xwimp_get_icon_state(&ic);
if (error) {
- LOG(("xwimp_get_icon_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return NULL;
}
@@ -284,7 +278,7 @@ void ro_gui_set_icon_string(wimp_w w, wimp_i i, const char *text, bool is_utf8)
if (err != NSERROR_OK) {
/* A bad encoding should never happen, so assert this */
assert(err != NSERROR_BAD_ENCODING);
- LOG(("utf8_to_enc failed"));
+ LOG("utf8_to_enc failed");
/* Paranoia */
local_text = NULL;
}
@@ -299,8 +293,7 @@ void ro_gui_set_icon_string(wimp_w w, wimp_i i, const char *text, bool is_utf8)
ic.i = i;
error = xwimp_get_icon_state(&ic);
if (error) {
- LOG(("xwimp_get_icon_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
goto exit;
}
@@ -333,8 +326,7 @@ void ro_gui_set_icon_string(wimp_w w, wimp_i i, const char *text, bool is_utf8)
(button_type == wimp_BUTTON_WRITE_CLICK_DRAG)) {
error = xwimp_get_caret_position(&caret);
if (error) {
- LOG(("xwimp_get_caret_position: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_caret_position: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
goto exit;
}
@@ -345,8 +337,7 @@ void ro_gui_set_icon_string(wimp_w w, wimp_i i, const char *text, bool is_utf8)
error = xwimp_set_caret_position(w, i, caret.pos.x,
caret.pos.y, -1, caret.index);
if (error) {
- LOG(("xwimp_set_caret_position: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_set_caret_position: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
}
@@ -455,8 +446,7 @@ void ro_gui_set_icon_selected_state(wimp_w w, wimp_i i, bool state)
error = xwimp_set_icon_state(w, i,
(state ? wimp_ICON_SELECTED : 0), wimp_ICON_SELECTED);
if (error) {
- LOG(("xwimp_set_icon_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
}
@@ -475,8 +465,7 @@ bool ro_gui_get_icon_selected_state(wimp_w w, wimp_i i)
ic.i = i;
error = xwimp_get_icon_state(&ic);
if (error) {
- LOG(("xwimp_get_icon_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
@@ -502,8 +491,7 @@ void ro_gui_set_icon_shaded_state(wimp_w w, wimp_i i, bool state)
error = xwimp_set_icon_state(w, i,
(state ? wimp_ICON_SHADED : 0), wimp_ICON_SHADED);
if (error) {
- LOG(("xwimp_get_icon_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
if (!state)
@@ -512,8 +500,7 @@ void ro_gui_set_icon_shaded_state(wimp_w w, wimp_i i, bool state)
/* ensure the caret is not in a shaded icon */
error = xwimp_get_caret_position(&caret);
if (error) {
- LOG(("xwimp_get_caret_position: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_caret_position: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -525,8 +512,7 @@ void ro_gui_set_icon_shaded_state(wimp_w w, wimp_i i, bool state)
/* lose the caret */
error = xwimp_set_caret_position((wimp_w)-1, (wimp_i)-1, -1, -1, -1, -1);
if (error) {
- LOG(("xwimp_set_caret_position: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_set_caret_position: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -567,8 +553,7 @@ void ro_gui_set_icon_deleted_state(wimp_w w, wimp_i i, bool state)
error = xwimp_set_icon_state(w, i,
(state ? wimp_ICON_DELETED : 0), wimp_ICON_DELETED);
if (error) {
- LOG(("xwimp_get_icon_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
if (!state)
@@ -577,8 +562,7 @@ void ro_gui_set_icon_deleted_state(wimp_w w, wimp_i i, bool state)
/* ensure the caret is not in a shaded icon */
error = xwimp_get_caret_position(&caret);
if (error) {
- LOG(("xwimp_get_caret_position: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_caret_position: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -590,8 +574,7 @@ void ro_gui_set_icon_deleted_state(wimp_w w, wimp_i i, bool state)
/* lose the caret */
error = xwimp_set_caret_position((wimp_w)-1, (wimp_i)-1, -1, -1, -1, -1);
if (error) {
- LOG(("xwimp_set_caret_position: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_set_caret_position: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -627,8 +610,7 @@ void ro_gui_set_icon_button_type(wimp_w w, wimp_i i, int type)
error = xwimp_set_icon_state(w, i, wimp_ICON_BUTTON_TYPE,
(type << wimp_ICON_BUTTON_TYPE_SHIFT));
if (error) {
- LOG(("xwimp_set_icon_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
}
@@ -653,8 +635,7 @@ void ro_gui_set_icon_sprite(wimp_w w, wimp_i i, osspriteop_area *area,
ic.i = i;
error = xwimp_get_icon_state(&ic);
if (error) {
- LOG(("xwimp_get_icon_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -691,8 +672,7 @@ void ro_gui_set_window_title(wimp_w w, const char *text)
window.w = w;
error = xwimp_get_window_info_header_only((wimp_window_info *)&window);
if (error) {
- LOG(("xwimp_get_window_info: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_info: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -703,7 +683,7 @@ void ro_gui_set_window_title(wimp_w w, const char *text)
/* A bad encoding should never happen,
* so assert this */
assert(err != NSERROR_BAD_ENCODING);
- LOG(("utf8_to_enc failed"));
+ LOG("utf8_to_enc failed");
return;
}
@@ -719,8 +699,7 @@ void ro_gui_set_window_title(wimp_w w, const char *text)
*/
error = xwimp_force_redraw_title(w);
if (error) {
- LOG(("xwimp_force_redraw_title: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_force_redraw_title: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -747,8 +726,7 @@ bool ro_gui_set_caret_first(wimp_w w)
win_state.w = w;
error = xwimp_get_window_state(&win_state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
@@ -759,8 +737,7 @@ bool ro_gui_set_caret_first(wimp_w w)
window.w = w;
error = xwimp_get_window_info_header_only((wimp_window_info *)&window);
if (error) {
- LOG(("xwimp_get_window_info: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_info: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
@@ -771,8 +748,7 @@ bool ro_gui_set_caret_first(wimp_w w)
state.i = icon;
error = xwimp_get_icon_state(&state);
if (error) {
- LOG(("xwimp_get_icon_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
@@ -789,8 +765,7 @@ bool ro_gui_set_caret_first(wimp_w w)
error = xwimp_set_caret_position(w, icon, 0, 0, -1,
strlen(state.icon.data.indirected_text.text));
if (error) {
- LOG(("xwimp_set_caret_position: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_set_caret_position: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
return true;
@@ -816,8 +791,7 @@ osspriteop_area *ro_gui_load_sprite_file(const char *pathname)
error = xosfile_read_stamped_no_path(pathname,
&obj_type, 0, 0, &len, 0, 0);
if (error) {
- LOG(("xosfile_read_stamped_no_path: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosfile_read_stamped_no_path: 0x%x: %s", error->errnum, error->errmess);
warn_user("MiscError", error->errmess);
return 0;
}
@@ -840,8 +814,7 @@ osspriteop_area *ro_gui_load_sprite_file(const char *pathname)
error = xosspriteop_load_sprite_file(osspriteop_USER_AREA,
area, pathname);
if (error) {
- LOG(("xosspriteop_load_sprite_file: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosspriteop_load_sprite_file: 0x%x: %s", error->errnum, error->errmess);
warn_user("MiscError", error->errmess);
free(area);
return 0;
@@ -871,8 +844,7 @@ bool ro_gui_wimp_sprite_exists(const char *sprite)
error = xwimpspriteop_select_sprite(sprite, 0);
if (error) {
if (error->errnum != error_SPRITE_OP_DOESNT_EXIST) {
- LOG(("xwimpspriteop_select_sprite: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimpspriteop_select_sprite: 0x%x: %s", error->errnum, error->errmess);
warn_user("MiscError", error->errmess);
}
return false;
@@ -945,8 +917,7 @@ bool ro_gui_wimp_get_sprite_dimensions(osspriteop_area *area, char *sprite,
if (height != NULL)
*height = dimensions.y;
} else if (error->errnum != error_SPRITE_OP_DOESNT_EXIST) {
- LOG(("xosspriteop_read_sprite_info: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosspriteop_read_sprite_info: 0x%x: %s", error->errnum, error->errmess);
warn_user("MiscError", error->errmess);
return false;
}
@@ -971,8 +942,7 @@ void ro_gui_user_redraw(wimp_draw *redraw, bool user_fill,
error = xwimp_redraw_window(redraw, &more);
if (error) {
- LOG(("xwimp_redraw_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_redraw_window: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -982,16 +952,14 @@ void ro_gui_user_redraw(wimp_draw *redraw, bool user_fill,
colourtrans_SET_BG_GCOL,
os_ACTION_OVERWRITE, 0, 0);
if (error) {
- LOG(("xcolourtrans_set_gcol: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xcolourtrans_set_gcol: 0x%x: %s", error->errnum, error->errmess);
warn_user("MiscError", error->errmess);
}
os_clg();
}
error = xwimp_get_rectangle(redraw, &more);
if (error) {
- LOG(("xwimp_get_rectangle: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_rectangle: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -1018,8 +986,7 @@ void ro_gui_wimp_update_window_furniture(wimp_w w, wimp_window_flags bic_mask,
state.w = w;
error = xwimp_get_window_state_and_nesting(&state, &parent, &linkage);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -1032,8 +999,7 @@ void ro_gui_wimp_update_window_furniture(wimp_w w, wimp_window_flags bic_mask,
state.next = wimp_HIDDEN;
error = xwimp_open_window_nested_with_flags(&state, parent, linkage);
if (error) {
- LOG(("xwimp_open_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -1041,8 +1007,7 @@ void ro_gui_wimp_update_window_furniture(wimp_w w, wimp_window_flags bic_mask,
if (!open) {
error = xwimp_close_window(w);
if (error) {
- LOG(("xwimp_close_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_close_window: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -1064,8 +1029,7 @@ bool ro_gui_wimp_check_window_furniture(wimp_w w, wimp_window_flags mask)
state.w = w;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
@@ -1165,8 +1129,7 @@ void ro_gui_scroll(wimp_scroll *scroll)
error = xwimp_open_window((wimp_open *) scroll);
if (error) {
- LOG(("xwimp_open_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess);
}
}
diff --git a/riscos/wimp_event.c b/riscos/wimp_event.c
index 38f9b3d37..4951fb9bd 100644
--- a/riscos/wimp_event.c
+++ b/riscos/wimp_event.c
@@ -157,7 +157,7 @@ bool ro_gui_wimp_event_memorise(wimp_w w)
ro_gui_get_icon_string(window->w, event->i));
if (!event->previous_value.textual) {
error = true;
- LOG(("Unable to store state for icon %i", event->i));
+ LOG("Unable to store state for icon %i", event->i);
}
break;
case EVENT_CHECKBOX:
@@ -268,8 +268,7 @@ bool ro_gui_wimp_event_transfer(wimp_w from, wimp_w to)
struct event_window *window;
int h;
- LOG(("Transferring all events from window 0x%x to window 0x%x",
- (unsigned int) from, (unsigned int) to));
+ LOG("Transferring all events from window 0x%x to window 0x%x", (unsigned int)from, (unsigned int)to);
window = ro_gui_wimp_event_remove_window(from);
if (window == NULL || window->w != from)
@@ -295,7 +294,7 @@ void ro_gui_wimp_event_finalise(wimp_w w)
struct event_window *window;
struct icon_event *event;
- LOG(("Removing all events for window 0x%x", (unsigned int)w));
+ LOG("Removing all events for window 0x%x", (unsigned int)w);
window = ro_gui_wimp_event_remove_window(w);
if (!window)
return;
@@ -332,8 +331,7 @@ void ro_gui_wimp_event_deregister(wimp_w w, wimp_i i)
struct event_window *window;
struct icon_event *event, *parent, *child;
- LOG(("Removing all events for window 0x%x, icon %d",
- (unsigned int)w, (int)i));
+ LOG("Removing all events for window 0x%x, icon %d", (unsigned int)w, (int)i);
window = ro_gui_wimp_event_get_window(w);
if (!window)
return;
@@ -347,7 +345,7 @@ void ro_gui_wimp_event_deregister(wimp_w w, wimp_i i)
child = event->next;
if (event->i == i) {
- LOG(("Removing event 0x%x", (unsigned int) event));
+ LOG("Removing event 0x%x", (unsigned int)event);
if (parent == NULL)
window->first = child;
@@ -579,8 +577,7 @@ bool ro_gui_wimp_event_menu_selection(wimp_w w, wimp_i i, wimp_menu *menu,
ic.i = event->data.menu_gright.field;
error = xwimp_get_icon_state(&ic);
if (error) {
- LOG(("xwimp_get_icon_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
@@ -590,8 +587,7 @@ bool ro_gui_wimp_event_menu_selection(wimp_w w, wimp_i i, wimp_menu *menu,
return prepared;
error = xwimp_get_caret_position(&caret);
if (error) {
- LOG(("xwimp_get_caret_position: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_caret_position: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
@@ -599,8 +595,7 @@ bool ro_gui_wimp_event_menu_selection(wimp_w w, wimp_i i, wimp_menu *menu,
error = xwimp_set_caret_position(window->w, event->data.menu_gright.field,
-1, -1, -1, strlen(menu_entry->data.indirected_text.text));
if (error) {
- LOG(("xwimp_set_caret_position: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_set_caret_position: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
}
@@ -672,7 +667,7 @@ bool ro_gui_wimp_event_mouse_click(wimp_pointer *pointer)
for (search = window->first; search; search = search->next)
if (search->i == event->data.linked_icon) break;
if (!search) {
- LOG(("Incorrect reference."));
+ LOG("Incorrect reference.");
return false;
}
stepping = search->data.numeric_field.stepping;
@@ -709,15 +704,13 @@ bool ro_gui_wimp_event_mouse_click(wimp_pointer *pointer)
open.w = pointer->w;
error = xwimp_get_window_state(&open);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
error = xwimp_get_caret_position(&caret);
if (error) {
- LOG(("xwimp_get_caret_position: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_caret_position: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
@@ -726,8 +719,7 @@ bool ro_gui_wimp_event_mouse_click(wimp_pointer *pointer)
ro_gui_menu_destroy();
error = xwimp_open_window(PTR_WIMP_OPEN(&open));
if (error) {
- LOG(("xwimp_open_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
@@ -737,8 +729,7 @@ bool ro_gui_wimp_event_mouse_click(wimp_pointer *pointer)
caret.pos.x, caret.pos.y,
-1, caret.index);
if (error) {
- LOG(("xwimp_set_caret_position: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_set_caret_position: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
}
@@ -806,8 +797,7 @@ void ro_gui_wimp_event_prepare_gright_menu(wimp_w w, struct icon_event *event)
ic.i = event->data.menu_gright.field;
error = xwimp_get_icon_state(&ic);
if (error) {
- LOG(("xwimp_get_icon_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -914,8 +904,7 @@ bool ro_gui_wimp_event_keypress(wimp_key *key)
*/
error = xosbyte1(osbyte_ALPHABET_NUMBER, 127, 0, &t_alphabet);
if (error) {
- LOG(("failed reading alphabet: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("failed reading alphabet: 0x%x: %s", error->errnum, error->errmess);
/* prevent any corruption of ucstable */
t_alphabet = alphabet;
}
@@ -929,8 +918,7 @@ bool ro_gui_wimp_event_keypress(wimp_key *key)
error = xserviceinternational_get_ucs_conversion_table(
alphabet, &unclaimed, &ostable);
if (error != NULL) {
- LOG(("failed reading UCS conversion table: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("failed reading UCS conversion table: 0x%x: %s", error->errnum, error->errmess);
/* Try using our own table instead */
ucstable = ucstable_from_alphabet(alphabet);
} else if (unclaimed) {
@@ -987,9 +975,7 @@ bool ro_gui_wimp_event_keypress(wimp_key *key)
/* If this ever happens,
* RISC OS' UTF8 keyboard
* drivers are broken */
- LOG(("unexpected UTF8 start"
- " byte %x (ignoring)",
- c));
+ LOG("unexpected UTF8 start"" byte %x (ignoring)", c);
return true;
}
/* Anything else is ASCII, so just
@@ -1000,8 +986,7 @@ bool ro_gui_wimp_event_keypress(wimp_key *key)
/* If this ever happens,
* RISC OS' UTF8 keyboard
* drivers are broken */
- LOG(("unexpected keycode: "
- "%x (ignoring)", c));
+ LOG("unexpected keycode: ""%x (ignoring)", c);
return true;
}
@@ -1090,7 +1075,7 @@ bool ro_gui_wimp_event_close_window(wimp_w w)
{
struct event_window *window;
- LOG(("Close event received for window 0x%x", (unsigned int)w));
+ LOG("Close event received for window 0x%x", (unsigned int)w);
if (w == ro_gui_wimp_event_submenu)
ro_gui_wimp_event_submenu = 0;
window = ro_gui_wimp_event_find_window(w);
@@ -1631,7 +1616,7 @@ struct event_window *ro_gui_wimp_event_get_window(wimp_w w)
if (window)
return window;
- LOG(("Creating structure for window 0x%x", (unsigned int)w));
+ LOG("Creating structure for window 0x%x", (unsigned int)w);
window = calloc(1, sizeof(struct event_window));
if (!window)
return NULL;
diff --git a/riscos/window.c b/riscos/window.c
index 7f80bc8c9..097ab9ee6 100644
--- a/riscos/window.c
+++ b/riscos/window.c
@@ -386,8 +386,7 @@ static void gui_window_place_caret(struct gui_window *g, int x, int y, int heigh
error = xwimp_set_caret_position(g->window, -1,
x * 2, -(y + height) * 2, height * 2, -1);
if (error) {
- LOG(("xwimp_set_caret_position: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_set_caret_position: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
}
@@ -436,8 +435,7 @@ static struct gui_window *gui_window_create(struct browser_window *bw,
state.w = existing->window;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
window.visible.x0 = state.visible.x0;
@@ -541,8 +539,7 @@ static struct gui_window *gui_window_create(struct browser_window *bw,
error = xwimp_create_window(&window, &g->window);
if (error) {
- LOG(("xwimp_create_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_create_window: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
free(g);
return 0;
@@ -603,8 +600,7 @@ static struct gui_window *gui_window_create(struct browser_window *bw,
state.w = g->window;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return g;
}
@@ -663,8 +659,7 @@ static void gui_window_destroy(struct gui_window *g)
/* delete window */
error = xwimp_delete_window(w);
if (error) {
- LOG(("xwimp_delete_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_delete_window: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
ro_gui_wimp_event_finalise(w);
@@ -716,16 +711,14 @@ void gui_window_redraw_window(struct gui_window *g)
info.w = g->window;
error = xwimp_get_window_info_header_only(&info);
if (error) {
- LOG(("xwimp_get_window_info_header_only: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_info_header_only: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
error = xwimp_force_redraw(g->window, info.extent.x0, info.extent.y0,
info.extent.x1, info.extent.y1);
if (error) {
- LOG(("xwimp_force_redraw: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_force_redraw: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
}
@@ -769,7 +762,7 @@ static void gui_window_update_box(struct gui_window *g, const struct rect *rect)
}
cur = malloc(sizeof(struct update_box));
if (!cur) {
- LOG(("No memory for malloc."));
+ LOG("No memory for malloc.");
warn_user("NoMemory", 0);
return;
}
@@ -804,8 +797,7 @@ static bool gui_window_get_scroll(struct gui_window *g, int *sx, int *sy)
state.w = g->window;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
@@ -836,8 +828,7 @@ static void gui_window_set_scroll(struct gui_window *g, int sx, int sy)
state.w = g->window;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -873,8 +864,7 @@ static void gui_window_scroll_visible(struct gui_window *g, int x0, int y0, int
state.w = g->window;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -972,8 +962,7 @@ static void gui_window_update_extent(struct gui_window *g)
info.w = g->window;
error = xwimp_get_window_info_header_only(&info);
if (error) {
- LOG(("xwimp_get_window_info_header_only: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_info_header_only: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -1027,8 +1016,7 @@ void gui_window_set_pointer(struct gui_window *g, gui_pointer_shape shape)
error = xwimpspriteop_set_pointer_shape(entry->sprite_name,
1, entry->xactive, entry->yactive, 0, 0);
if (error) {
- LOG(("xwimpspriteop_set_pointer_shape: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimpspriteop_set_pointer_shape: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
} else {
@@ -1038,8 +1026,7 @@ void gui_window_set_pointer(struct gui_window *g, gui_pointer_shape shape)
(osspriteop_id) entry->sprite_name,
1, entry->xactive, entry->yactive, 0, 0);
if (error) {
- LOG(("xosspriteop_set_pointer_shape: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosspriteop_set_pointer_shape: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
}
@@ -1119,8 +1106,7 @@ static void gui_window_remove_caret(struct gui_window *g)
error = xwimp_get_caret_position(&caret);
if (error) {
- LOG(("xwimp_get_caret_position: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_caret_position: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -1166,8 +1152,7 @@ static bool gui_window_scroll_start(struct gui_window *g)
error = xwimp_get_pointer_info(&pointer);
if (error) {
- LOG(("xwimp_get_pointer_info 0x%x : %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_pointer_info 0x%x : %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
@@ -1175,8 +1160,7 @@ static bool gui_window_scroll_start(struct gui_window *g)
info.w = g->window;
error = xwimp_get_window_info_header_only((wimp_window_info*)&info);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x : %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x : %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
@@ -1198,8 +1182,7 @@ static bool gui_window_scroll_start(struct gui_window *g)
error = xwimp_drag_box(&drag);
if (error) {
- LOG(("xwimp_drag_box: 0x%x : %s",
- error->errnum, error->errmess));
+ LOG("xwimp_drag_box: 0x%x : %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
@@ -1230,8 +1213,7 @@ static bool gui_window_drag_start(struct gui_window *g, gui_drag_type type,
* duration */
os_error *error = xwimp_get_pointer_info(&pointer);
if (error) {
- LOG(("xwimp_get_pointer_info 0x%x : %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_pointer_info 0x%x : %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
@@ -1248,8 +1230,7 @@ static bool gui_window_drag_start(struct gui_window *g, gui_drag_type type,
error = xwimp_drag_box(&drag);
if (error) {
- LOG(("xwimp_drag_box: 0x%x : %s",
- error->errnum, error->errmess));
+ LOG("xwimp_drag_box: 0x%x : %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
@@ -1310,8 +1291,7 @@ void gui_window_set_extent(struct gui_window *g, int width, int height)
state.w = g->window;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -1342,8 +1322,7 @@ void gui_window_set_extent(struct gui_window *g, int width, int height)
os_box extent = { 0, -height, width, toolbar_height };
error = xwimp_set_extent(g->window, &extent);
if (error) {
- LOG(("xwimp_set_extent: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_set_extent: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -1374,8 +1353,7 @@ static void gui_window_create_form_select_menu(struct gui_window *g,
error = xwimp_get_pointer_info(&pointer);
if (error) {
- LOG(("xwimp_get_pointer_info: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_pointer_info: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
ro_gui_menu_destroy();
return;
@@ -1417,8 +1395,7 @@ void ro_gui_window_redraw(wimp_draw *redraw)
error = xwimp_redraw_window(redraw, &more);
if (error) {
- LOG(("xwimp_redraw_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_redraw_window: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -1460,8 +1437,7 @@ void ro_gui_window_redraw(wimp_draw *redraw)
if (error && !(ro_gui_current_redraw_gui->
option.buffer_everything &&
error->errnum == error_WIMP_GET_RECT)) {
- LOG(("xwimp_get_rectangle: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_rectangle: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
ro_gui_current_redraw_gui = NULL;
return;
@@ -1512,8 +1488,7 @@ void ro_gui_window_open(wimp_open *open)
state.w = g->window;
error = xwimp_get_window_state_and_nesting(&state, &parent, &linkage);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -1618,8 +1593,7 @@ void ro_gui_window_open(wimp_open *open)
error = xwimp_open_window_nested_with_flags(&state, parent, linkage);
if (error) {
- LOG(("xwimp_open_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -1658,8 +1632,7 @@ void ro_gui_window_close(wimp_w w)
error = xwimp_get_pointer_info(&pointer);
if (error) {
- LOG(("xwimp_get_pointer_info: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_pointer_info: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -1687,9 +1660,7 @@ void ro_gui_window_close(wimp_w w)
}
error = xos_cli(temp_name);
if (error) {
- LOG(("xos_cli: 0x%x: %s",
- error->errnum,
- error->errmess));
+ LOG("xos_cli: 0x%x: %s", error->errnum, error->errmess);
warn_user("MiscError", error->errmess);
return;
}
@@ -1879,8 +1850,7 @@ bool ro_gui_window_handle_local_keypress(struct gui_window *g, wimp_key *key,
ro_error = xwimp_get_pointer_info(&pointer);
if (ro_error) {
- LOG(("xwimp_get_pointer_info: 0x%x: %s\n",
- ro_error->errnum, ro_error->errmess));
+ LOG("xwimp_get_pointer_info: 0x%x: %s\n", ro_error->errnum, ro_error->errmess);
warn_user("WimpError", ro_error->errmess);
return false;
}
@@ -2963,9 +2933,7 @@ bool ro_gui_window_menu_select(wimp_w w, wimp_i i, wimp_menu *menu,
state.w = w;
oserror = xwimp_get_window_state(&state);
if (oserror) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- oserror->errnum,
- oserror->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", oserror->errnum, oserror->errmess);
warn_user("WimpError", oserror->errmess);
}
nsoption_set_int(window_x, state.visible.x0);
@@ -3155,8 +3123,7 @@ void ro_gui_window_scroll_action(struct gui_window *g,
state.w = g->window;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
return;
}
@@ -3170,8 +3137,7 @@ void ro_gui_window_scroll_action(struct gui_window *g,
error = xwimp_get_pointer_info(&pointer);
if (error) {
- LOG(("xwimp_get_pointer_info 0x%x : %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_pointer_info 0x%x : %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
@@ -3291,9 +3257,7 @@ void ro_gui_window_scroll_action(struct gui_window *g,
error = xwimp_open_window((wimp_open *) &state);
if (error) {
- LOG(("xwimp_open_window: 0x%x: %s",
- error->errnum,
- error->errmess));
+ LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess);
}
}
}
@@ -3331,8 +3295,7 @@ bool ro_gui_window_dataload(struct gui_window *g, wimp_message *message)
message->your_ref = message->my_ref;
error = xwimp_send_message(wimp_USER_MESSAGE, message, message->sender);
if (error) {
- LOG(("xwimp_send_message: 0x%x: %s\n",
- error->errnum, error->errmess));
+ LOG("xwimp_send_message: 0x%x: %s\n", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
@@ -3398,13 +3361,12 @@ void ro_gui_window_iconise(struct gui_window *g,
(osspriteop_id)overlay, &width, &height, NULL,
NULL);
if (error) {
- LOG(("xosspriteop_read_sprite_info: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xosspriteop_read_sprite_info: 0x%x: %s", error->errnum, error->errmess);
warn_user("MiscError", error->errmess);
overlay = NULL;
}
else if (sprite_bpp(overlay) != 8) {
- LOG(("overlay sprite is not 8bpp"));
+ LOG("overlay sprite is not 8bpp");
overlay = NULL;
}
}
@@ -3413,7 +3375,7 @@ void ro_gui_window_iconise(struct gui_window *g,
bitmap = riscos_bitmap_create(width, height, BITMAP_NEW | BITMAP_OPAQUE |
BITMAP_CLEAR_MEMORY);
if (!bitmap) {
- LOG(("Thumbnail initialisation failed."));
+ LOG("Thumbnail initialisation failed.");
return;
}
riscos_bitmap_render(bitmap, h);
@@ -3423,7 +3385,7 @@ void ro_gui_window_iconise(struct gui_window *g,
area = riscos_bitmap_convert_8bpp(bitmap);
riscos_bitmap_destroy(bitmap);
if (!area) {
- LOG(("Thumbnail conversion failed."));
+ LOG("Thumbnail conversion failed.");
return;
}
@@ -3444,8 +3406,7 @@ void ro_gui_window_iconise(struct gui_window *g,
error = xosspriteop_save_sprite_file(osspriteop_USER_AREA,
area, temp_fname);
if (error) {
- LOG(("xosspriteop_save_sprite_file: 0x%x:%s",
- error->errnum, error->errmess));
+ LOG("xosspriteop_save_sprite_file: 0x%x:%s", error->errnum, error->errmess);
warn_user("MiscError", error->errmess);
free(area);
return;
@@ -3453,8 +3414,7 @@ void ro_gui_window_iconise(struct gui_window *g,
error = xwimpspriteop_merge_sprite_file(temp_fname);
if (error) {
- LOG(("xwimpspriteop_merge_sprite_file: 0x%x:%s",
- error->errnum, error->errmess));
+ LOG("xwimpspriteop_merge_sprite_file: 0x%x:%s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
remove(temp_fname);
free(area);
@@ -3479,8 +3439,7 @@ void ro_gui_window_iconise(struct gui_window *g,
error = xwimp_send_message(wimp_USER_MESSAGE, (wimp_message*)wi,
wi->sender);
if (error) {
- LOG(("xwimp_send_message: 0x%x:%s",
- error->errnum, error->errmess));
+ LOG("xwimp_send_message: 0x%x:%s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
else {
@@ -3511,23 +3470,20 @@ static void ro_gui_window_scroll_end(wimp_dragged *drag, void *data)
error = xwimp_drag_box((wimp_drag*)-1);
if (error) {
- LOG(("xwimp_drag_box: 0x%x : %s",
- error->errnum, error->errmess));
+ LOG("xwimp_drag_box: 0x%x : %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
error = xwimp_get_pointer_info(&pointer);
if (error) {
- LOG(("xwimp_get_pointer_info 0x%x : %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_pointer_info 0x%x : %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}
error = xwimpspriteop_set_pointer_shape("ptr_default", 0x31, 0, 0, 0, 0);
if (error) {
- LOG(("xwimpspriteop_set_pointer_shape: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimpspriteop_set_pointer_shape: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
@@ -3720,8 +3676,7 @@ bool ro_gui_toolbar_dataload(struct gui_window *g, wimp_message *message)
error = xwimp_send_message(wimp_USER_MESSAGE, message,
message->sender);
if (error) {
- LOG(("xwimp_send_message: 0x%x: %s\n",
- error->errnum, error->errmess));
+ LOG("xwimp_send_message: 0x%x: %s\n", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
return true;
@@ -4192,8 +4147,7 @@ void ro_gui_window_update_boxes(void)
error = xwimp_update_window(&update, &more);
if (error) {
- LOG(("xwimp_update_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_update_window: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
continue;
}
@@ -4226,8 +4180,7 @@ void ro_gui_window_update_boxes(void)
* found. This appears to be a bug in RISC OS. */
if (error && !(use_buffer &&
error->errnum == error_WIMP_GET_RECT)) {
- LOG(("xwimp_get_rectangle: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_rectangle: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
ro_gui_current_redraw_gui = NULL;
continue;
@@ -4420,8 +4373,7 @@ bool ro_gui_window_import_text(struct gui_window *g, const char *filename)
error = xosfile_read_stamped(filename, &obj_type, NULL, NULL,
&size, NULL, NULL);
if (error) {
- LOG(("xosfile_read_stamped: 0x%x:%s",
- error->errnum, error->errmess));
+ LOG("xosfile_read_stamped: 0x%x:%s", error->errnum, error->errmess);
warn_user("FileError", error->errmess);
return true; /* was for us, but it didn't work! */
}
@@ -4440,8 +4392,7 @@ bool ro_gui_window_import_text(struct gui_window *g, const char *filename)
NULL, NULL, NULL, NULL, NULL);
if (error) {
- LOG(("xosfile_load_stamped: 0x%x:%s",
- error->errnum, error->errmess));
+ LOG("xosfile_load_stamped: 0x%x:%s", error->errnum, error->errmess);
warn_user("LoadError", error->errmess);
free(buf);
return true;
@@ -4451,7 +4402,7 @@ bool ro_gui_window_import_text(struct gui_window *g, const char *filename)
if (ret != NSERROR_OK) {
/* bad encoding shouldn't happen */
assert(ret != NSERROR_BAD_ENCODING);
- LOG(("utf8_from_local_encoding failed"));
+ LOG("utf8_from_local_encoding failed");
free(buf);
warn_user("NoMemory", NULL);
return true;
@@ -4624,7 +4575,7 @@ bool ro_gui_window_prepare_form_select_menu(struct gui_window *g,
if (err != NSERROR_OK) {
/* badenc should never happen */
assert(err != NSERROR_BAD_ENCODING);
- LOG(("utf8_to_local_encoding failed"));
+ LOG("utf8_to_local_encoding failed");
warn_user("NoMemory", 0);
ro_gui_menu_destroy();
return false;
@@ -4650,7 +4601,7 @@ bool ro_gui_window_prepare_form_select_menu(struct gui_window *g,
temp = cnv_space2nbsp(option->text);
if (!temp) {
- LOG(("cnv_space2nbsp failed"));
+ LOG("cnv_space2nbsp failed");
warn_user("NoMemory", 0);
ro_gui_menu_destroy();
return false;
@@ -4662,7 +4613,7 @@ bool ro_gui_window_prepare_form_select_menu(struct gui_window *g,
/* A bad encoding should never happen,
* so assert this */
assert(err != NSERROR_BAD_ENCODING);
- LOG(("utf8_to_enc failed"));
+ LOG("utf8_to_enc failed");
warn_user("NoMemory", 0);
ro_gui_menu_destroy();
return false;
@@ -4773,8 +4724,7 @@ bool ro_gui_window_to_window_pos(struct gui_window *g, int x, int y,
state.w = g->window;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x:%s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x:%s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
@@ -4805,8 +4755,7 @@ bool ro_gui_window_to_screen_pos(struct gui_window *g, int x, int y,
state.w = g->window;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x:%s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x:%s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
diff --git a/test/nsurl.c b/test/nsurl.c
index 49ccdbad0..891e5c91e 100644
--- a/test/nsurl.c
+++ b/test/nsurl.c
@@ -40,8 +40,7 @@ struct test_triplets {
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));
}
static const struct test_pairs create_tests[] = {
@@ -239,32 +238,27 @@ int main(void)
}
if (nsurl_get(base, NSURL_WITH_FRAGMENT, &string, &len) != NSERROR_OK) {
- LOG(("Failed to get string"));
+ LOG("Failed to get string");
} else {
- LOG(("Testing nsurl_join with base %s", string));
+ LOG("Testing nsurl_join with base %s", string);
free(string);
}
for (test = join_tests; test->test != NULL; test++) {
if (nsurl_join(base, test->test, &joined) != NSERROR_OK) {
- LOG(("Failed to join test URL."));
+ LOG("Failed to join test URL.");
} else {
if (nsurl_get(joined, NSURL_WITH_FRAGMENT,
&string, &len) !=
NSERROR_OK) {
- LOG(("Failed to get string"));
+ LOG("Failed to get string");
} else {
if (strcmp(test->res, string) == 0) {
- LOG(("\tPASS: \"%s\"\t--> %s",
- test->test,
- string));
+ LOG("\tPASS: \"%s\"\t--> %s", test->test, string);
passed++;
} else {
- LOG(("\tFAIL: \"%s\"\t--> %s",
- test->test,
- string));
- LOG(("\t\tExpecting: %s",
- test->res));
+ LOG("\tFAIL: \"%s\"\t--> %s", test->test, string);
+ LOG("\t\tExpecting: %s", test->res);
}
free(string);
}
@@ -276,33 +270,28 @@ int main(void)
nsurl_unref(base);
/* Create tests */
- LOG(("Testing nsurl_create"));
+ LOG("Testing nsurl_create");
for (test = create_tests; test->test != NULL; test++) {
err = nsurl_create(test->test, &base);
if (err != NSERROR_OK || test->res == NULL) {
if (test->res == NULL && err != NSERROR_OK) {
- LOG(("\tPASS: \"%s\"\t--> BAD INPUT",
- test->test));
+ LOG("\tPASS: \"%s\"\t--> BAD INPUT", test->test);
passed++;
} else if (test->res != NULL && err != NSERROR_OK) {
- LOG(("Failed to create URL:\n\t\t%s.",
- test->test));
+ LOG("Failed to create URL:\n\t\t%s.", test->test);
} else {
- LOG(("\tFAIL: \"%s\"\t--> %s",
- test->test, nsurl_access(base)));
- LOG(("\t\tExpecting BAD INPUT"));
+ LOG("\tFAIL: \"%s\"\t--> %s", test->test, nsurl_access(base));
+ LOG("\t\tExpecting BAD INPUT");
}
if (err == NSERROR_OK)
nsurl_unref(base);
} else {
if (strcmp(nsurl_access(base), test->res) == 0) {
- LOG(("\tPASS: \"%s\"\t--> %s",
- test->test, nsurl_access(base)));
+ LOG("\tPASS: \"%s\"\t--> %s", test->test, nsurl_access(base));
passed++;
} else {
- LOG(("\tFAIL: \"%s\"\t--> %s",
- test->test, nsurl_access(base)));
- LOG(("\t\tExpecting %s", test->res));
+ LOG("\tFAIL: \"%s\"\t--> %s", test->test, nsurl_access(base));
+ LOG("\t\tExpecting %s", test->res);
}
nsurl_unref(base);
@@ -311,66 +300,60 @@ int main(void)
}
/* nice filename tests */
- LOG(("Testing nsurl_nice (no strip)"));
+ LOG("Testing nsurl_nice (no strip)");
for (test = nice_tests; test->test != NULL; test++) {
err = nsurl_create(test->test, &base);
if (err != NSERROR_OK) {
- LOG(("Failed to create URL:\n\t\t%s.", test->test));
+ LOG("Failed to create URL:\n\t\t%s.", test->test);
} else {
char *res;
err = nsurl_nice(base, &res, false);
if (err == NSERROR_OK && test->res != NULL) {
if (strcmp(res, test->res) == 0) {
- LOG(("\tPASS: \"%s\"\t--> %s",
- test->test, res));
+ LOG("\tPASS: \"%s\"\t--> %s", test->test, res);
passed++;
} else {
- LOG(("\tFAIL: \"%s\"\t--> %s",
- test->test, res));
- LOG(("\t\tExpecting %s", test->res));
+ LOG("\tFAIL: \"%s\"\t--> %s", test->test, res);
+ LOG("\t\tExpecting %s", test->res);
}
free(res);
} else {
if (test->res == NULL && err == NSERROR_OK) {
- LOG(("\tFAIL: \"%s\"\t--> %s",
- test->test, res));
- LOG(("\t\tExpecting BAD_INPUT"));
+ LOG("\tFAIL: \"%s\"\t--> %s", test->test, res);
+ LOG("\t\tExpecting BAD_INPUT");
free(res);
} else {
- LOG(("\tFAIL: \"%s\"", test->test));
+ LOG("\tFAIL: \"%s\"", test->test);
}
}
nsurl_unref(base);
}
count++;
}
- LOG(("Testing nsurl_nice (strip)"));
+ LOG("Testing nsurl_nice (strip)");
for (test = nice_strip_tests; test->test != NULL; test++) {
err = nsurl_create(test->test, &base);
if (err != NSERROR_OK) {
- LOG(("Failed to create URL:\n\t\t%s.", test->test));
+ LOG("Failed to create URL:\n\t\t%s.", test->test);
} else {
char *res;
err = nsurl_nice(base, &res, true);
if (err == NSERROR_OK && test->res != NULL) {
if (strcmp(res, test->res) == 0) {
- LOG(("\tPASS: \"%s\"\t--> %s",
- test->test, res));
+ LOG("\tPASS: \"%s\"\t--> %s", test->test, res);
passed++;
} else {
- LOG(("\tFAIL: \"%s\"\t--> %s",
- test->test, res));
- LOG(("\t\tExpecting %s", test->res));
+ LOG("\tFAIL: \"%s\"\t--> %s", test->test, res);
+ LOG("\t\tExpecting %s", test->res);
}
free(res);
} else {
if (test->res == NULL && err == NSERROR_OK) {
- LOG(("\tFAIL: \"%s\"\t--> %s",
- test->test, res));
- LOG(("\t\tExpecting BAD_INPUT"));
+ LOG("\tFAIL: \"%s\"\t--> %s", test->test, res);
+ LOG("\t\tExpecting BAD_INPUT");
free(res);
} else {
- LOG(("\tFAIL: \"%s\"", test->test));
+ LOG("\tFAIL: \"%s\"", test->test);
}
}
nsurl_unref(base);
@@ -379,28 +362,23 @@ int main(void)
}
/* Replace query tests */
- LOG(("Testing nsurl_replace_query"));
+ LOG("Testing nsurl_replace_query");
for (ttest = replace_query_tests; ttest->test1 != NULL; ttest++) {
if (nsurl_create(ttest->test1, &base) != NSERROR_OK) {
- LOG(("Failed to create URL:\n\t\t%s.", ttest->test1));
+ LOG("Failed to create URL:\n\t\t%s.", ttest->test1);
} else {
if (nsurl_replace_query(base, ttest->test2, &joined) !=
NSERROR_OK) {
- LOG(("Failed to make test URL"));
+ LOG("Failed to make test URL");
} else {
if (strcmp(nsurl_access(joined),
ttest->res) == 0) {
- LOG(("\tPASS: \"%s\" + %s",
- ttest->test1,
- ttest->test2));
+ LOG("\tPASS: \"%s\" + %s", ttest->test1, ttest->test2);
passed++;
} else {
- LOG(("\tFAIL: \"%s\" + %s",
- ttest->test1,
- ttest->test2));
- LOG(("\t\tExpecting %s", ttest->res));
- LOG(("\t\tGot %s",
- nsurl_access(joined)));
+ LOG("\tFAIL: \"%s\" + %s", ttest->test1, ttest->test2);
+ LOG("\t\tExpecting %s", ttest->res);
+ LOG("\t\tGot %s", nsurl_access(joined));
}
nsurl_unref(joined);
@@ -412,15 +390,15 @@ int main(void)
}
if (passed == count) {
- LOG(("Testing complete: SUCCESS"));
+ LOG("Testing complete: SUCCESS");
} else {
- LOG(("Testing complete: FAILURE"));
- LOG(("Failed %d out of %d", count - passed, count));
+ LOG("Testing complete: FAILURE");
+ LOG("Failed %d out of %d", count - passed, count);
}
corestrings_fini();
- LOG(("Remaining lwc strings:"));
+ LOG("Remaining lwc strings:");
lwc_iterate_strings(netsurf_lwc_iterator, NULL);
return 0;
diff --git a/test/urldbtest.c b/test/urldbtest.c
index 2b7e8a060..88291cefd 100644
--- a/test/urldbtest.c
+++ b/test/urldbtest.c
@@ -49,7 +49,7 @@ bool verbose_log = true;
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));
}
bool cookie_manager_add(const struct cookie_data *data)
@@ -91,7 +91,7 @@ nsurl *make_url(const char *url)
{
nsurl *nsurl;
if (nsurl_create(url, &nsurl) != NSERROR_OK) {
- LOG(("failed creating nsurl"));
+ LOG("failed creating nsurl");
exit(1);
}
return nsurl;
@@ -103,7 +103,7 @@ char *make_path_query(nsurl *url)
char *path_query;
if (nsurl_get(url, NSURL_PATH | NSURL_QUERY, &path_query, &len) !=
NSERROR_OK) {
- LOG(("failed creating path_query"));
+ LOG("failed creating path_query");
exit(1);
}
return path_query;
@@ -113,7 +113,7 @@ lwc_string *make_lwc(const char *str)
{
lwc_string *lwc;
if (lwc_intern_string(str, strlen(str), &lwc) != lwc_error_ok) {
- LOG(("failed creating lwc_string"));
+ LOG("failed creating lwc_string");
exit(1);
}
return lwc;
@@ -166,13 +166,13 @@ int main(void)
h = urldb_add_host("127.0.0.1");
if (!h) {
- LOG(("failed adding host"));
+ LOG("failed adding host");
return 1;
}
h = urldb_add_host("intranet");
if (!h) {
- LOG(("failed adding host"));
+ LOG("failed adding host");
return 1;
}
@@ -180,7 +180,7 @@ int main(void)
scheme = nsurl_get_component(url, NSURL_SCHEME);
p = urldb_add_path(scheme, 0, h, strdup("/"), NULL, url);
if (!p) {
- LOG(("failed adding path"));
+ LOG("failed adding path");
return 1;
}
lwc_string_unref(scheme);
@@ -194,7 +194,7 @@ int main(void)
/* Get host entry */
h = urldb_add_host("netsurf.strcprstskrzkrk.co.uk");
if (!h) {
- LOG(("failed adding host"));
+ LOG("failed adding host");
return 1;
}
@@ -205,7 +205,7 @@ int main(void)
fragment = make_lwc("zz");
p = urldb_add_path(scheme, 0, h, strdup(path_query), fragment, url);
if (!p) {
- LOG(("failed adding path"));
+ LOG("failed adding path");
return 1;
}
lwc_string_unref(fragment);
@@ -213,7 +213,7 @@ int main(void)
fragment = make_lwc("aa");
p = urldb_add_path(scheme, 0, h, strdup(path_query), fragment, url);
if (!p) {
- LOG(("failed adding path"));
+ LOG("failed adding path");
return 1;
}
lwc_string_unref(fragment);
@@ -221,7 +221,7 @@ int main(void)
fragment = make_lwc("yy");
p = urldb_add_path(scheme, 0, h, strdup(path_query), fragment, url);
if (!p) {
- LOG(("failed adding path"));
+ LOG("failed adding path");
return 1;
}
free(path_query);
@@ -280,7 +280,7 @@ int main(void)
/* 1597646 */
url = make_url("http://foo@moose.com/");
if (urldb_add_url(url)) {
- LOG(("added %s", nsurl_access(url)));
+ LOG("added %s", nsurl_access(url));
assert(urldb_get_url(url) != NULL);
}
nsurl_unref(url);
@@ -376,7 +376,7 @@ int main(void)
printf("PASS\n");
corestrings_fini();
- LOG(("Remaining lwc strings:"));
+ LOG("Remaining lwc strings:");
lwc_iterate_strings(netsurf_lwc_iterator, NULL);
return 0;
diff --git a/utils/container.c b/utils/container.c
index e5894ec7e..5946d12f9 100644
--- a/utils/container.c
+++ b/utils/container.c
@@ -85,26 +85,26 @@ inline static size_t container_filelen(FILE *fd)
o = ftell(fd);
if (o == -1) {
- LOG(("Could not get current stream position"));
+ LOG("Could not get current stream position");
return 0;
}
if (fseek(fd, 0, SEEK_END) != 0) {
- LOG(("Could not get seek to end of file"));
+ LOG("Could not get seek to end of file");
return 0;
}
a = ftell(fd);
if (fseek(fd, o, SEEK_SET) != 0) {
- LOG(("Could not reset seek position in file"));
+ LOG("Could not reset seek position in file");
return 0;
}
if (a == -1) {
- LOG(("could not ascertain size of file in theme container; omitting"));
+ LOG("could not ascertain size of file in theme container; omitting");
return 0;
}
if (((unsigned long) a) > SIZE_MAX) {
- LOG(("overlarge file in theme container; possible truncation"));
+ LOG("overlarge file in theme container; possible truncation");
return SIZE_MAX;
}
return (size_t) a;
@@ -155,24 +155,24 @@ struct container_ctx *container_open(const char *filename)
val = fread(&ctx->header.magic, 4, 1, ctx->fh);
if (val == 0)
- LOG(("empty read magic"));
+ LOG("empty read magic");
ctx->header.magic = ntohl(ctx->header.magic);
val = fread(&ctx->header.parser, 4, 1, ctx->fh);
if (val == 0)
- LOG(("empty read parser"));
+ LOG("empty read parser");
ctx->header.parser = ntohl(ctx->header.parser);
val = fread(ctx->header.name, 32, 1, ctx->fh);
if (val == 0)
- LOG(("empty read name"));
+ LOG("empty read name");
val = fread(ctx->header.author, 64, 1, ctx->fh);
if (val == 0)
- LOG(("empty read author"));
+ LOG("empty read author");
val = fread(&ctx->header.diroffset, 4, 1, ctx->fh);
if (val == 0)
- LOG(("empty read diroffset"));
+ LOG("empty read diroffset");
ctx->header.diroffset = ntohl(ctx->header.diroffset);
if (ctx->header.magic != 0x4e53544d || ctx->header.parser != 3) {
@@ -200,7 +200,7 @@ static void container_process(struct container_ctx *ctx)
}
val = fread(ctx->data, ctx->header.diroffset, 1, ctx->fh);
if (val == 0)
- LOG(("empty read diroffset"));
+ LOG("empty read diroffset");
#endif
if (fseek(ctx->fh, ctx->header.diroffset, SEEK_SET) != 0) {
return;
@@ -212,7 +212,7 @@ static void container_process(struct container_ctx *ctx)
do {
val = fread(filename, 64, 1, ctx->fh);
if (val == 0)
- LOG(("empty read filename"));
+ LOG("empty read filename");
BEREAD(start);
BEREAD(len);
BEREAD(flags1);
@@ -300,7 +300,7 @@ static void container_write_dir(struct container_ctx *ctx)
struct container_dirent *e = ctx->directory + i - 1;
val = fwrite(e->filename, 64, 1, ctx->fh);
if (val == 0)
- LOG(("empty write filename"));
+ LOG("empty write filename");
BEWRITE(e->startoffset);
BEWRITE(e->len);
BEWRITE(e->flags1);
@@ -311,7 +311,7 @@ static void container_write_dir(struct container_ctx *ctx)
tmp = 0;
val = fwrite(&tmp, 4, 8, ctx->fh);
if (val == 0)
- LOG(("empty write end"));
+ LOG("empty write end");
}
struct container_ctx *container_create(const char *filename,
@@ -343,16 +343,16 @@ struct container_ctx *container_create(const char *filename,
val = fwrite("NSTM", 4, 1, ctx->fh);
if (val == 0)
- LOG(("empty write NSTM"));
+ LOG("empty write NSTM");
val = fwrite(&ctx->header.parser, 4, 1, ctx->fh);
if (val == 0)
- LOG(("empty write parser"));
+ LOG("empty write parser");
val = fwrite(ctx->header.name, 32, 1, ctx->fh);
if (val == 0)
- LOG(("empty write name"));
+ LOG("empty write name");
val = fwrite(ctx->header.author, 64, 1, ctx->fh);
if (val == 0)
- LOG(("empty write author"));
+ LOG("empty write author");
ctx->header.diroffset = 108;
@@ -361,7 +361,7 @@ struct container_ctx *container_create(const char *filename,
*/
if (fseek(ctx->fh, 108, SEEK_SET) == -1) {
- LOG(("directory offset seek failed"));
+ LOG("directory offset seek failed");
free(ctx);
return NULL;
}
@@ -377,7 +377,7 @@ void container_add(struct container_ctx *ctx, const unsigned char *entryname,
container_add_to_dir(ctx, entryname, ftell(ctx->fh), datalen);
val = fwrite(data, datalen, 1, ctx->fh);
if (val == 0)
- LOG(("empty write add file"));
+ LOG("empty write add file");
}
void container_close(struct container_ctx *ctx)
@@ -394,7 +394,7 @@ void container_close(struct container_ctx *ctx)
nflen = htonl(flen);
val = fwrite(&nflen, 4, 1, ctx->fh);
if (val == 0)
- LOG(("empty write directory location"));
+ LOG("empty write directory location");
/* seek to where the directory will be, and write it */
if (fseek(ctx->fh, flen, SEEK_SET) == 0) {
@@ -448,8 +448,8 @@ char *container_extract_theme(const char *themefile, const char *dirbasename)
container_close(cctx);
return NULL;
}
- LOG(("theme name: %s", themename));
- LOG(("theme author: %s", container_get_author(cctx)));
+ LOG("theme name: %s", themename);
+ LOG("theme author: %s", container_get_author(cctx));
dirname = malloc(strlen(dirbasename) + strlen(themename) + 2);
if (dirname == NULL) {
@@ -478,7 +478,7 @@ char *container_extract_theme(const char *themefile, const char *dirbasename)
for (e = container_iterate(cctx, &state), i = 0; i < cctx->entries;
e = container_iterate(cctx, &state), i++) {
- LOG(("extracting %s", e));
+ LOG("extracting %s", e);
snprintf(path, PATH_MAX, "%s/%s", dirname, e);
fh = fopen(path, "wb");
if (fh == NULL) {
@@ -487,11 +487,11 @@ char *container_extract_theme(const char *themefile, const char *dirbasename)
d = container_get(cctx, e, &flen);
val = fwrite(d, flen, 1, fh);
if (val == 0)
- LOG(("empty write"));
+ LOG("empty write");
fclose(fh);
}
}
- LOG(("theme container unpacked"));
+ LOG("theme container unpacked");
container_close(cctx);
free(dirname);
return themename;
diff --git a/utils/filename.c b/utils/filename.c
index 5efd56177..19ee03968 100644
--- a/utils/filename.c
+++ b/utils/filename.c
@@ -85,7 +85,7 @@ const char *filename_request(void)
/* no available slots - create a new directory */
dir = filename_create_directory(NULL);
if (dir == NULL) {
- LOG(("Failed to create a new directory."));
+ LOG("Failed to create a new directory.");
return NULL;
}
i = 63;
@@ -183,11 +183,10 @@ bool filename_initialise(void)
for (start = directory; *start != '\0'; start++) {
if (*start == '/') {
*start = '\0';
- LOG(("Creating \"%s\"", directory));
+ LOG("Creating \"%s\"", directory);
ret = nsmkdir(directory, S_IRWXU);
if (ret != 0 && errno != EEXIST) {
- LOG(("Failed to create directory \"%s\"",
- directory));
+ LOG("Failed to create directory \"%s\"", directory);
free(directory);
return false;
}
@@ -196,7 +195,7 @@ bool filename_initialise(void)
}
}
- LOG(("Temporary directory location: %s", directory));
+ LOG("Temporary directory location: %s", directory);
ret = nsmkdir(directory, S_IRWXU);
free(directory);
@@ -282,7 +281,7 @@ bool filename_flush_directory(const char *folder, int depth)
child[sizeof(child) - 1] = '\0';
if (stat(child, &statbuf) == -1) {
- LOG(("Unable to stat %s: %s", child, strerror(errno)));
+ LOG("Unable to stat %s: %s", child, strerror(errno));
continue;
}
@@ -350,7 +349,7 @@ bool filename_flush_directory(const char *folder, int depth)
filename_delete_recursive(child);
if (remove(child))
- LOG(("Failed to remove '%s'", child));
+ LOG("Failed to remove '%s'", child);
else
changed = true;
} else {
@@ -389,7 +388,7 @@ bool filename_delete_recursive(char *folder)
child[sizeof(child) - 1] = '\0';
if (stat(child, &statbuf) == -1) {
- LOG(("Unable to stat %s: %s", child, strerror(errno)));
+ LOG("Unable to stat %s: %s", child, strerror(errno));
continue;
}
@@ -401,7 +400,7 @@ bool filename_delete_recursive(char *folder)
}
if (remove(child)) {
- LOG(("Failed to remove '%s'", child));
+ LOG("Failed to remove '%s'", child);
closedir(parent);
return false;
}
@@ -467,7 +466,7 @@ static struct directory *filename_create_directory(const char *prefix)
/* allocate a new directory */
new_dir = malloc(sizeof(struct directory));
if (new_dir == NULL) {
- LOG(("No memory for malloc()"));
+ LOG("No memory for malloc()");
return NULL;
}
@@ -501,8 +500,7 @@ static struct directory *filename_create_directory(const char *prefix)
* whilst we are running if there is an error, so we
* don't report this yet and try to create the
* structure normally. */
- LOG(("Failed to create optimised structure '%s'",
- filename_directory));
+ LOG("Failed to create optimised structure '%s'", filename_directory);
}
}
@@ -522,8 +520,7 @@ static struct directory *filename_create_directory(const char *prefix)
if (!is_dir(filename_directory)) {
if (nsmkdir(filename_directory, S_IRWXU)) {
- LOG(("Failed to create directory '%s'",
- filename_directory));
+ LOG("Failed to create directory '%s'", filename_directory);
return NULL;
}
}
diff --git a/utils/hashtable.c b/utils/hashtable.c
index 23b83b32e..d807904a2 100644
--- a/utils/hashtable.c
+++ b/utils/hashtable.c
@@ -87,7 +87,7 @@ struct hash_table *hash_create(unsigned int chains)
struct hash_table *r = malloc(sizeof(struct hash_table));
if (r == NULL) {
- LOG(("Not enough memory for hash table."));
+ LOG("Not enough memory for hash table.");
return NULL;
}
@@ -95,7 +95,7 @@ struct hash_table *hash_create(unsigned int chains)
r->chain = calloc(chains, sizeof(struct hash_entry *));
if (r->chain == NULL) {
- LOG(("Not enough memory for %d hash table chains.", chains));
+ LOG("Not enough memory for %d hash table chains.", chains);
free(r);
return NULL;
}
@@ -156,7 +156,7 @@ bool hash_add(struct hash_table *ht, const char *key, const char *value)
e = malloc(sizeof(struct hash_entry));
if (e == NULL) {
- LOG(("Not enough memory for hash entry."));
+ LOG("Not enough memory for hash entry.");
return false;
}
@@ -166,7 +166,7 @@ bool hash_add(struct hash_table *ht, const char *key, const char *value)
v = strlen(value) ;
e->pairing = malloc(v + e->key_length + 2);
if (e->pairing == NULL) {
- LOG(("Not enough memory for string duplication."));
+ LOG("Not enough memory for string duplication.");
free(e);
return false;
}
diff --git a/utils/idna.c b/utils/idna.c
index b8bfbd13c..d8d4ae497 100644
--- a/utils/idna.c
+++ b/utils/idna.c
@@ -60,17 +60,17 @@ static nserror punycode_status_to_nserror(enum punycode_status status)
break;
case punycode_bad_input:
- LOG(("Bad input"));
+ LOG("Bad input");
ret = NSERROR_BAD_ENCODING;
break;
case punycode_big_output:
- LOG(("Output too big"));
+ LOG("Output too big");
ret = NSERROR_BAD_SIZE;
break;
case punycode_overflow:
- LOG(("Overflow"));
+ LOG("Overflow");
ret = NSERROR_NOSPACE;
break;
@@ -434,7 +434,7 @@ static bool idna__is_valid(int32_t *label, size_t len)
/* 2. Check characters 3 and 4 are not '--'. */
if ((label[2] == 0x002d) && (label[3] == 0x002d)) {
- LOG(("Check failed: characters 2 and 3 are '--'"));
+ LOG("Check failed: characters 2 and 3 are '--'");
return false;
}
@@ -444,7 +444,7 @@ static bool idna__is_valid(int32_t *label, size_t len)
if ((unicode_props->category == UTF8PROC_CATEGORY_MN) ||
(unicode_props->category == UTF8PROC_CATEGORY_MC) ||
(unicode_props->category == UTF8PROC_CATEGORY_ME)) {
- LOG(("Check failed: character 0 is a combining mark"));
+ LOG("Check failed: character 0 is a combining mark");
return false;
}
@@ -453,14 +453,14 @@ static bool idna__is_valid(int32_t *label, size_t len)
/* 4. Check characters not DISALLOWED by RFC5892 */
if (idna_prop == IDNA_P_DISALLOWED) {
- LOG(("Check failed: character %d (%x) is DISALLOWED", i, label[i]));
+ LOG("Check failed: character %zd (%x) is DISALLOWED", i, label[i]);
return false;
}
/* 5. Check CONTEXTJ characters conform to defined rules */
if (idna_prop == IDNA_P_CONTEXTJ) {
if (idna__contextj_rule(label, i, len) == false) {
- LOG(("Check failed: character %d (%x) does not conform to CONTEXTJ rule", i, label[i]));
+ LOG("Check failed: character %zd (%x) does not conform to CONTEXTJ rule", i, label[i]);
return false;
}
}
@@ -469,14 +469,14 @@ static bool idna__is_valid(int32_t *label, size_t len)
/** \todo optionally we can check conformance to this rule */
if (idna_prop == IDNA_P_CONTEXTO) {
if (idna__contexto_rule(label[i]) == false) {
- LOG(("Check failed: character %d (%x) has no CONTEXTO rule defined", i, label[i]));
+ LOG("Check failed: character %zd (%x) has no CONTEXTO rule defined", i, label[i]);
return false;
}
}
/* 7. Check characters are not UNASSIGNED */
if (idna_prop == IDNA_P_UNASSIGNED) {
- LOG(("Check failed: character %d (%x) is UNASSIGNED", i, label[i]));
+ LOG("Check failed: character %zd (%x) is UNASSIGNED", i, label[i]);
return false;
}
@@ -585,7 +585,7 @@ static bool idna__verify(const char *label, size_t len)
return true;
}
- LOG(("Re-encoded ACE label %s does not match input", ace));
+ LOG("Re-encoded ACE label %s does not match input", ace);
free(ace);
return false;
@@ -638,7 +638,7 @@ idna_encode(const char *host, size_t len, char **ace_host, size_t *ace_len)
/* This is already a DNS-valid ASCII string */
if ((idna__is_ace(host, label_len) == true) &&
(idna__verify(host, label_len) == false)) {
- LOG(("Cannot verify ACE label %s", host));
+ LOG("Cannot verify ACE label %s", host);
return NSERROR_BAD_URL;
}
strncpy(fqdn_p, host, label_len);
diff --git a/utils/log.h b/utils/log.h
index 673419b66..1fd1415fd 100644
--- a/utils/log.h
+++ b/utils/log.h
@@ -44,7 +44,7 @@ typedef bool(nslog_ensure_t)(FILE *fptr);
extern nserror nslog_init(nslog_ensure_t *ensure, int *pargc, char **argv);
#ifdef NDEBUG
-# define LOG(x) ((void) 0)
+# define LOG(format, ...) ((void) 0)
#else
/**
@@ -53,7 +53,8 @@ extern nserror nslog_init(nslog_ensure_t *ensure, int *pargc, char **argv);
* \return formatted string of the time since first log call
*/
extern const char *nslog_gettime(void);
-extern void nslog_log(const char *format, ...);
+
+extern void nslog_log(const char *format, ...) __attribute__ ((format (printf, 1, 2)));
# ifdef __GNUC__
# define LOG_FN __PRETTY_FUNCTION__
@@ -66,12 +67,12 @@ extern void nslog_log(const char *format, ...);
# define LOG_LN __LINE__
# endif
-#define LOG(x) \
+#define LOG(format, args...) \
do { \
if (verbose_log) { \
nslog_log("%s " __FILE__ " %s %i: ", \
nslog_gettime(), LOG_FN, LOG_LN); \
- nslog_log x; \
+ nslog_log(format , ##args); \
nslog_log("\n"); \
} \
} while(0)
diff --git a/utils/messages.c b/utils/messages.c
index c6232979d..78b9a79f0 100644
--- a/utils/messages.c
+++ b/utils/messages.c
@@ -61,8 +61,7 @@ static nserror messages_load_ctx(const char *path, struct hash_table **ctx)
fp = gzopen(path, "r");
if (!fp) {
- LOG(("Unable to open messages file \"%.100s\": %s",
- path, strerror(errno)));
+ LOG("Unable to open messages file \"%.100s\": %s", path, strerror(errno));
return NSERROR_NOT_FOUND;
}
@@ -77,7 +76,7 @@ static nserror messages_load_ctx(const char *path, struct hash_table **ctx)
nctx = *ctx;
}
if (nctx == NULL) {
- LOG(("Unable to create hash table for messages file %s", path));
+ LOG("Unable to create hash table for messages file %s", path);
gzclose(fp);
return NSERROR_NOMEM;
}
@@ -96,8 +95,7 @@ static nserror messages_load_ctx(const char *path, struct hash_table **ctx)
value = colon + 1;
if (hash_add(nctx, s, value) == false) {
- LOG(("Unable to add %s:%s to hash table of %s",
- s, value, path));
+ LOG("Unable to add %s:%s to hash table of %s", s, value, path);
gzclose(fp);
if (*ctx == NULL) {
hash_destroy(nctx);
@@ -151,7 +149,7 @@ nserror messages_load(const char *path)
if (path == NULL) {
err = NSERROR_BAD_PARAMETER;
} else {
- LOG(("Loading Messages from '%s'", path));
+ LOG("Loading Messages from '%s'", path);
err = messages_load_ctx(path, &messages_hash);
}
@@ -176,7 +174,7 @@ char *messages_get_buff(const char *key, ...)
buff = malloc(buff_len + 1);
if (buff == NULL) {
- LOG(("malloc failed"));
+ LOG("malloc failed");
warn_user("NoMemory", 0);
} else {
va_start(ap, key);
diff --git a/utils/nsoption.c b/utils/nsoption.c
index 72a591d04..416e18dd7 100644
--- a/utils/nsoption.c
+++ b/utils/nsoption.c
@@ -601,11 +601,11 @@ nsoption_read(const char *path, struct nsoption_s *opts)
fp = fopen(path, "r");
if (!fp) {
- LOG(("Failed to open file '%s'", path));
+ LOG("Failed to open file '%s'", path);
return NSERROR_NOT_FOUND;
}
- LOG(("Successfully opened '%s' for Options file", path));
+ LOG("Successfully opened '%s' for Options file", path);
while (fgets(s, 100, fp)) {
char *colon, *value;
@@ -667,7 +667,7 @@ nsoption_write(const char *path,
fp = fopen(path, "w");
if (!fp) {
- LOG(("failed to open file '%s' for writing", path));
+ LOG("failed to open file '%s' for writing", path);
return NSERROR_NOT_FOUND;
}
@@ -737,7 +737,7 @@ nsoption_commandline(int *pargc, char **argv, struct nsoption_s *opts)
/* arg+arglen is the option to set, val is the value */
- LOG(("%.*s = %s", arglen, arg, val));
+ LOG("%.*s = %s", arglen, arg, val);
for (entry_loop = 0;
entry_loop < NSOPTION_LISTEND;
diff --git a/utils/nsurl.c b/utils/nsurl.c
index 8e3c21132..e0e147229 100644
--- a/utils/nsurl.c
+++ b/utils/nsurl.c
@@ -511,19 +511,19 @@ static void nsurl__get_string_markers(const char * const url_s,
}
#ifdef NSURL_DEBUG
- LOG(("marker.start: %i", marker.start));
- LOG(("marker.scheme_end: %i", marker.scheme_end));
- LOG(("marker.authority: %i", marker.authority));
+ LOG("marker.start: %i", marker.start);
+ LOG("marker.scheme_end: %i", marker.scheme_end);
+ LOG("marker.authority: %i", marker.authority);
- LOG(("marker.colon_first: %i", marker.colon_first));
- LOG(("marker.at: %i", marker.at));
- LOG(("marker.colon_last: %i", marker.colon_last));
+ LOG("marker.colon_first: %i", marker.colon_first);
+ LOG("marker.at: %i", marker.at);
+ LOG("marker.colon_last: %i", marker.colon_last);
- LOG(("marker.path: %i", marker.path));
- LOG(("marker.query: %i", marker.query));
- LOG(("marker.fragment: %i", marker.fragment));
+ LOG("marker.path: %i", marker.path);
+ LOG("marker.query: %i", marker.query);
+ LOG("marker.fragment: %i", marker.fragment);
- LOG(("marker.end: %i", marker.end));
+ LOG("marker.end: %i", marker.end);
#endif
/* Got all the URL components pegged out now */
@@ -545,8 +545,8 @@ static size_t nsurl__remove_dot_segments(char *path, char *output)
while (*path_pos != '\0') {
#ifdef NSURL_DEBUG
- LOG((" in:%s", path_pos));
- LOG(("out:%.*s", output_pos - output, output));
+ LOG(" in:%s", path_pos);
+ LOG("out:%.*s", output_pos - output, output);
#endif
if (*path_pos == '.') {
if (*(path_pos + 1) == '.' &&
@@ -1314,31 +1314,28 @@ static void nsurl_destroy_components(struct nsurl_components *c)
static void nsurl__dump(const nsurl *url)
{
if (url->components.scheme)
- LOG((" Scheme: %s", lwc_string_data(url->components.scheme)));
+ LOG(" Scheme: %s", lwc_string_data(url->components.scheme));
if (url->components.username)
- LOG(("Username: %s",
- lwc_string_data(url->components.username)));
+ LOG("Username: %s", lwc_string_data(url->components.username));
if (url->components.password)
- LOG(("Password: %s",
- lwc_string_data(url->components.password)));
+ LOG("Password: %s", lwc_string_data(url->components.password));
if (url->components.host)
- LOG((" Host: %s", lwc_string_data(url->components.host)));
+ LOG(" Host: %s", lwc_string_data(url->components.host));
if (url->components.port)
- LOG((" Port: %s", lwc_string_data(url->components.port)));
+ LOG(" Port: %s", lwc_string_data(url->components.port));
if (url->components.path)
- LOG((" Path: %s", lwc_string_data(url->components.path)));
+ LOG(" Path: %s", lwc_string_data(url->components.path));
if (url->components.query)
- LOG((" Query: %s", lwc_string_data(url->components.query)));
+ LOG(" Query: %s", lwc_string_data(url->components.query));
if (url->components.fragment)
- LOG(("Fragment: %s",
- lwc_string_data(url->components.fragment)));
+ LOG("Fragment: %s", lwc_string_data(url->components.fragment));
}
#endif
@@ -1608,7 +1605,7 @@ lwc_string *nsurl_get_component(const nsurl *url, nsurl_component part)
lwc_string_ref(url->components.fragment) : NULL;
default:
- LOG(("Unsupported value passed to part param."));
+ LOG("Unsupported value passed to part param.");
assert(0);
}
@@ -1674,7 +1671,7 @@ bool nsurl_has_component(const nsurl *url, nsurl_component part)
return false;
default:
- LOG(("Unsupported value passed to part param."));
+ LOG("Unsupported value passed to part param.");
assert(0);
}
@@ -1766,7 +1763,7 @@ nserror nsurl_join(const nsurl *base, const char *rel, nsurl **joined)
assert(rel != NULL);
#ifdef NSURL_DEBUG
- LOG(("base: \"%s\", rel: \"%s\"", nsurl_access(base), rel));
+ LOG("base: \"%s\", rel: \"%s\"", nsurl_access(base), rel);
#endif
/* Peg out the URL sections */
diff --git a/utils/useragent.c b/utils/useragent.c
index 16ed67a75..72e45aada 100644
--- a/utils/useragent.c
+++ b/utils/useragent.c
@@ -65,7 +65,7 @@ user_agent_build_string(void)
core_user_agent_string = ua_string;
- LOG(("Built user agent \"%s\"", core_user_agent_string));
+ LOG("Built user agent \"%s\"", core_user_agent_string);
}
/* This is a function so that later we can override it trivially */