make more use of SVARS_CHECK_RET{,_VARS} macro

This commit is contained in:
Oswald Buddenhagen 2022-05-11 12:37:14 +02:00
parent 4d75c45507
commit 6bfffa177a

View File

@ -451,12 +451,7 @@ box_confirmed2( sync_vars_t *svars, int t )
static void static void
box_deleted( int sts, void *aux ) box_deleted( int sts, void *aux )
{ {
DECL_SVARS; SVARS_CHECK_RET;
if (check_ret( sts, aux ))
return;
INIT_SVARS(aux);
delete_state( svars ); delete_state( svars );
svars->drv[t]->finish_delete_box( svars->ctx[t] ); svars->drv[t]->finish_delete_box( svars->ctx[t] );
sync_bail( svars ); sync_bail( svars );
@ -465,12 +460,7 @@ box_deleted( int sts, void *aux )
static void static void
box_created( int sts, void *aux ) box_created( int sts, void *aux )
{ {
DECL_SVARS; SVARS_CHECK_RET;
if (check_ret( sts, aux ))
return;
INIT_SVARS(aux);
svars->drv[t]->open_box( svars->ctx[t], box_opened, AUX ); svars->drv[t]->open_box( svars->ctx[t], box_opened, AUX );
} }
@ -779,7 +769,6 @@ static void msgs_copied( sync_vars_t *svars, int t );
static void static void
box_loaded( int sts, message_t *msgs, int total_msgs, int recent_msgs, void *aux ) box_loaded( int sts, message_t *msgs, int total_msgs, int recent_msgs, void *aux )
{ {
DECL_SVARS;
sync_rec_t *srec, **srecmap; sync_rec_t *srec, **srecmap;
message_t *tmsg; message_t *tmsg;
flag_vars_t *fv; flag_vars_t *fv;
@ -787,9 +776,7 @@ box_loaded( int sts, message_t *msgs, int total_msgs, int recent_msgs, void *aux
uchar sflags, nflags, aflags, dflags; uchar sflags, nflags, aflags, dflags;
uint hashsz, idx; uint hashsz, idx;
if (check_ret( sts, aux )) SVARS_CHECK_RET;
return;
INIT_SVARS(aux);
svars->state[t] |= ST_LOADED; svars->state[t] |= ST_LOADED;
svars->msgs[t] = msgs; svars->msgs[t] = msgs;
info( "%s: %d messages, %d recent\n", str_fn[t], total_msgs, recent_msgs ); info( "%s: %d messages, %d recent\n", str_fn[t], total_msgs, recent_msgs );
@ -1722,14 +1709,9 @@ msgs_flags_set( sync_vars_t *svars, int t )
static void static void
msg_trashed( int sts, void *aux ) msg_trashed( int sts, void *aux )
{ {
trash_vars_t *vars = (trash_vars_t *)aux;
DECL_SVARS;
if (sts == DRV_MSG_BAD) if (sts == DRV_MSG_BAD)
sts = DRV_BOX_BAD; sts = DRV_BOX_BAD;
if (check_ret( sts, vars->aux )) SVARS_CHECK_RET_VARS(trash_vars_t);
return;
INIT_SVARS(vars->aux);
JLOG( "T %d %u", (t, vars->msg->uid), "trashed on %s", str_fn[t] ); JLOG( "T %d %u", (t, vars->msg->uid), "trashed on %s", str_fn[t] );
free( vars ); free( vars );
trash_done[t]++; trash_done[t]++;