aboutsummaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-01-08 22:19:02 +0100
committerMattias Andrée <maandree@kth.se>2023-01-08 22:19:02 +0100
commit603142e23528061e7ba5bdbcb466e676237745a8 (patch)
treecbcff6a1032d056e1e7b87846fdcc96248b932a7 /common.h
parentPartially implement libfonts_get_default_font, libfonts_get_{default,output}_rendering_settings (diff)
downloadlibfonts-603142e23528061e7ba5bdbcb466e676237745a8.tar.gz
libfonts-603142e23528061e7ba5bdbcb466e676237745a8.tar.bz2
libfonts-603142e23528061e7ba5bdbcb466e676237745a8.tar.xz
Fix warnings
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'common.h')
-rw-r--r--common.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/common.h b/common.h
index 082f806..0759f5c 100644
--- a/common.h
+++ b/common.h
@@ -15,6 +15,7 @@
#define DOUBLE_TOLERANCE 0.000001
+
#define LIST_RENDERING_SETTINGS(X, _)\
X(0, "dpi-x", dpi_x, 96, libfonts_parse_double__) _\
X(1, "dpi-y", dpi_y, 96, libfonts_parse_double__) _\
@@ -43,12 +44,21 @@ transform(double *x_out, double *y_out, double x, double y, const struct libfont
}
+#if defined(__GNUC__) && !defined(__clang__)
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wunsuffixed-float-constants"
+#endif
+
static inline int
eq(double a, double b)
{
return b - DOUBLE_TOLERANCE <= a && a <= b + DOUBLE_TOLERANCE;
}
+#if defined(__GNUC__) && !defined(__clang__)
+# pragma GCC diagnostic pop
+#endif
+
const char *libfonts_getenv__(const char *name, struct libfonts_context *ctx);
char *libfonts_gethome__(struct libfonts_context *ctx);
@@ -66,9 +76,14 @@ int libfonts_parse_aa__(enum libfonts_antialiasing *outp, const char *value);
# define ASSERT(ASSERTION)\
do {\
if (!(ASSERTION)) {\
- fprintf(stderr, "Failed assertion at line %u: %s\n", __LINE__, #ASSERTION);\
+ fprintf(stderr, "Failed assertion at line %i: %s\n", __LINE__, #ASSERTION);\
exit(1);\
}\
} while (0)
+
+#if defined(__clang__)
+# pragma clang diagnostic ignored "-Wassign-enum"
+#endif
+
#endif