]> git.ipfire.org Git - thirdparty/git.git/commitdiff
imap-send: drop unused parameter from imap_cmd_cb callback
authorJeff King <peff@peff.net>
Mon, 3 Jul 2023 06:34:02 +0000 (02:34 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 5 Jul 2023 17:16:53 +0000 (10:16 -0700)
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>
imap-send.c

index 0afd88de44ed9b7e9b0cfd53c226a78012be4952..81a87f434b11bd6f01e7e107f9c02bb533d47a1d 100644 (file)
@@ -137,7 +137,7 @@ struct imap_store {
 };
 
 struct imap_cmd_cb {
-       int (*cont)(struct imap_store *ctx, struct imap_cmd *cmd, const char *prompt);
+       int (*cont)(struct imap_store *ctx, const char *prompt);
        void (*done)(struct imap_store *ctx, struct imap_cmd *cmd, int response);
        void *ctx;
        char *data;
@@ -786,7 +786,7 @@ static int get_cmd_result(struct imap_store *ctx, struct imap_cmd *tcmd)
                                if (n != (int)cmdp->cb.dlen)
                                        return RESP_BAD;
                        } else if (cmdp->cb.cont) {
-                               if (cmdp->cb.cont(ctx, cmdp, cmd))
+                               if (cmdp->cb.cont(ctx, cmd))
                                        return RESP_BAD;
                        } else {
                                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)
 
 #endif
 
-static int auth_cram_md5(struct imap_store *ctx, struct imap_cmd *cmd, const char *prompt)
+static int auth_cram_md5(struct imap_store *ctx, const char *prompt)
 {
        int ret;
        char *response;