isync

mailbox synchronization program
git clone https://git.code.sf.net/p/isync/isync
Log | Files | Refs | README | LICENSE

commit 1fdf793a3fb9f4704977ef49e0a490a83291ea4d
parent 1e939bafd88fba862db538176520e4c88bebe424
Author: Oswald Buddenhagen <ossi@users.sf.net>
Date:   Wed, 29 Mar 2017 15:14:56 +0200

fix signedness of 'nex' variables

they are derived from srec->status, which is unsigned. for not
understood reasons, the compiler complains only after extending status
to a full unsigned int.

on the way, localize the declarations.

Diffstat:
Msrc/sync.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/sync.c b/src/sync.c @@ -1374,7 +1374,7 @@ box_loaded( int sts, void *aux ) message_t *tmsg; flag_vars_t *fv; int uid, no[2], del[2], alive, todel, t1, t2; - int sflags, nflags, aflags, dflags, nex; + int sflags, nflags, aflags, dflags; uint hashsz, idx; char fbuf[16]; /* enlarge when support for keywords is added */ @@ -1709,7 +1709,7 @@ box_loaded( int sts, void *aux ) if (!srec->tuid[0]) { if (!srec->msg[S]) continue; - nex = (srec->status / S_NEXPIRE) & 1; + uint nex = (srec->status / S_NEXPIRE) & 1; if (nex != ((srec->status / S_EXPIRED) & 1)) { /* The record needs a state change ... */ if (nex != ((srec->status / S_EXPIRE) & 1)) { @@ -1986,7 +1986,7 @@ flags_set_p2( sync_vars_t *svars, sync_rec_t *srec, int t ) Fprintf( svars->jfp, "* %d %d %u\n", srec->uid[M], srec->uid[S], nflags ); } if (t == S) { - int nex = (srec->status / S_NEXPIRE) & 1; + uint nex = (srec->status / S_NEXPIRE) & 1; if (nex != ((srec->status / S_EXPIRED) & 1)) { if (nex && (svars->smaxxuid < srec->uid[S])) svars->smaxxuid = srec->uid[S];