Skip to content

Commit ec9e358

Browse files
peffgitster
authored andcommitted
imap-send: drop unused parameter from imap_cmd_cb callback
There's a generic callback mechanism for handling plus-continuation of IMAP commands. It takes the imap_cmd struct itself as an argument. That seems reasonable, and in a larger imap-using program it might be used. But in imap-send, we have only one such callback (auth_cram_md5) and it doesn't use this value, triggering -Wunused-parameter warnings. We could just mark the parameter as UNUSED. But since this is the only such function, and because we are not likely to share code with the upstream isync anymore, we can just simplify the interface to remove this parameter. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 84d689a commit ec9e358

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

imap-send.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ struct imap_store {
137137
};
138138

139139
struct imap_cmd_cb {
140-
int (*cont)(struct imap_store *ctx, struct imap_cmd *cmd, const char *prompt);
140+
int (*cont)(struct imap_store *ctx, const char *prompt);
141141
void (*done)(struct imap_store *ctx, struct imap_cmd *cmd, int response);
142142
void *ctx;
143143
char *data;
@@ -786,7 +786,7 @@ static int get_cmd_result(struct imap_store *ctx, struct imap_cmd *tcmd)
786786
if (n != (int)cmdp->cb.dlen)
787787
return RESP_BAD;
788788
} else if (cmdp->cb.cont) {
789-
if (cmdp->cb.cont(ctx, cmdp, cmd))
789+
if (cmdp->cb.cont(ctx, cmd))
790790
return RESP_BAD;
791791
} else {
792792
fprintf(stderr, "IMAP error: unexpected command continuation request\n");
@@ -917,7 +917,7 @@ static char *cram(const char *challenge_64, const char *user, const char *pass)
917917

918918
#endif
919919

920-
static int auth_cram_md5(struct imap_store *ctx, struct imap_cmd *cmd, const char *prompt)
920+
static int auth_cram_md5(struct imap_store *ctx, const char *prompt)
921921
{
922922
int ret;
923923
char *response;

0 commit comments

Comments
 (0)