aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2023-02-28 16:13:59 +0100
committerSimon Ser <contact@emersion.fr>2023-04-14 18:34:54 +0200
commitbd58df61efbb86cd43682acfd7cde8085b503590 (patch)
treee03108b4a06bc940d0a1f03a9b6696b2ca93e420 /include
parentaab4c9da5fb4138ca5f07df8bd8b698d02242a62 (diff)
pango: add printf attribute
This allows the compiler to catch mismatches between the format string and the arguments passed in. Need to add -Wno-format-zero-length because we pass an empty string on purpose in swaybar/render.c.
Diffstat (limited to 'include')
-rw-r--r--include/pango.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/pango.h b/include/pango.h
index 1db113c2..228e39cf 100644
--- a/include/pango.h
+++ b/include/pango.h
@@ -5,6 +5,7 @@
#include <stdint.h>
#include <cairo.h>
#include <pango/pangocairo.h>
+#include "stringop.h"
/**
* Utility function which escape characters a & < > ' ".
@@ -16,9 +17,9 @@ size_t escape_markup_text(const char *src, char *dest);
PangoLayout *get_pango_layout(cairo_t *cairo, const PangoFontDescription *desc,
const char *text, double scale, bool markup);
void get_text_size(cairo_t *cairo, const PangoFontDescription *desc, int *width, int *height,
- int *baseline, double scale, bool markup, const char *fmt, ...);
+ int *baseline, double scale, bool markup, const char *fmt, ...) _SWAY_ATTRIB_PRINTF(8, 9);
void get_text_metrics(const PangoFontDescription *desc, int *height, int *baseline);
void render_text(cairo_t *cairo, PangoFontDescription *desc,
- double scale, bool markup, const char *fmt, ...);
+ double scale, bool markup, const char *fmt, ...) _SWAY_ATTRIB_PRINTF(5, 6);
#endif