commit 170d527cf970d9b7893b46e7153ffcfc64c3c918
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Sun Jul 28 21:24:17 2019 +0200

    shrink some data at the source to avoid subsequent narrowing

 src/common.h | 5 +++--
 src/config.c | 2 +-
 src/config.h | 2 +-
 src/sync.c   | 8 ++++----
 src/util.c   | 2 +-
 5 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/src/common.h b/src/common.h
index d1ade52..4946306 100644
--- a/src/common.h
+++ b/src/common.h
@@ -217,7 +217,8 @@ typedef struct notifier {
 #ifdef HAVE_SYS_POLL_H
        int index;
 #else
-       int fd, events;
+       int fd;
+       short events;
 #endif
 } notifier_t;
 
@@ -230,7 +231,7 @@ typedef struct notifier {
 #endif
 
 void init_notifier( notifier_t *sn, int fd, void (*cb)( int, void * ), void 
*aux );
-void conf_notifier( notifier_t *sn, int and_events, int or_events );
+void conf_notifier( notifier_t *sn, short and_events, short or_events );
 void wipe_notifier( notifier_t *sn );
 
 typedef struct {
diff --git a/src/config.c b/src/config.c
index a2c0dda..f22e259 100644
--- a/src/config.c
+++ b/src/config.c
@@ -86,7 +86,7 @@ get_arg( conffile_t *cfile, int required, int *comment )
        return ret;
 }
 
-int
+char
 parse_bool( conffile_t *cfile )
 {
        if (!strcasecmp( cfile->val, "yes" ) ||
diff --git a/src/config.h b/src/config.h
index 2025347..779c3ee 100644
--- a/src/config.h
+++ b/src/config.h
@@ -40,7 +40,7 @@ typedef struct {
 
 char *get_arg( conffile_t *cfile, int required, int *comment );
 
-int parse_bool( conffile_t *cfile );
+char parse_bool( conffile_t *cfile );
 int parse_int( conffile_t *cfile );
 int parse_size( conffile_t *cfile );
 int getcline( conffile_t *cfile );
diff --git a/src/sync.c b/src/sync.c
index 2ba1a3f..3e6d10a 100644
--- a/src/sync.c
+++ b/src/sync.c
@@ -1387,7 +1387,7 @@ box_loaded( int sts, message_t *msgs, int total_msgs, int 
recent_msgs, void *aux
        message_t *tmsg;
        flag_vars_t *fv;
        int no[2], del[2], alive, todel;
-       int sflags, nflags, aflags, dflags;
+       uchar sflags, nflags, aflags, dflags;
        uint hashsz, idx;
 
        if (check_ret( sts, aux ))
@@ -1723,7 +1723,7 @@ box_loaded( int sts, message_t *msgs, int total_msgs, int 
recent_msgs, void *aux
                        if (!(srec->status & S_PENDING)) {
                                if (!srec->msg[S])
                                        continue;
-                               uint nex = (srec->wstate / W_NEXPIRE) & 1;
+                               uchar nex = (srec->wstate / W_NEXPIRE) & 1;
                                if (nex != ((srec->status / S_EXPIRED) & 1)) {
                                        /* The record needs a state change ... 
*/
                                        if (nex != ((srec->status / S_EXPIRE) & 
1)) {
@@ -1984,14 +1984,14 @@ flags_set_p2( sync_vars_t *svars, sync_rec_t *srec, int 
t )
                jFprintf( svars, "%c %u %u 0\n", "><"[t], srec->uid[M], 
srec->uid[S] );
                srec->uid[1-t] = 0;
        } else {
-               uint nflags = (srec->flags | srec->aflags[t]) & 
~srec->dflags[t];
+               uchar nflags = (srec->flags | srec->aflags[t]) & 
~srec->dflags[t];
                if (srec->flags != nflags) {
                        debug( "  pair(%u,%u): updating flags (%u -> %u; 
%sed)\n", srec->uid[M], srec->uid[S], srec->flags, nflags, str_hl[t] );
                        srec->flags = nflags;
                        jFprintf( svars, "* %u %u %u\n", srec->uid[M], 
srec->uid[S], nflags );
                }
                if (t == S) {
-                       uint nex = (srec->wstate / W_NEXPIRE) & 1;
+                       uchar nex = (srec->wstate / W_NEXPIRE) & 1;
                        if (nex != ((srec->status / S_EXPIRED) & 1)) {
                                debug( "  pair(%u,%u): expired %d (commit)\n", 
srec->uid[M], srec->uid[S], nex );
                                srec->status = (srec->status & ~S_EXPIRED) | 
(nex * S_EXPIRED);
diff --git a/src/util.c b/src/util.c
index 04c1432..943c905 100644
--- a/src/util.c
+++ b/src/util.c
@@ -685,7 +685,7 @@ init_notifier( notifier_t *sn, int fd, void (*cb)( int, 
void * ), void *aux )
 }
 
 void
-conf_notifier( notifier_t *sn, int and_events, int or_events )
+conf_notifier( notifier_t *sn, short and_events, short or_events )
 {
 #ifdef HAVE_SYS_POLL_H
        int idx = sn->index;


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

Reply via email to