Skip to content

Commit fe47e1d

Browse files
mhaggergitster
authored andcommitted
imap-send.c: use struct imap_store instead of struct store
In fact, all struct store instances are upcasts of struct imap_store anyway, so stop making the distinction. Signed-off-by: Michael Haggerty <[email protected]> Reviewed-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c197454 commit fe47e1d

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

imap-send.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -792,9 +792,9 @@ static void imap_close_server(struct imap_store *ictx)
792792
free(imap);
793793
}
794794

795-
static void imap_close_store(struct store *ctx)
795+
static void imap_close_store(struct imap_store *ctx)
796796
{
797-
imap_close_server((struct imap_store *)ctx);
797+
imap_close_server(ctx);
798798
free(ctx);
799799
}
800800

@@ -879,7 +879,7 @@ static int auth_cram_md5(struct imap_store *ctx, struct imap_cmd *cmd, const cha
879879
return 0;
880880
}
881881

882-
static struct store *imap_open_store(struct imap_server_conf *srvc)
882+
static struct imap_store *imap_open_store(struct imap_server_conf *srvc)
883883
{
884884
struct imap_store *ctx;
885885
struct imap *imap;
@@ -1089,10 +1089,10 @@ static struct store *imap_open_store(struct imap_server_conf *srvc)
10891089
} /* !preauth */
10901090

10911091
ctx->prefix = "";
1092-
return (struct store *)ctx;
1092+
return ctx;
10931093

10941094
bail:
1095-
imap_close_store(&ctx->gen);
1095+
imap_close_store(ctx);
10961096
return NULL;
10971097
}
10981098

@@ -1138,9 +1138,8 @@ static void lf_to_crlf(struct strbuf *msg)
11381138
* Store msg to IMAP. Also detach and free the data from msg->data,
11391139
* leaving msg->data empty.
11401140
*/
1141-
static int imap_store_msg(struct store *gctx, struct strbuf *msg)
1141+
static int imap_store_msg(struct imap_store *ctx, struct strbuf *msg)
11421142
{
1143-
struct imap_store *ctx = (struct imap_store *)gctx;
11441143
struct imap *imap = ctx->imap;
11451144
struct imap_cmd_cb cb;
11461145
const char *prefix, *box;
@@ -1152,7 +1151,7 @@ static int imap_store_msg(struct store *gctx, struct strbuf *msg)
11521151
cb.dlen = msg->len;
11531152
cb.data = strbuf_detach(msg, NULL);
11541153

1155-
box = gctx->name;
1154+
box = ctx->gen.name;
11561155
prefix = !strcmp(box, "INBOX") ? "" : ctx->prefix;
11571156
cb.create = 0;
11581157
ret = imap_exec_m(ctx, &cb, "APPEND \"%s%s\" ", prefix, box);
@@ -1308,7 +1307,7 @@ int main(int argc, char **argv)
13081307
{
13091308
struct strbuf all_msgs = STRBUF_INIT;
13101309
struct strbuf msg = STRBUF_INIT;
1311-
struct store *ctx = NULL;
1310+
struct imap_store *ctx = NULL;
13121311
int ofs = 0;
13131312
int r;
13141313
int total, n = 0;
@@ -1364,7 +1363,7 @@ int main(int argc, char **argv)
13641363
}
13651364

13661365
fprintf(stderr, "sending %d message%s\n", total, (total != 1) ? "s" : "");
1367-
ctx->name = imap_folder;
1366+
ctx->gen.name = imap_folder;
13681367
while (1) {
13691368
unsigned percent = n * 100 / total;
13701369

0 commit comments

Comments
 (0)