Skip to content

Commit

Permalink
Remove unused parameters
Browse files Browse the repository at this point in the history
* curs_main.c main_change_folder(flags)
* imap/imap.c imap_buffy_check(force)
* init.c mutt_nm_tag_complete(pos)
* ncrypt/crypt_gpgme.c verify_sender(protocol)
* recvcmd.c attach_forward_bodies(flags)
* mutt/file.c mutt_file_lock(path)
* mutt/file.c mutt_file_unlock(path)
* recvcmd.c mutt_attach_bounce(hdr)
* recvcmd.c mutt_attach_resend(hdr)
* recvcmd.c attach_forward_msgs(hdr)
* recvcmd.c attach_include_reply(flags)
* send.c mutt_make_misc_reply_headers(hdr,ctx)
* sendlib.c encode_8bit(istext)
  • Loading branch information
flatcap authored Nov 28, 2017
1 parent 1646a61 commit 57c7ea5
Show file tree
Hide file tree
Showing 20 changed files with 52 additions and 58 deletions.
6 changes: 2 additions & 4 deletions attach.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,8 @@ void mutt_pipe_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag,
void mutt_print_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag,
struct Body *top);

void mutt_attach_bounce(FILE *fp, struct Header *hdr, struct AttachCtx *actx,
struct Body *cur);
void mutt_attach_resend(FILE *fp, struct Header *hdr, struct AttachCtx *actx,
struct Body *cur);
void mutt_attach_bounce(FILE *fp, struct AttachCtx *actx, struct Body *cur);
void mutt_attach_resend(FILE *fp, struct AttachCtx *actx, struct Body *cur);
void mutt_attach_forward(FILE *fp, struct Header *hdr, struct AttachCtx *actx,
struct Body *cur, int flags);
void mutt_attach_reply(FILE *fp, struct Header *hdr, struct AttachCtx *actx,
Expand Down
2 changes: 1 addition & 1 deletion buffy.c
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ int mutt_buffy_check(bool force)
BuffyNotify = 0;

#ifdef USE_IMAP
BuffyCount += imap_buffy_check(force, check_stats);
BuffyCount += imap_buffy_check(check_stats);
#endif

/* check device ID and serial number instead of comparing paths */
Expand Down
4 changes: 2 additions & 2 deletions compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ static int lock_realpath(struct Context *ctx, int excl)
return 0;
}

int r = mutt_file_lock(ctx->realpath, fileno(ci->lockfp), excl, 1);
int r = mutt_file_lock(fileno(ci->lockfp), excl, 1);

if (r == 0)
ci->locked = 1;
Expand Down Expand Up @@ -128,7 +128,7 @@ static void unlock_realpath(struct Context *ctx)
if (!ci->locked)
return;

mutt_file_unlock(ctx->realpath, fileno(ci->lockfp));
mutt_file_unlock(fileno(ci->lockfp));

ci->locked = 0;
mutt_file_fclose(&ci->lockfp);
Expand Down
12 changes: 6 additions & 6 deletions curs_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,8 @@ void update_index(struct Menu *menu, struct Context *ctx, int check, int oldcoun
menu->current = ci_first_message();
}

static int main_change_folder(struct Menu *menu, int op, char *buf, size_t bufsz,
int *oldcount, int *index_hint, int flags)
static int main_change_folder(struct Menu *menu, int op, char *buf,
size_t bufsz, int *oldcount, int *index_hint)
{
#ifdef USE_NNTP
if (option(OPT_NEWS))
Expand Down Expand Up @@ -1978,7 +1978,7 @@ int mutt_index_menu(void)
if (!nm_uri_from_query(Context, buf, sizeof(buf)))
mutt_message(_("Failed to create query, aborting."));
else
main_change_folder(menu, op, buf, sizeof(buf), &oldcount, &index_hint, 0);
main_change_folder(menu, op, buf, sizeof(buf), &oldcount, &index_hint);
break;

case OP_MAIN_WINDOWED_VFOLDER_BACKWARD:
Expand All @@ -1998,7 +1998,7 @@ int mutt_index_menu(void)
if (!nm_uri_from_query(Context, buf, sizeof(buf)))
mutt_message(_("Failed to create query, aborting."));
else
main_change_folder(menu, op, buf, sizeof(buf), &oldcount, &index_hint, 0);
main_change_folder(menu, op, buf, sizeof(buf), &oldcount, &index_hint);
break;

case OP_MAIN_WINDOWED_VFOLDER_FORWARD:
Expand All @@ -2019,7 +2019,7 @@ int mutt_index_menu(void)
else
{
mutt_debug(2, "nm: + windowed query (%s)\n", buf);
main_change_folder(menu, op, buf, sizeof(buf), &oldcount, &index_hint, 0);
main_change_folder(menu, op, buf, sizeof(buf), &oldcount, &index_hint);
}
break;

Expand Down Expand Up @@ -2142,7 +2142,7 @@ int mutt_index_menu(void)
}
}

