summaryrefslogtreecommitdiff
path: root/riscos/bitmap.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2015-05-28 16:08:46 +0100
committerVincent Sanders <vince@kyllikki.org>2015-05-28 16:08:46 +0100
commitc105738fa36bb2400adc47399c5b878d252d1c86 (patch)
tree138eeb449e1bf51ee1726b5f820740aada0ccd0b /riscos/bitmap.c
parent20f2c86a511f7913cf858e7bd3668b0b59663ba0 (diff)
downloadnetsurf-c105738fa36bb2400adc47399c5b878d252d1c86.tar.gz
netsurf-c105738fa36bb2400adc47399c5b878d252d1c86.tar.bz2
Change LOG() macro to be varadic
This changes the LOG macro to be varadic removing the need for all callsites to have double bracketing and allows for future improvement on how we use the logging macros. The callsites were changed with coccinelle and the changes checked by hand. Compile tested for several frontends but not all. A formatting annotation has also been added which allows the compiler to check the parameters and types passed to the logging.
Diffstat (limited to 'riscos/bitmap.c')
-rw-r--r--riscos/bitmap.c26
1 files changed, 10 insertions, 16 deletions
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) {