diff options
author | Vincent Sanders <vince@kyllikki.org> | 2015-05-28 16:08:46 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2015-05-28 16:08:46 +0100 |
commit | c105738fa36bb2400adc47399c5b878d252d1c86 (patch) | |
tree | 138eeb449e1bf51ee1726b5f820740aada0ccd0b /riscos/content-handlers | |
parent | 20f2c86a511f7913cf858e7bd3668b0b59663ba0 (diff) | |
download | netsurf-c105738fa36bb2400adc47399c5b878d252d1c86.tar.gz netsurf-c105738fa36bb2400adc47399c5b878d252d1c86.tar.bz2 |
Change LOG() macro to be varadic
This changes the LOG macro to be varadic removing the need for all
callsites to have double bracketing and allows for future improvement
on how we use the logging macros.
The callsites were changed with coccinelle and the changes checked by
hand. Compile tested for several frontends but not all.
A formatting annotation has also been added which allows the compiler
to check the parameters and types passed to the logging.
Diffstat (limited to 'riscos/content-handlers')
-rw-r--r-- | riscos/content-handlers/artworks.c | 30 | ||||
-rw-r--r-- | riscos/content-handlers/draw.c | 6 | ||||
-rw-r--r-- | riscos/content-handlers/sprite.c | 3 |
3 files changed, 14 insertions, 25 deletions
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; |