dissolve SVARS_CHECK_CANCEL_RET
it was small and used only twice, so didn't really pull its weight.
This commit is contained in:
parent
ffb290084a
commit
f29dbb18f1
15
src/sync.c
15
src/sync.c
|
@ -271,13 +271,6 @@ check_ret( int sts, void *aux )
|
||||||
} \
|
} \
|
||||||
DECL_INIT_SVARS(vars->aux)
|
DECL_INIT_SVARS(vars->aux)
|
||||||
|
|
||||||
#define SVARS_CHECK_CANCEL_RET \
|
|
||||||
if (sts == COPY_CANCELED) { \
|
|
||||||
free( vars ); \
|
|
||||||
return; \
|
|
||||||
} \
|
|
||||||
DECL_INIT_SVARS(vars->aux)
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
message_expunged( message_t *msg, void *aux )
|
message_expunged( message_t *msg, void *aux )
|
||||||
{
|
{
|
||||||
|
@ -1394,7 +1387,7 @@ box_loaded( int sts, message_t *msgs, int total_msgs, int recent_msgs, void *aux
|
||||||
static void
|
static void
|
||||||
msg_copied( int sts, uint uid, copy_vars_t *vars )
|
msg_copied( int sts, uint uid, copy_vars_t *vars )
|
||||||
{
|
{
|
||||||
SVARS_CHECK_CANCEL_RET;
|
DECL_INIT_SVARS(vars->aux);
|
||||||
sync_rec_t *srec = vars->srec;
|
sync_rec_t *srec = vars->srec;
|
||||||
switch (sts) {
|
switch (sts) {
|
||||||
case COPY_OK:
|
case COPY_OK:
|
||||||
|
@ -1409,6 +1402,8 @@ msg_copied( int sts, uint uid, copy_vars_t *vars )
|
||||||
break;
|
break;
|
||||||
default: // COPY_FAIL
|
default: // COPY_FAIL
|
||||||
cancel_sync( svars );
|
cancel_sync( svars );
|
||||||
|
FALLTHROUGH
|
||||||
|
case COPY_CANCELED:
|
||||||
free( vars );
|
free( vars );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1721,13 +1716,15 @@ msg_trashed( int sts, void *aux )
|
||||||
static void
|
static void
|
||||||
msg_rtrashed( int sts, uint uid ATTR_UNUSED, copy_vars_t *vars )
|
msg_rtrashed( int sts, uint uid ATTR_UNUSED, copy_vars_t *vars )
|
||||||
{
|
{
|
||||||
SVARS_CHECK_CANCEL_RET;
|
DECL_INIT_SVARS(vars->aux);
|
||||||
switch (sts) {
|
switch (sts) {
|
||||||
case COPY_OK:
|
case COPY_OK:
|
||||||
case COPY_NOGOOD: /* the message is gone or heavily busted */
|
case COPY_NOGOOD: /* the message is gone or heavily busted */
|
||||||
break;
|
break;
|
||||||
default: // COPY_FAIL
|
default: // COPY_FAIL
|
||||||
cancel_sync( svars );
|
cancel_sync( svars );
|
||||||
|
FALLTHROUGH
|
||||||
|
case COPY_CANCELED:
|
||||||
free( vars );
|
free( vars );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user