]> diplodocus.org Git - nmh/commitdiff
Add gcc's pure function attribute.
authorRalph Corderoy <ralph@inputplus.co.uk>
Sun, 27 Aug 2017 13:08:22 +0000 (14:08 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Sun, 27 Aug 2017 13:08:22 +0000 (14:08 +0100)
Mark quite a few function prototypes with it.

23 files changed:
h/aliasbr.h
h/fmt_scan.h
h/icalendar.h
h/mh.h
h/mhparse.h
h/netsec.h
h/oauth.h
h/prototypes.h
h/utils.h
mts/smtp/smtp.c
sbr/fmt_scan.c
sbr/lock_file.c
uip/aliasbr.c
uip/inc.c
uip/mhfixmsg.c
uip/mhical.c
uip/mhlsbr.c
uip/mhmisc.c
uip/mhparam.c
uip/mhstoresbr.c
uip/msgchk.c
uip/post.c
uip/slocal.c

index da027f5..6e7a5a3 100644 (file)
@@ -21,7 +21,7 @@ struct adr {
  * prototypes
  */
 int alias (char *);
  * prototypes
  */
 int alias (char *);
-int akvisible (void);
+int akvisible (void) PURE;
 char *akresult (struct aka *);
 char *akvalue (char *);
 char *akerror (int);
 char *akresult (struct aka *);
 char *akvalue (char *);
 char *akerror (int);
index 4f14b65..2574c57 100644 (file)
@@ -205,7 +205,7 @@ void fmt_freecomptext(void);
  * or NULL if the component is not found in the hash table.
  */
 
  * or NULL if the component is not found in the hash table.
  */
 
-struct comp *fmt_findcomp(char *component);
+struct comp *fmt_findcomp(char *component) PURE;
 
 /*
  * Search for a component structure in the component hash table.
 
 /*
  * Search for a component structure in the component hash table.
@@ -213,7 +213,7 @@ struct comp *fmt_findcomp(char *component);
  * Identical to fmd_findcomp(), but is case-INSENSITIVE.
  */
 
  * Identical to fmd_findcomp(), but is case-INSENSITIVE.
  */
 
-struct comp *fmt_findcasecomp(char *component);
+struct comp *fmt_findcasecomp(char *component) PURE;
 
 /*
  * Add a component entry to the component hash table
 
 /*
  * Add a component entry to the component hash table
index be7244e..0bedfde 100644 (file)
@@ -71,7 +71,7 @@ void add_param_name (contentline *, char *);
 void add_param_value (contentline *, char *);
 void remove_value (value_list *);
 struct contentline *find_contentline (contentline *, const char *,
 void add_param_value (contentline *, char *);
 void remove_value (value_list *);
 struct contentline *find_contentline (contentline *, const char *,
-                                      const char *);
+                                      const char *) PURE;
 void free_contentlines (contentline *);
 
 typedef struct tzdesc *tzdesc_t;
 void free_contentlines (contentline *);
 
 typedef struct tzdesc *tzdesc_t;
diff --git a/h/mh.h b/h/mh.h
index 75812a3..bb06366 100644 (file)
--- a/h/mh.h
+++ b/h/mh.h
@@ -46,6 +46,7 @@ typedef unsigned char  boolean;  /* not int so we can pack in a structure */
 #define CONST __attribute__((const))
 #define MALLOC __attribute__((malloc))
 #define NONNULL(...) __attribute__((nonnull(__VA_ARGS__)))
 #define CONST __attribute__((const))
 #define MALLOC __attribute__((malloc))
 #define NONNULL(...) __attribute__((nonnull(__VA_ARGS__)))
+#define PURE __attribute__((pure))
 #define NMH_UNUSED(i) (void) i
 #else
 #define NORETURN
 #define NMH_UNUSED(i) (void) i
 #else
 #define NORETURN
@@ -54,6 +55,7 @@ typedef unsigned char  boolean;  /* not int so we can pack in a structure */
 #define CONST
 #define MALLOC
 #define NONNULL(...)
 #define CONST
 #define MALLOC
 #define NONNULL(...)
+#define PURE
 #define NMH_UNUSED(i) i
 #endif
 
 #define NMH_UNUSED(i) i
 #endif
 
@@ -91,8 +93,8 @@ void charstring_clear (charstring_t) NONNULL(1);
 const char *charstring_buffer (const charstring_t) NONNULL(1);
 /* User is responsible for free'ing result of buffer copy. */
 char *charstring_buffer_copy (const charstring_t) NONNULL(1);
 const char *charstring_buffer (const charstring_t) NONNULL(1);
 /* User is responsible for free'ing result of buffer copy. */
 char *charstring_buffer_copy (const charstring_t) NONNULL(1);
-size_t charstring_bytes (const charstring_t) NONNULL(1);
-size_t charstring_chars (const charstring_t) NONNULL(1);
+size_t charstring_bytes (const charstring_t) NONNULL(1) PURE;
+size_t charstring_chars (const charstring_t) NONNULL(1) PURE;
 /* Length of the last character in the charstring. */
 int charstring_last_char_len (const charstring_t) NONNULL(1);
 
 /* Length of the last character in the charstring. */
 int charstring_last_char_len (const charstring_t) NONNULL(1);
 
@@ -225,8 +227,8 @@ void bvector_fini(struct bvector *bv) NONNULL(1);
 void bvector_clear (bvector_t, size_t) NONNULL(1);
 void bvector_clear_all (bvector_t) NONNULL(1);
 void bvector_set (bvector_t, size_t) NONNULL(1);
 void bvector_clear (bvector_t, size_t) NONNULL(1);
 void bvector_clear_all (bvector_t) NONNULL(1);
 void bvector_set (bvector_t, size_t) NONNULL(1);
-unsigned int bvector_at (bvector_t, size_t) NONNULL(1);
-unsigned long bvector_first_bits (bvector_t) NONNULL(1);
+unsigned int bvector_at (bvector_t, size_t) NONNULL(1) PURE;
+unsigned long bvector_first_bits (bvector_t) NONNULL(1) PURE;
 
 typedef struct svector *svector_t;
 
 
 typedef struct svector *svector_t;
 
@@ -234,9 +236,9 @@ svector_t svector_create (size_t);
 void svector_free (svector_t) NONNULL(1);
 char *svector_push_back (svector_t, char *) NONNULL(1);
 char *svector_at (svector_t, size_t) NONNULL(1);
 void svector_free (svector_t) NONNULL(1);
 char *svector_push_back (svector_t, char *) NONNULL(1);
 char *svector_at (svector_t, size_t) NONNULL(1);
-char **svector_find(svector_t, const char *) NONNULL(1);
-char **svector_strs (svector_t) NONNULL(1);
-size_t svector_size (svector_t) NONNULL(1);
+char **svector_find(svector_t, const char *) NONNULL(1) PURE;
+char **svector_strs (svector_t) NONNULL(1) PURE;
+size_t svector_size (svector_t) NONNULL(1) PURE;
 
 typedef struct ivector *ivector_t;
 
 
 typedef struct ivector *ivector_t;
 
index b96ce65..6b7ebeb 100644 (file)
@@ -359,11 +359,11 @@ int open7Bit (CT, char **);
 void close_encoding (CT);
 char *ct_type_str (int) CONST;
 char *ct_subtype_str (int, int) CONST;
 void close_encoding (CT);
 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);
+int ct_str_type (const char *) PURE;
+int ct_str_subtype (int, const char *) PURE;
+const struct str2init *get_ct_init (int) PURE;
 const char *ce_str (int) CONST;
 const char *ce_str (int) CONST;
-const struct str2init *get_ce_method (const char *);
+const struct str2init *get_ce_method (const char *) PURE;
 char *content_charset (CT);
 void reverse_alternative_parts (CT);
 
 char *content_charset (CT);
 void reverse_alternative_parts (CT);
 
@@ -375,7 +375,7 @@ void reverse_alternative_parts (CT);
  *
  * ct          - Content structure to examine
  */
  *
  * ct          - Content structure to examine
  */
-int is_inline(CT ct);
+int is_inline(CT ct) PURE;
 
 /*
  * Given a list of messages, display information about them on standard
 
 /*
  * Given a list of messages, display information about them on standard
@@ -529,6 +529,6 @@ extern int checksw; /* Add Content-MD5 field */
  */
 typedef struct mhstoreinfo *mhstoreinfo_t;
 mhstoreinfo_t mhstoreinfo_create(CT *, char *, const char *, int, int);
  */
 typedef struct mhstoreinfo *mhstoreinfo_t;
 mhstoreinfo_t mhstoreinfo_create(CT *, char *, const char *, int, int);
-int mhstoreinfo_files_not_clobbered(const mhstoreinfo_t);
+int mhstoreinfo_files_not_clobbered(const mhstoreinfo_t) PURE;
 void mhstoreinfo_free(mhstoreinfo_t);
 void store_all_messages (mhstoreinfo_t);
 void mhstoreinfo_free(mhstoreinfo_t);
 void store_all_messages (mhstoreinfo_t);
index b3018a2..0a14a1d 100644 (file)
@@ -72,7 +72,7 @@ void netsec_set_hostname(netsec_context *ns_context, const char *hostname);
  * Returns "1" if snoop is enabled, 0 if it is not.
  */
 
  * Returns "1" if snoop is enabled, 0 if it is not.
  */
 
-int netsec_get_snoop(netsec_context *ns_context);
+int netsec_get_snoop(netsec_context *ns_context) PURE;
 
 /*
  * Sets "snoop" status; if snoop is set to a nonzero value, network traffic
 
 /*
  * Sets "snoop" status; if snoop is set to a nonzero value, network traffic
@@ -352,7 +352,7 @@ int netsec_negotiate_sasl(netsec_context *ns_context, const char *mechlist,
  * supported or in use.
  */
 
  * supported or in use.
  */
 
-char *netsec_get_sasl_mechanism(netsec_context *ns_context);
+char *netsec_get_sasl_mechanism(netsec_context *ns_context) PURE;
 
 /*
  * Set the OAuth service name used to retrieve the OAuth parameters from
 
 /*
  * Set the OAuth service name used to retrieve the OAuth parameters from
index 66da2f3..1ba5314 100644 (file)
--- a/h/oauth.h
+++ b/h/oauth.h
@@ -145,7 +145,7 @@ mh_oauth_free(mh_oauth_ctx *ctx);
  * Never returns NULL.
  */
 const char *
  * Never returns NULL.
  */
 const char *
-mh_oauth_svc_display_name(const mh_oauth_ctx *ctx);
+mh_oauth_svc_display_name(const mh_oauth_ctx *ctx) PURE;
 
 /*
  * Enable logging for subsequent operations on ctx.
 
 /*
  * Enable logging for subsequent operations on ctx.
@@ -164,7 +164,7 @@ mh_oauth_log_to(FILE *log, mh_oauth_ctx *ctx);
  * Must not be called if an error was not indicated.
  */
 mh_oauth_err_code
  * Must not be called if an error was not indicated.
  */
 mh_oauth_err_code
-mh_oauth_get_err_code(const mh_oauth_ctx *ctx);
+mh_oauth_get_err_code(const mh_oauth_ctx *ctx) PURE;
 
 /*
  * Return null-terminated error message after some function indicated an error.
 
 /*
  * Return null-terminated error message after some function indicated an error.
@@ -205,7 +205,7 @@ mh_oauth_refresh(mh_oauth_cred *cred);
  * Return whether access token is present and not expired at time T.
  */
 boolean
  * Return whether access token is present and not expired at time T.
  */
 boolean
-mh_oauth_access_token_valid(time_t t, const mh_oauth_cred *cred);
+mh_oauth_access_token_valid(time_t t, const mh_oauth_cred *cred) PURE;
 
 /*
  * Free all resources associated with cred.
 
 /*
  * Free all resources associated with cred.
index 0b40c0d..a0c7806 100644 (file)
@@ -27,7 +27,7 @@ void argsplit_msgarg (struct msgs_array *, char *, char **) NONNULL(1, 2, 3);
 void argsplit_insert (struct msgs_array *, char *, char **) NONNULL(1, 2, 3);
 void arglist_free (char *, char **);
 void ambigsw (const char *, const struct swit *) NONNULL(1, 2);
 void argsplit_insert (struct msgs_array *, char *, char **) NONNULL(1, 2, 3);
 void arglist_free (char *, char **);
 void ambigsw (const char *, const struct swit *) NONNULL(1, 2);
-int atooi(char *) NONNULL(1);
+int atooi(char *) NONNULL(1) PURE;
 char **brkstring (char *, char *, char *) NONNULL(1);
 
 /*
 char **brkstring (char *, char *, char *) NONNULL(1);
 
 /*
@@ -46,9 +46,9 @@ int client(char *, char *, char *, int, int);
 void closefds(int);
 char *concat (const char *, ...);
 int context_del (char *);
 void closefds(int);
 char *concat (const char *, ...);
 int context_del (char *);
-char *context_find (const char *);
+char *context_find (const char *) PURE;
 char *context_find_by_type (const char *, const char *, const char *);
 char *context_find_by_type (const char *, const char *, const char *);
-int context_find_prefix(const char *);
+int context_find_prefix(const char *) PURE;
 int context_foil (char *);
 void context_read (void);
 void context_replace (char *, char *);
 int context_foil (char *);
 void context_read (void);
 void context_replace (char *, char *);
@@ -169,7 +169,7 @@ char *get_charset(void);
 char *getcpy(const char *str);
 
 char *get_default_editor(void);
 char *getcpy(const char *str);
 
 char *get_default_editor(void);
-char *getfolder(int);
+char *getfolder(int) PURE;
 
 /*
  * Get a string from the terminfo database for the current terminal.
 
 /*
  * Get a string from the terminfo database for the current terminal.
@@ -222,7 +222,7 @@ char *get_term_stringparm(char *capability, long arg1, long arg2);
  */
 int get_term_numcap(char *capability);
 
  */
 int get_term_numcap(char *capability);
 
-int m_atoi (char *);
+int m_atoi (char *) PURE;
 char *m_backup (const char *);
 int m_convert (struct msgs *, char *);
 char *m_draft (char *, char *, int, int *);
 char *m_backup (const char *);
 int m_convert (struct msgs *, char *);
 char *m_draft (char *, char *, int, int *);
@@ -234,7 +234,7 @@ void m_getfld_track_filepos (m_getfld_state_t *, FILE *);
 void m_getfld_track_filepos2(m_getfld_state_t *);
 int m_getfld (m_getfld_state_t *, char[NAMESZ], char *, int *, FILE *);
 int m_getfld2(m_getfld_state_t *, char[NAMESZ], char *, int *);
 void m_getfld_track_filepos2(m_getfld_state_t *);
 int m_getfld (m_getfld_state_t *, char[NAMESZ], char *, int *, FILE *);
 int m_getfld2(m_getfld_state_t *, char[NAMESZ], char *, int *);
-int m_gmprot (void);
+int m_gmprot (void) PURE;
 char *m_name (int);
 
 void m_unknown(m_getfld_state_t *, FILE *);
 char *m_name (int);
 
 void m_unknown(m_getfld_state_t *, FILE *);
@@ -255,7 +255,7 @@ void print_intro (FILE *, int);
 void print_sw (const char *, const struct swit *, char *, FILE *);
 void print_version (char *);
 void push (void);
 void print_sw (const char *, const struct swit *, char *, FILE *);
 void print_version (char *);
 void push (void);
-char *r1bindex(char *, int);
+char *r1bindex(char *, int) PURE;
 void readconfig (struct node **, FILE *, const char *, int);
 int refile (char **, char *);
 
 void readconfig (struct node **, FILE *, const char *, int);
 int refile (char **, char *);
 
@@ -312,7 +312,7 @@ void seq_setcur (struct msgs *, int);
 void seq_setprev (struct msgs *);
 void seq_setunseen (struct msgs *, int);
 int showfile (char **, char *);
 void seq_setprev (struct msgs *);
 void seq_setunseen (struct msgs *, int);
 int showfile (char **, char *);
-int smatch(const char *, const struct swit *);
+int smatch(const char *, const struct swit *) PURE;
 
 /*
  * Convert a set of bit flags to printable format.
 
 /*
  * Convert a set of bit flags to printable format.
@@ -347,11 +347,11 @@ int smatch(const char *, const struct swit *);
  * from least significant bit to most significant.
  */
 char *snprintb (char *buffer, size_t size, unsigned flags, char *bitfield);
  * from least significant bit to most significant.
  */
 char *snprintb (char *buffer, size_t size, unsigned flags, char *bitfield);
-int ssequal (const char *, const char *);
-int stringdex (char *, char *);
+int ssequal (const char *, const char *) PURE;
+int stringdex (char *, char *) PURE;
 char *trimcpy (char *);
 
 char *trimcpy (char *);
 
-int uprf (const char *, const char *);
+int uprf (const char *, const char *) PURE;
 int vfgets (FILE *, char **);
 
 /*
 int vfgets (FILE *, char **);
 
 /*
index 597569b..13ac94e 100644 (file)
--- a/h/utils.h
+++ b/h/utils.h
@@ -39,7 +39,7 @@ char *add(const char *, char *) MALLOC;
 char *addlist(char *, const char *) MALLOC;
 int folder_exists(const char *);
 void create_folder(char *, int, void (*)(int));
 char *addlist(char *, const char *) MALLOC;
 int folder_exists(const char *);
 void create_folder(char *, int, void (*)(int));
-int num_digits(int);
+int num_digits(int) PURE;
 
 /*
  * A vector of char array, used to hold a list of string message numbers
 
 /*
  * A vector of char array, used to hold a list of string message numbers
@@ -68,17 +68,17 @@ struct msgnum_array {
 void app_msgarg(struct msgs_array *, char *);
 void app_msgnum(struct msgnum_array *, int);
 
 void app_msgarg(struct msgs_array *, char *);
 void app_msgnum(struct msgnum_array *, int);
 
-char *find_str (const char [], size_t, const char *);
-char *rfind_str (const char [], size_t, const char *);
-char *nmh_strcasestr (const char *, const char *);
+char *find_str (const char [], size_t, const char *) PURE;
+char *rfind_str (const char [], size_t, const char *) PURE;
+char *nmh_strcasestr (const char *, const char *) PURE;
 
 void trunccpy(char *dst, const char *src, size_t size);
 /* A convenience for the common case of dst being an array. */
 #define TRUNCCPY(dst, src) trunccpy(dst, src, sizeof (dst))
 
 
 void trunccpy(char *dst, const char *src, size_t size);
 /* A convenience for the common case of dst being an array. */
 #define TRUNCCPY(dst, src) trunccpy(dst, src, sizeof (dst))
 
-bool has_prefix(const char *s, const char *prefix);
-bool has_suffix(const char *s, const char *suffix);
-bool has_suffix_c(const char *s, int c);
+bool has_prefix(const char *s, const char *prefix) PURE;
+bool has_suffix(const char *s, const char *suffix) PURE;
+bool has_suffix_c(const char *s, int c) PURE;
 void trim_suffix_c(char *s, int c);
 void to_lower(char *s);
 void to_upper(char *s);
 void trim_suffix_c(char *s, int c);
 void to_lower(char *s);
 void to_upper(char *s);
index fed756b..e3ac50d 100644 (file)
@@ -64,7 +64,7 @@ static int sm_nerror (char *);
 static int smtalk (int time, char *fmt, ...) CHECK_PRINTF(2, 3);
 static int sm_wstream (char *, int);
 static int smhear (void);
 static int smtalk (int time, char *fmt, ...) CHECK_PRINTF(2, 3);
 static int sm_wstream (char *, int);
 static int smhear (void);
-static char *EHLOset (char *);
+static char *EHLOset (char *) PURE;
 static int sm_sasl_callback(enum sasl_message_type, unsigned const char *,
                            unsigned int, unsigned char **, unsigned int *,
                            char **);
 static int sm_sasl_callback(enum sasl_message_type, unsigned const char *,
                            unsigned int, unsigned char **, unsigned int *,
                            char **);
index 49fc717..0de7a43 100644 (file)
@@ -31,7 +31,7 @@ struct mailname fmt_mnull = { NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0,
 /*
  * static prototypes
  */
 /*
  * static prototypes
  */
-static int match (char *, char *);
+static int match (char *, char *) PURE;
 static char *get_x400_friendly (char *, char *, int);
 static int get_x400_comp (char *, char *, char *, int);
 
 static char *get_x400_friendly (char *, char *, int);
 static int get_x400_comp (char *, char *, char *, int);
 
index 8b0a121..19cad33 100644 (file)
@@ -90,7 +90,7 @@ static int lkopen_lockf (const char *, int, mode_t, int *);
 static int lkopen_flock (const char *, int, mode_t, int *);
 #endif /* HAVE_FLOCK */
 
 static int lkopen_flock (const char *, int, mode_t, int *);
 #endif /* HAVE_FLOCK */
 
-static enum locktype init_locktype(const char *);
+static enum locktype init_locktype(const char *) PURE;
 
 static int lkopen_dot (const char *, int, mode_t, int *);
 static void lkclose_dot (int, const char *);
 
 static int lkopen_dot (const char *, int, mode_t, int *);
 static void lkclose_dot (int, const char *);
index b3978ef..ed347b6 100644 (file)
@@ -27,8 +27,8 @@ char *akvalue (char *);
 char *akerror (int);
 
 static  char *akval (struct aka *, char *);
 char *akerror (int);
 
 static  char *akval (struct aka *, char *);
-static bool aleq (char *, char *);
-static char *scanp (char *);
+static bool aleq (char *, char *) PURE;
+static char *scanp (char *) PURE;
 static char *getp (char *);
 static char *seekp (char *, char *, char **);
 static int addfile (struct aka *, char *);
 static char *getp (char *);
 static char *seekp (char *, char *, char **);
 static int addfile (struct aka *, char *);
index 85a6396..ad454e1 100644 (file)
--- a/uip/inc.c
+++ b/uip/inc.c
@@ -156,7 +156,7 @@ static FILE *in;
 /*
  * prototypes
  */
 /*
  * prototypes
  */
-static int maildir_srt(const void *va, const void *vb);
+static int maildir_srt(const void *va, const void *vb) PURE;
 static void inc_done(int) NORETURN;
 static int pop_action(void *closure, char *);
 
 static void inc_done(int) NORETURN;
 static int pop_action(void *closure, char *);
 
index 0bf0437..34e366c 100644 (file)
@@ -116,7 +116,7 @@ static int should_decode(const char *, const char *, const char *);
 static int content_encoding (CT, const char **);
 static int strip_crs (CT, int *);
 static void update_cte (CT);
 static int content_encoding (CT, const char **);
 static int strip_crs (CT, int *);
 static void update_cte (CT);
-static int least_restrictive_encoding (CT);
+static int least_restrictive_encoding (CT) PURE;
 static int less_restrictive (int, int);
 static int convert_charsets (CT, char *, int *);
 static int fix_always (CT, int *);
 static int less_restrictive (int, int);
 static int convert_charsets (CT, char *, int *);
 static int fix_always (CT, int *);
index 1567d3a..3249d08 100644 (file)
@@ -29,7 +29,7 @@ static void convert_common (contentline *, act);
 static void dump_unfolded (FILE *, contentline *);
 static void output (FILE *, contentline *, int);
 static void display (FILE *, contentline *, char *);
 static void dump_unfolded (FILE *, contentline *);
 static void output (FILE *, contentline *, int);
 static void display (FILE *, contentline *, char *);
-static const char *identity (const contentline *);
+static const char *identity (const contentline *) PURE;
 static char *format_params (char *, param_list *);
 static char *fold (char *, int);
 
 static char *format_params (char *, param_list *);
 static char *fold (char *, int);
 
index 5140b88..edcf0e7 100644 (file)
@@ -315,7 +315,7 @@ static int ptos (char *, char **);
 static char *parse (void);
 static void process (char *, char *, int, int);
 static void mhlfile (FILE *, char *, int, int);
 static char *parse (void);
 static void process (char *, char *, int, int);
 static void mhlfile (FILE *, char *, int, int);
-static int mcomp_flags (char *);
+static int mcomp_flags (char *) PURE;
 static char *mcomp_add (unsigned long, char *, char *);
 static void mcomp_format (struct mcomp *, struct mcomp *);
 static struct mcomp *add_queue (struct mcomp **, struct mcomp **, char *, char *, int);
 static char *mcomp_add (unsigned long, char *, char *);
 static void mcomp_format (struct mcomp *, struct mcomp *);
 static struct mcomp *add_queue (struct mcomp **, struct mcomp **, char *, char *, int);
index d987f69..a20c186 100644 (file)
@@ -29,8 +29,8 @@ static char *errs = NULL;
 /*
  * prototypes
  */
 /*
  * prototypes
  */
-int part_ok (CT);
-int part_exact(CT ct);
+int part_ok (CT) PURE;
+int part_exact(CT ct) PURE;
 int type_ok (CT, int);
 void content_error (char *, CT, char *, ...) CHECK_PRINTF(3, 4);
 void flush_errors (void);
 int type_ok (CT, int);
 void content_error (char *, CT, char *, ...) CHECK_PRINTF(3, 4);
 void flush_errors (void);
index d726d53..1a392bb 100644 (file)
@@ -131,7 +131,7 @@ static struct proc procs [] = {
 /*
  * static prototypes
  */
 /*
  * static prototypes
  */
-static char *p_find(char *);
+static char *p_find(char *) PURE;
 
 
 int
 
 
 int
index 46fd8ed..c039851 100644 (file)
@@ -26,7 +26,7 @@ enum clobber_policy_t {
   NMH_CLOBBER_NEVER
 };
 
   NMH_CLOBBER_NEVER
 };
 
-static enum clobber_policy_t clobber_policy (const char *);
+static enum clobber_policy_t clobber_policy (const char *) PURE;
 
 struct mhstoreinfo {
     CT *cts;                 /* Top-level list of contents to store. */
 
 struct mhstoreinfo {
     CT *cts;                 /* Top-level list of contents to store. */
index f582920..73ed728 100644 (file)
@@ -79,7 +79,7 @@ DEFINE_SWITCH_ARRAY(MSGCHK, switches);
 /*
  * static prototypes
  */
 /*
  * static prototypes
  */
-static int donote (char *, int);
+static int donote (char *, int) PURE;
 static int checkmail (char *, char *, int, int, int);
 static int remotemail (char *, char *, char *, char *, int, int, int, int,
                       char *, int, const char *);
 static int checkmail (char *, char *, int, int, int);
 static int remotemail (char *, char *, char *, char *, int, int, int, int,
                       char *, int, const char *);
index a02b071..6dc18d1 100644 (file)
@@ -290,7 +290,7 @@ static char *partno = NULL;
 static void putfmt (char *, char *, int *, FILE *);
 static void start_headers (void);
 static void finish_headers (FILE *);
 static void putfmt (char *, char *, int *, FILE *);
 static void start_headers (void);
 static void finish_headers (FILE *);
-static int get_header (char *, struct headers *);
+static int get_header (char *, struct headers *) PURE;
 static int putadr (char *, char *, struct mailname *, FILE *, unsigned int,
                   char *, unsigned int);
 static void putgrp (char *, char *, FILE *, unsigned int);
 static int putadr (char *, char *, struct mailname *, FILE *, unsigned int,
                   char *, unsigned int);
 static void putgrp (char *, char *, FILE *, unsigned int);
@@ -301,7 +301,7 @@ static int annoaux (struct mailname *);
 static void insert_fcc (struct headers *, char *);
 static void make_bcc_file (int);
 static void verify_all_addresses (int, int, char *, int, char *);
 static void insert_fcc (struct headers *, char *);
 static void make_bcc_file (int);
 static void verify_all_addresses (int, int, char *, int, char *);
-static void chkadr (void);
+static void chkadr (void) PURE;
 static void sigon (void);
 static void sigoff (void);
 static void p_refile (char *);
 static void sigon (void);
 static void sigoff (void);
 static void p_refile (char *);
index e136f10..2bf71fa 100644 (file)
@@ -163,7 +163,7 @@ static int split (char *, char **);
 static int parse (int);
 static void expand (char *, char *, int);
 static void glob (int);
 static int parse (int);
 static void expand (char *, char *, int);
 static void glob (int);
-static struct pair *lookup (struct pair *, char *);
+static struct pair *lookup (struct pair *, char *) PURE;
 static int logged_in (void);
 static int timely (char *, char *);
 static int usr_file (int, char *, int);
 static int logged_in (void);
 static int timely (char *, char *);
 static int usr_file (int, char *, int);