main_change_folder(menu, op, buf, sizeof(buf), &oldcount, &index_hint, flags);
main_change_folder(menu, op, buf, sizeof(buf), &oldcount, &index_hint);
#ifdef USE_NNTP
/* mutt_buffy_check() must be done with mail-reader mode! */
menu->help = mutt_compile_help(
Expand Down
2 changes: 1 addition & 1 deletion enter.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ int mutt_enter_string_full(char *buf, size_t buflen, int col, int flags, int mul
{
mutt_mb_wcstombs(buf, buflen, state->wbuf, state->curpos);
i = strlen(buf);
if (!mutt_nm_tag_complete(buf, buflen, i, state->tabs))
if (!mutt_nm_tag_complete(buf, buflen, state->tabs))
BEEP();

replace_part(state, 0, buf);
Expand Down
6 changes: 3 additions & 3 deletions hcache/bdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static void *hcache_bdb_open(const char *path)
return NULL;
}

if (mutt_file_lock(ctx->lockfile, ctx->fd, 1, 5))
if (mutt_file_lock(ctx->fd, 1, 5))
goto fail_close;

ret = db_env_create(&ctx->env, 0);
Expand Down Expand Up @@ -124,7 +124,7 @@ static void *hcache_bdb_open(const char *path)
fail_env:
ctx->env->close(ctx->env, 0);
fail_unlock:
mutt_file_unlock(ctx->lockfile, ctx->fd);
mutt_file_unlock(ctx->fd);
fail_close:
close(ctx->fd);
unlink(ctx->lockfile);
Expand Down Expand Up @@ -199,7 +199,7 @@ static void hcache_bdb_close(void **vctx)

ctx->db->close(ctx->db, 0);
ctx->env->close(ctx->env, 0);
mutt_file_unlock(ctx->lockfile, ctx->fd);
mutt_file_unlock(ctx->fd);
close(ctx->fd);
unlink(ctx->lockfile);
FREE(vctx);
Expand Down
2 changes: 1 addition & 1 deletion imap/imap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1472,7 +1472,7 @@ int imap_check(struct ImapData *idata, int force)
* batch the commands and save on round trips. Returns number of mailboxes with
* new mail.
*/
int imap_buffy_check(int force, int check_stats)
int imap_buffy_check(int check_stats)
{
struct ImapData *idata = NULL;
struct ImapData *lastdata = NULL;
Expand Down
2 changes: 1 addition & 1 deletion imap/imap.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ int imap_access(const char *path);
int imap_check_mailbox(struct Context *ctx, int force);
int imap_delete_mailbox(struct Context *ctx, struct ImapMbox *mx);
int imap_sync_mailbox(struct Context *ctx, int expunge);
int imap_buffy_check(int force, int check_stats);
int imap_buffy_check(int check_stats);
int imap_status(char *path, int queue);
int imap_search(struct Context *ctx, const struct Pattern *pat);
int imap_subscribe(char *path, bool subscribe);
Expand Down
2 changes: 1 addition & 1 deletion init.c
Original file line number Diff line number Diff line change
Expand Up @@ -3737,7 +3737,7 @@ bool mutt_nm_query_complete(char *buffer, size_t len, int pos, int numtabs)
*
* Complete the nearest "+" or "-" -prefixed string previous to pos.
*/
bool mutt_nm_tag_complete(char *buffer, size_t len, int pos, int numtabs)
bool mutt_nm_tag_complete(char *buffer, size_t len, int numtabs)
{
if (!buffer)
return false;
Expand Down
6 changes: 3 additions & 3 deletions mbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ static int mbox_lock_mailbox(struct Context *ctx, int excl, int retry)
{
int r;

r = mutt_file_lock(ctx->path, fileno(ctx->fp), excl, retry);
r = mutt_file_lock(fileno(ctx->fp), excl, retry);
if (r == 0)
ctx->locked = true;
else if (retry && !excl)
Expand All @@ -92,7 +92,7 @@ static void mbox_unlock_mailbox(struct Context *ctx)
{
fflush(ctx->fp);

mutt_file_unlock(ctx->path, fileno(ctx->fp));
mutt_file_unlock(fileno(ctx->fp));
ctx->locked = false;
}
}
Expand Down Expand Up @@ -496,7 +496,7 @@ static int mbox_close_mailbox(struct Context *ctx)

if (ctx->append)
{
mutt_file_unlock(ctx->path, fileno(ctx->fp));
mutt_file_unlock(fileno(ctx->fp));
mutt_sig_unblock();
}

Expand Down
12 changes: 5 additions & 7 deletions mutt/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,6 @@ int mutt_file_chmod_rm_stat(const char *path, mode_t mode, struct stat *st)

/**
* mutt_file_lock - (try to) lock a file
* @param path Path to file
* @param fd File descriptor to file
* @param excl If set, try to lock exclusively
* @param timeout Retry after this time
Expand All @@ -1101,7 +1100,7 @@ int mutt_file_chmod_rm_stat(const char *path, mode_t mode, struct stat *st)
*
* Use mutt_file_unlock() to unlock the file.
*/
int mutt_file_lock(const char *path, int fd, int excl, int timeout)
int mutt_file_lock(int fd, int excl, int timeout)
{
#if defined(USE_FCNTL) || defined(USE_FLOCK)
int count;
Expand Down Expand Up @@ -1201,11 +1200,10 @@ int mutt_file_lock(const char *path, int fd, int excl, int timeout)

/**
* mutt_file_unlock - Unlock a file previously locked by mutt_file_lock()
* @param path Path to file
* @param fd File descriptor to file
* @param fd File descriptor to file
* @retval 0 Always
*/
int mutt_file_unlock(const char *path, int fd)
int mutt_file_unlock(int fd)
{
#ifdef USE_FCNTL
struct flock unlockit = { F_UNLCK, 0, 0, 0, 0 };
Expand Down Expand Up @@ -1236,7 +1234,7 @@ void mutt_file_unlink_empty(const char *path)
if (fd == -1)
return;

if (mutt_file_lock(path, fd, 1, 1) == -1)
if (mutt_file_lock(fd, 1, 1) == -1)
{
close(fd);
return;
Expand All @@ -1245,7 +1243,7 @@ void mutt_file_unlink_empty(const char *path)
if (fstat(fd, &sb) == 0 && sb.st_size == 0)
unlink(path);

mutt_file_unlock(path, fd);
mutt_file_unlock(fd);
close(fd);
}

Expand Down
4 changes: 2 additions & 2 deletions mutt/file.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const char *mutt_file_dirname(const char *p);
int mutt_file_fclose(FILE **f);
FILE * mutt_file_fopen(const char *path, const char *mode);
int mutt_file_fsync_close(FILE **f);
int mutt_file_lock(const char *path, int fd, int excl, int timeout);
int mutt_file_lock(int fd, int excl, int timeout);
int mutt_file_mkdir(const char *path, mode_t mode);
int mutt_file_open(const char *path, int flags);
size_t mutt_file_quote_filename(char *d, size_t l, const char *f);
Expand All @@ -66,6 +66,6 @@ int mutt_file_to_absolute_path(char *path, const char *reference);
void mutt_file_touch_atime(int f);
void mutt_file_unlink(const char *s);
void mutt_file_unlink_empty(const char *path);
int mutt_file_unlock(const char *path, int fd);
int mutt_file_unlock(int fd);

#endif /* _MUTT_FILE_H */
4 changes: 2 additions & 2 deletions ncrypt/crypt_gpgme.c
Original file line number Diff line number Diff line change
Expand Up @@ -5034,7 +5034,7 @@ int smime_gpgme_send_menu(struct Header *msg)
return gpgme_send_menu(msg, 1);
}

static int verify_sender(struct Header *h, gpgme_protocol_t protocol)
static int verify_sender(struct Header *h)
{
struct Address *sender = NULL;
unsigned int rc = 1;
Expand Down Expand Up @@ -5114,7 +5114,7 @@ static int verify_sender(struct Header *h, gpgme_protocol_t protocol)

int smime_gpgme_verify_sender(struct Header *h)
{
return verify_sender(h, GPGME_PROTOCOL_CMS);
return verify_sender(h);
}

void mutt_gpgme_set_sender(const char *sender)
Expand Down
4 changes: 2 additions & 2 deletions newsrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ void nntp_newsrc_close(struct NntpServer *nserv)
return;

mutt_debug(1, "Unlocking %s\n", nserv->newsrc_file);
mutt_file_unlock(nserv->newsrc_file, fileno(nserv->newsrc_fp));
mutt_file_unlock(fileno(nserv->newsrc_fp));
mutt_file_fclose(&nserv->newsrc_fp);
}

Expand Down Expand Up @@ -188,7 +188,7 @@ int nntp_newsrc_parse(struct NntpServer *nserv)

/* lock it */
mutt_debug(1, "Locking %s\n", nserv->newsrc_file);
if (mutt_file_lock(nserv->newsrc_file, fileno(nserv->newsrc_fp), 0, 1))
if (mutt_file_lock(fileno(nserv->newsrc_fp), 0, 1))
{
mutt_file_fclose(&nserv->newsrc_fp);
return -1;
Expand Down
4 changes: 2 additions & 2 deletions pager.c
Original file line number Diff line number Diff line change
Expand Up @@ -2710,7 +2710,7 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e
CHECK_MODE(IsHeader(extra) || IsMsgAttach(extra))
CHECK_ATTACH;
if (IsMsgAttach(extra))
mutt_attach_bounce(extra->fp, extra->hdr, extra->actx, extra->bdy);
mutt_attach_bounce(extra->fp, extra->actx, extra->bdy);
else
ci_bounce_message(extra->hdr);
break;
Expand All @@ -2719,7 +2719,7 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e
CHECK_MODE(IsHeader(extra) || IsMsgAttach(extra))
CHECK_ATTACH;
if (IsMsgAttach(extra))
mutt_attach_resend(extra->fp, extra->hdr, extra->actx, extra->bdy);
mutt_attach_resend(extra->fp, extra->actx, extra->bdy);
else
mutt_resend_message(NULL, extra->ctx, extra->hdr);
pager_menu->redraw = REDRAW_FULL;
Expand Down
4 changes: 2 additions & 2 deletions protos.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ void mutt_check_lookup_list(struct Body *b, char *type, int len);
void mutt_make_attribution(struct Context *ctx, struct Header *cur, FILE *out);
void mutt_make_forward_subject(struct Envelope *env, struct Context *ctx, struct Header *cur);
void mutt_make_help(char *d, size_t dlen, const char *txt, int menu, int op);
void mutt_make_misc_reply_headers(struct Envelope *env, struct Context *ctx, struct Header *cur, struct Envelope *curenv);
void mutt_make_misc_reply_headers(struct Envelope *env, struct Envelope *curenv);
void mutt_make_post_indent(struct Context *ctx, struct Header *cur, FILE *out);
void mutt_message_to_7bit(struct Body *a, FILE *fp);
void mutt_mktemp_full(char *s, size_t slen, const char *prefix, const char *suffix, const char *src, int line);
Expand Down Expand Up @@ -257,7 +257,7 @@ int mutt_command_complete(char *buffer, size_t len, int pos, int numtabs);
int mutt_var_value_complete(char *buffer, size_t len, int pos);
#ifdef USE_NOTMUCH
bool mutt_nm_query_complete(char *buffer, size_t len, int pos, int numtabs);
bool mutt_nm_tag_complete(char *buffer, size_t len, int pos, int numtabs);
bool mutt_nm_tag_complete(char *buffer, size_t len, int numtabs);
#endif
int mutt_complete(char *s, size_t slen);
int mutt_compose_attachment(struct Body *a);
Expand Down
4 changes: 2 additions & 2 deletions recvattach.c
Original file line number Diff line number Diff line change
Expand Up @@ -1350,14 +1350,14 @@ void mutt_view_attachments(struct Header *hdr)

case OP_RESEND:
CHECK_ATTACH;
mutt_attach_resend(CURATTACH->fp, hdr, actx,
mutt_attach_resend(CURATTACH->fp, actx,
menu->tagprefix ? NULL : CURATTACH->content);
menu->redraw = REDRAW_FULL;
break;

case OP_BOUNCE_MESSAGE:
CHECK_ATTACH;
mutt_attach_bounce(CURATTACH->fp, hdr, actx,
mutt_attach_bounce(CURATTACH->fp, actx,
menu->tagprefix ? NULL : CURATTACH->content);
menu->redraw = REDRAW_FULL;
break;
Expand Down
Loading

0 comments on commit 57c7ea5

Please sign in to comment.