commit 9e0efd409a3cc9c0ce45e55702234f04bec3bef1
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Wed May 11 12:56:16 2022 +0200

    prefer DECL_INIT_SVARS over DECL_SVARS+INIT_SVARS
    
    ... as a result of relying on C99+.

 src/sync.c | 21 ++++++---------------
 1 file changed, 6 insertions(+), 15 deletions(-)

diff --git a/src/sync.c b/src/sync.c
index 286564ae..527d972d 100644
--- a/src/sync.c
+++ b/src/sync.c
@@ -240,11 +240,9 @@ check_cancel( sync_vars_t *svars )
 static int
 check_ret( int sts, void *aux )
 {
-       DECL_SVARS;
-
        if (sts == DRV_CANCELED)
                return 1;
-       INIT_SVARS(aux);
+       DECL_INIT_SVARS(aux);
        if (sts == DRV_BOX_BAD) {
                svars->ret |= SYNC_FAIL;
                cancel_sync( svars );
@@ -254,27 +252,24 @@ check_ret( int sts, void *aux )
 }
 
 #define SVARS_CHECK_RET \
-       DECL_SVARS; \
        if (check_ret( sts, aux )) \
                return; \
-       INIT_SVARS(aux)
+       DECL_INIT_SVARS(aux)
 
 #define SVARS_CHECK_RET_VARS(type) \
        type *vars = (type *)aux; \
-       DECL_SVARS; \
        if (check_ret( sts, vars->aux )) { \
                free( vars ); \
                return; \
        } \
-       INIT_SVARS(vars->aux)
+       DECL_INIT_SVARS(vars->aux)
 
 #define SVARS_CHECK_CANCEL_RET \
-       DECL_SVARS; \
        if (sts == SYNC_CANCELED) { \
                free( vars ); \
                return; \
        } \
-       INIT_SVARS(vars->aux)
+       DECL_INIT_SVARS(vars->aux)
 
 static void
 message_expunged( message_t *msg, void *aux )
@@ -376,11 +371,9 @@ sync_boxes( store_t *ctx[], const char * const names[], 
int present[], channel_c
 static void
 box_confirmed( int sts, uint uidvalidity, void *aux )
 {
-       DECL_SVARS;
-
        if (sts == DRV_CANCELED)
                return;
-       INIT_SVARS(aux);
+       DECL_INIT_SVARS(aux);
        if (check_cancel( svars ))
                return;
 
@@ -467,11 +460,9 @@ box_created( int sts, void *aux )
 static void
 box_opened( int sts, uint uidvalidity, void *aux )
 {
-       DECL_SVARS;
-
        if (sts == DRV_CANCELED)
                return;
-       INIT_SVARS(aux);
+       DECL_INIT_SVARS(aux);
        if (check_cancel( svars ))
                return;
 


_______________________________________________
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to