]> granicus.if.org Git - neomutt/commitdiff
add missing retvals
authorRichard Russon <rich@flatcap.org>
Sun, 6 May 2018 00:57:02 +0000 (01:57 +0100)
committerRichard Russon <rich@flatcap.org>
Sun, 6 May 2018 00:57:02 +0000 (01:57 +0100)
12 files changed:
history.c
init.c
mbox.c
mh.c
mutt/address.c
mutt/charset.c
mutt/string.c
mutt_notmuch.c
ncrypt/crypt_gpgme.c
parse.c
send.c
sendlib.c

index 3b9b7dfa9e0eb76d4a4738ac4136bca7a235e109..911ebed70b768f6d0c7a3eae8d5f331efa0d8bab 100644 (file)
--- a/history.c
+++ b/history.c
@@ -427,6 +427,13 @@ static void remove_history_dups(enum HistoryClass hclass, const char *str)
  * @param[in]  else_str Otherwise, display this string
  * @param[in]  data     Pointer to the mailbox Context
  * @param[in]  flags    Format flags
+ * @retval src (unchanged)
+ *
+ * history_format_str() is a callback function for mutt_expando_format().
+ *
+ * | Expando | Description
+ * |:--------|:--------------
+ * | \%s     | History match
  */
 static const char *history_format_str(char *buf, size_t buflen, size_t col, int cols,
                                       char op, const char *src, const char *prec,
@@ -442,7 +449,7 @@ static const char *history_format_str(char *buf, size_t buflen, size_t col, int
       break;
   }
 
-  return (src);
+  return src;
 }
 
 /**
diff --git a/init.c b/init.c
index a6cbf413396df1e339dbca56079b5df7ef03fc02..54182207aaea3ed8c9917f965a92a827dc8787a6 100644 (file)
--- a/init.c
+++ b/init.c
@@ -3041,6 +3041,8 @@ static int parse_source(struct Buffer *buf, struct Buffer *s,
  * @param line  config line to read
  * @param token scratch buffer to be used by parser
  * @param err   where to write error messages
+ * @retval  0 Success
+ * @retval -1 Failure
  *
  * Caller should free token->data when finished.  the reason for this variable
  * is to avoid having to allocate and deallocate a lot of memory if we are
diff --git a/mbox.c b/mbox.c
index 039102328af9676b5eeeba048f52aff613b308ed..c539b191f185ddb2f29f7d68dbaa8ffd5107010e 100644 (file)
--- a/mbox.c
+++ b/mbox.c
@@ -67,6 +67,8 @@ struct MUpdate
  * @param ctx   Context to lock
  * @param excl  Exclusive lock?
  * @param retry Should retry if unable to lock?
+ * @retval  0 Success
+ * @retval -1 Failure
  */
 static int mbox_lock_mailbox(struct Context *ctx, int excl, int retry)
 {
diff --git a/mh.c b/mh.c
index 4bb4dd20fa1130e7f4a885a4ffe572edae6ec379..be06f5f30db92722b6c534f73749274e4ab670d0 100644 (file)
--- a/mh.c
+++ b/mh.c
@@ -1243,6 +1243,8 @@ static int mh_close_mailbox(struct Context *ctx)
  * @param ctx    Current mailbox
  * @param subdir NULL for MH mailboxes,
  *               otherwise the subdir of the maildir mailbox to read from
+ * @retval  0 Success
+ * @retval -1 Failure
  */
 static int mh_read_dir(struct Context *ctx, const char *subdir)
 {
index eec2b1f7b79c7141b552cdf3825d571a35353b71..27fbbc0103fcf46f2e56e885283630070a6468d7 100644 (file)
@@ -1136,6 +1136,7 @@ done:
  * @param buflen  Length of the buffer
  * @param addr    Address to display
  * @param display This address will be displayed to the user
+ * @retval num Bytes written to the buffer
  *
  * If 'display' is set, then it doesn't matter if the transformation isn't
  * reversible.
index 1e289b5ea4934a12f400d3e13bce993082d0c5d2..ec85bf3db561630873dd5e278ea2ec61595625a0 100644 (file)
@@ -234,6 +234,7 @@ const struct MimeNames PreferredMimeNames[] =
  * lookup_charset - Look for a preferred character set name
  * @param type Type, e.g. #MUTT_LOOKUP_CHARSET
  * @param cs   Character set
+ * @retval ptr Charset string
  *
  * If the character set matches one of the regexes,
  * then return the replacement name.
index 818ac32655eb62485fbdf6747796799f21d5859f..e590d4be3397c9a670ac99f75715a649f3908eb3 100644 (file)
@@ -102,6 +102,7 @@ static const struct SysExits
 /**
  * mutt_str_sysexit - Return a string matching an error code
  * @param e Error code, e.g. EX_NOPERM
+ * @retval ptr string representing the error code
  */
 const char *mutt_str_sysexit(int e)
 {
index 8c3490ddfebf73e2524560214b9592e39d08e5d7..57cdd2ef714a8e0a68b2100115323d55811cc2bd 100644 (file)
@@ -2622,6 +2622,8 @@ done:
  * nm_sync_mailbox - Sync a notmuch mailbox
  * @param ctx        Mailbox
  * @param index_hint Remember our place in the index
+ * @retval  0 Success
+ * @retval -1 Failure
  */
 static int nm_sync_mailbox(struct Context *ctx, int *index_hint)
 {
index f9d94a6bcae16c8a79e914a9f327d6e03e6557b2..7bac1c282c6794c5b6476163f080e673a07c1e7a 100644 (file)
@@ -461,6 +461,7 @@ static int crypt_id_matches_addr(struct Address *addr, struct Address *u_addr,
 /**
  * create_gpgme_context - Create a new GPGME context
  * @param for_smime If set, protocol of the context is set to CMS
+ * @retval ptr New GPGME context
  */
 static gpgme_ctx_t create_gpgme_context(int for_smime)
 {
diff --git a/parse.c b/parse.c
index 6d9ee5283e7dd7a121b216d4eacba0509013496d..ab1a0a15cc331c5b28789251785ac75f8234e2c9 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -429,6 +429,7 @@ static void parse_content_disposition(const char *s, struct Body *ct)
  * mutt_read_mime_header - Parse a MIME header
  * @param fp      stream to read from
  * @param digest  1 if reading subparts of a multipart/digest, 0 otherwise
+ * @retval ptr New Body containing parsed structure
  */
 struct Body *mutt_read_mime_header(FILE *fp, int digest)
 {
@@ -555,6 +556,7 @@ void mutt_parse_part(FILE *fp, struct Body *b)
  * mutt_rfc822_parse_message - parse a Message/RFC822 body
  * @param fp     stream to read from
  * @param parent info about the message/rfc822 body part
+ * @retval ptr New Body containing parsed message
  *
  * NOTE: this assumes that `parent->length' has been set!
  */
@@ -585,6 +587,7 @@ struct Body *mutt_rfc822_parse_message(FILE *fp, struct Body *parent)
  * @param end_off  length of the multipart body (used when the final
  *                 boundary is missing to avoid reading too far)
  * @param digest   1 if reading a multipart/digest, 0 otherwise
+ * @retval ptr New Body containing parsed structure
  */
 struct Body *mutt_parse_multipart(FILE *fp, const char *boundary, LOFF_T end_off, int digest)
 {
diff --git a/send.c b/send.c
index e0a0900258cad2c4e67e1b877b53f875c770b290..fedd646ba23100cfb09490d12b98145186c99667 100644 (file)
--- a/send.c
+++ b/send.c
@@ -126,6 +126,7 @@ struct Address *mutt_remove_xrefs(struct Address *a, struct Address *b)
  * @param a          List of addresses
  * @param leave_only If set, don't remove the user's address if it it the only
  *                   one in the list
+ * @retval ptr Head of the remaining Address List
  */
 static struct Address *remove_user(struct Address *a, int leave_only)
 {
index e044725fa965b717706f74094083fe51d2aa3dbf..a5d3f6c72b90a7b5d7fbacbb613faee56f444fcf 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -2271,6 +2271,8 @@ static void alarm_handler(int sig)
  *                      to the temporary file containing the stdout of the
  *                      child process. If it is NULL, stderr and stdout
  *                      are not redirected.
+ * @retval  0 Success
+ * @retval >0 Failure, return code from sendmail
  */
 static int send_msg(const char *path, char **args, const char *msg, char **tempfile)
 {
@@ -2463,6 +2465,8 @@ static char **add_option(char **args, size_t *argslen, size_t *argsmax, char *s)
  * @param bcc      Recipients
  * @param msg      File containing message
  * @param eightbit Message contains 8bit chars
+ * @retval  0 Success
+ * @retval -1 Failure
  */
 int mutt_invoke_sendmail(struct Address *from, struct Address *to, struct Address *cc,
                          struct Address *bcc, const char *msg, int eightbit)