]> diplodocus.org Git - nmh/commitdiff
Add gcc's const function attribute.
authorRalph Corderoy <ralph@inputplus.co.uk>
Sat, 26 Aug 2017 16:36:31 +0000 (17:36 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Sat, 26 Aug 2017 17:01:48 +0000 (18:01 +0100)
h/mh.h
h/mhparse.h
h/prototypes.h

diff --git a/h/mh.h b/h/mh.h
index e9460db..2a4ce61 100644 (file)
--- a/h/mh.h
+++ b/h/mh.h
@@ -37,12 +37,14 @@ typedef unsigned char  boolean;  /* not int so we can pack in a structure */
 #define CHECK_PRINTF(fmt, arg) __attribute__((format(printf, fmt, arg)))
 #define ALLOC_SIZE(n) __attribute__((alloc_size(n)))
 #define ALLOC_SIZE2(m, n) __attribute__((alloc_size(m, n)))
+#define CONST __attribute__((const))
 #define NMH_UNUSED(i) (void) i
 #else
 #define NORETURN
 #define CHECK_PRINTF(fmt, arg)
 #define ALLOC_SIZE(n)
 #define ALLOC_SIZE2(m, n)
+#define CONST
 #define NMH_UNUSED(i) i
 #endif
 
index 256586f..b96ce65 100644 (file)
@@ -357,12 +357,12 @@ int get_ctinfo (char *, CT, int);
 int params_external (CT, int);
 int open7Bit (CT, char **);
 void close_encoding (CT);
-char *ct_type_str (int);
-char *ct_subtype_str (int, int);
+char *ct_type_str (int) CONST;
+char *ct_subtype_str (int, int) CONST;
 int ct_str_type (const char *);
 int ct_str_subtype (int, const char *);
 const struct str2init *get_ct_init (int);
-const char *ce_str (int);
+const char *ce_str (int) CONST;
 const struct str2init *get_ce_method (const char *);
 char *content_charset (CT);
 void reverse_alternative_parts (CT);
index 7caa3d0..29ca1dd 100644 (file)
@@ -70,7 +70,7 @@ void discard (FILE *);
  *
  * Returns the decoded value, -1 if the conversion failed.
  */
-int decode_qp(unsigned char byte1, unsigned char byte2);
+int decode_qp(unsigned char byte1, unsigned char byte2) CONST;
 
 int default_done (int);