From: Richard Russon Date: Sun, 6 May 2018 00:57:02 +0000 (+0100) Subject: add missing retvals X-Git-Tag: neomutt-20180512~7^2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=69b5be1cab3c7fa3f3d071128113353d04a53823;p=neomutt add missing retvals --- diff --git a/history.c b/history.c index 3b9b7dfa9..911ebed70 100644 --- 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 a6cbf4133..54182207a 100644 --- 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 039102328..c539b191f 100644 --- 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 4bb4dd20f..be06f5f30 100644 --- 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) { diff --git a/mutt/address.c b/mutt/address.c index eec2b1f7b..27fbbc010 100644 --- a/mutt/address.c +++ b/mutt/address.c @@ -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. diff --git a/mutt/charset.c b/mutt/charset.c index 1e289b5ea..ec85bf3db 100644 --- a/mutt/charset.c +++ b/mutt/charset.c @@ -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. diff --git a/mutt/string.c b/mutt/string.c index 818ac3265..e590d4be3 100644 --- a/mutt/string.c +++ b/mutt/string.c @@ -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) { diff --git a/mutt_notmuch.c b/mutt_notmuch.c index 8c3490ddf..57cdd2ef7 100644 --- a/mutt_notmuch.c +++ b/mutt_notmuch.c @@ -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) { diff --git a/ncrypt/crypt_gpgme.c b/ncrypt/crypt_gpgme.c index f9d94a6bc..7bac1c282 100644 --- a/ncrypt/crypt_gpgme.c +++ b/ncrypt/crypt_gpgme.c @@ -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 6d9ee5283..ab1a0a15c 100644 --- 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 e0a090025..fedd646ba 100644 --- 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) { diff --git a/sendlib.c b/sendlib.c index e044725fa..a5d3f6c72 100644 --- 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)