summaryrefslogtreecommitdiff
path: root/windows/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 /windows/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 'windows/bitmap.c')
-rw-r--r--windows/bitmap.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/windows/bitmap.c b/windows/bitmap.c
index f7505b0c4..68dd955dd 100644
--- a/windows/bitmap.c
+++ b/windows/bitmap.c
@@ -51,7 +51,7 @@ void *win32_bitmap_create(int width, int height, unsigned int state)
HBITMAP windib;
uint8_t *pixdata;
- LOG(("width %d, height %d, state %u",width,height,state));
+ LOG("width %d, height %d, state %u", width, height, state);
pbmi = calloc(1, sizeof(BITMAPV5HEADER));
if (pbmi == NULL) {
@@ -95,7 +95,7 @@ void *win32_bitmap_create(int width, int height, unsigned int state)
bitmap->opaque = false;
}
- LOG(("bitmap %p", bitmap));
+ LOG("bitmap %p", bitmap);
return bitmap;
}
@@ -114,7 +114,7 @@ static unsigned char *bitmap_get_buffer(void *bitmap)
{
struct bitmap *bm = bitmap;
if (bitmap == NULL) {
- LOG(("NULL bitmap!"));
+ LOG("NULL bitmap!");
return NULL;
}
@@ -133,7 +133,7 @@ static size_t bitmap_get_rowstride(void *bitmap)
struct bitmap *bm = bitmap;
if (bitmap == NULL) {
- LOG(("NULL bitmap!"));
+ LOG("NULL bitmap!");
return 0;
}
@@ -151,7 +151,7 @@ void win32_bitmap_destroy(void *bitmap)
struct bitmap *bm = bitmap;
if (bitmap == NULL) {
- LOG(("NULL bitmap!"));
+ LOG("NULL bitmap!");
return;
}
@@ -194,11 +194,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;
}
@@ -215,7 +215,7 @@ static bool bitmap_test_opaque(void *bitmap)
struct bitmap *bm = bitmap;
if (bitmap == NULL) {
- LOG(("NULL bitmap!"));
+ LOG("NULL bitmap!");
return false;
}
@@ -223,11 +223,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;
}
@@ -242,7 +242,7 @@ static bool bitmap_get_opaque(void *bitmap)
struct bitmap *bm = bitmap;
if (bitmap == NULL) {
- LOG(("NULL bitmap!"));
+ LOG("NULL bitmap!");
return false;
}
@@ -254,7 +254,7 @@ static int bitmap_get_width(void *bitmap)
struct bitmap *bm = bitmap;
if (bitmap == NULL) {
- LOG(("NULL bitmap!"));
+ LOG("NULL bitmap!");
return 0;
}
@@ -266,7 +266,7 @@ static int bitmap_get_height(void *bitmap)
struct bitmap *bm = bitmap;
if (bitmap == NULL) {
- LOG(("NULL bitmap!"));
+ LOG("NULL bitmap!");
return 0;
}
@@ -368,8 +368,7 @@ static nserror bitmap_render(struct bitmap *bitmap, struct hlcache_handle *conte
height = ((width * bitmap->height) + (bitmap->width / 2)) /
bitmap->width;
- LOG(("bitmap %p for content %p width %d, height %d",
- bitmap, content, width, height));
+ LOG("bitmap %p for content %p width %d, height %d", bitmap, content, width, height);
/* create two memory device contexts to put the bitmaps in */
bufferdc = CreateCompatibleDC(NULL);