summaryrefslogtreecommitdiff
path: root/desktop/font_haru.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 /desktop/font_haru.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 'desktop/font_haru.c')
-rw-r--r--desktop/font_haru.c13
1 files changed, 5 insertions, 8 deletions
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;