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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Jul 3, 2023 at 02:34 UTC
ec9e358a4a1a0f5513d57f5447d43e31a508dd17
1 file changed
+3
-3
imap-send.c
+3
-3
@@ -137,7 +137,7 @@ struct imap_store {
137
};
138
139
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);
141
void (*done)(struct imap_store *ctx, struct imap_cmd *cmd, int response);
142
void *ctx;
143
char *data;
@@ -786,7 +786,7 @@ static int get_cmd_result(struct imap_store *ctx, struct imap_cmd *tcmd)
786
if (n != (int)cmdp->cb.dlen)
787
return RESP_BAD;
788
} else if (cmdp->cb.cont) {
789
- if (cmdp->cb.cont(ctx, cmdp, cmd))
789
+ if (cmdp->cb.cont(ctx, cmd))
790
return RESP_BAD;
791
} else {
792
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)
917
918
#endif
919
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)
921
{
922
int ret;
923
char *response;