summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-09-08 20:38:10 +0200
committerMattias Andrée <maandree@kth.se>2021-09-08 20:38:10 +0200
commitfdca119565bb551ed327d7440cc1cc29264d6254 (patch)
tree8de20d3b6eb395144d57f52d3cb00a1439efe120
parentm (diff)
downloadlibnumtext-fdca119565bb551ed327d7440cc1cc29264d6254.tar.gz
libnumtext-fdca119565bb551ed327d7440cc1cc29264d6254.tar.bz2
libnumtext-fdca119565bb551ed327d7440cc1cc29264d6254.tar.xz
Suppress warnings
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r--common.h6
-rw-r--r--swedish.c11
2 files changed, 16 insertions, 1 deletions
diff --git a/common.h b/common.h
index e23ebb7..7fb6784 100644
--- a/common.h
+++ b/common.h
@@ -21,6 +21,12 @@
# define FALL_THROUGH
#endif
+#if defined(__GNUC__)
+# define PURE __attribute__((pure))
+#else
+# define PURE
+#endif
+
#define UNICODE_MINUS "−"
diff --git a/swedish.c b/swedish.c
index 8790bd0..15e44d5 100644
--- a/swedish.c
+++ b/swedish.c
@@ -2,6 +2,11 @@
#include "common.h"
+#if defined(__GNUC__)
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wunused-macros"
+#endif
+
#define TYPE_INDEX(F) (ORDINAL(F) | DENOMINATOR(F))
#define FORM_INDEX(F) ((PLURAL_FORM(F) | DEFINITE_FORM(F)) / LIBNUMTEXT_N2T_SWEDISH_PLURAL_FORM)
@@ -49,6 +54,10 @@
#define INVALID_BITS(F) ((F) & (uint32_t)~UINT32_C(0x00003FFF))
+#if defined(__GNUC__)
+# pragma GCC diagnostic pop
+#endif
+
static struct digit {
const char *cardinal_common;
@@ -279,7 +288,7 @@ append_thousands(struct state *state, int ten_thousands, int one_thousands)
}
-static char
+PURE static char
get_common_affix(const char *suffixes, const char *prefixes)
{
const char *s, *p;