aboutsummaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-01-28 09:19:05 +0100
committerMattias Andrée <maandree@kth.se>2023-01-28 09:31:28 +0100
commit575e3ad31dd8ccf2afdd5c8a8d2dbf8d57241c5d (patch)
tree45b154e54eb7caa0300e5176237cb84257da138e /common.h
parentlibglitter.7: add application usage section (diff)
downloadlibglitter-00563bacd66f674a9d0047cd7b8dc5bd414812eb.tar.gz
libglitter-00563bacd66f674a9d0047cd7b8dc5bd414812eb.tar.bz2
libglitter-00563bacd66f674a9d0047cd7b8dc5bd414812eb.tar.xz
Fix warnings, add restrict, and add function attributes1.0
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'common.h')
-rw-r--r--common.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/common.h b/common.h
index e36f7b9..3a70c71 100644
--- a/common.h
+++ b/common.h
@@ -12,6 +12,21 @@
#include <string.h>
+#if defined(__GNUC__) && !defined(__clang__)
+# pragma GCC diagnostic ignored "-Wunsuffixed-float-constants"
+# pragma GCC diagnostic ignored "-Wunused-macros"
+# pragma GCC diagnostic ignored "-Wpadded"
+#elif defined(__clang__)
+# pragma clang diagnostic ignored "-Wunused-macros"
+# pragma clang diagnostic ignored "-Wkeyword-macro"
+# pragma clang diagnostic ignored "-Walloca"
+# pragma clang diagnostic ignored "-Wdisabled-macro-expansion"
+# pragma clang diagnostic ignored "-Wcomma"
+# pragma clang diagnostic ignored "-Wpadded"
+# pragma clang diagnostic ignored "-Wvla"
+#endif
+
+
#define RENDER_METHOD_VSTRIPS 0
#define RENDER_METHOD_HSTRIPS 1
#define RENDER_METHOD_SIMPLE 2
@@ -34,6 +49,16 @@ struct libglitter_render_context {
#ifdef TEST
+#if defined(__GNUC__) && !defined(__clang__)
+# pragma GCC diagnostic ignored "-Wfloat-equal"
+# pragma GCC diagnostic ignored "-Wfloat-conversion"
+# pragma GCC diagnostic ignored "-Wdouble-promotion"
+#elif defined(__clang__)
+# pragma clang diagnostic ignored "-Wfloat-equal"
+# pragma clang diagnostic ignored "-Wdouble-promotion"
+# pragma clang diagnostic ignored "-Wimplicit-float-conversion"
+#endif
+
# define ASSERT(ASSERTION)\
do {\
if (!(ASSERTION)) {\