Fix some type comparison problems
PATCH 1/1 Fix some type comparison problems
It complains when building on s390 and i686 platform.
Signed-off-by Xiao Ni <[email protected]>
--- Monitor.c | 2 +- util.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Monitor.c +1 -1
@@ -542,7 +542,7 @@ static int check_array(struct state *st, struct mdstat_ent *mdstat,alert ("NewArray" , st->devname,NULL , ainfo); } - if (st->utime == array.utime && + if ((unsigned int)st->utime == array.utime && st->failed == array.failed_disks && st->working == array.working_disks && st->spare == array.spare_disks &&
util.c +1 -1
@@ -1267,7 +1267,7 @@ struct supertype *guess_super_type(int fd, enum guess_types guess_type)*/ struct superswitch *ss;struct supertype *st; -time_t besttime =0 ; +unsigned int besttime =0 ;int bestsuper =-1 ;int i;
Signature · 1 line
2.4.3
Quoted 3 lines · Xiao Ni
It complains when building on s390 and i686 platform.
Signed-off-by Xiao Ni <[email protected]>
Hi Xiao,
The description needs to be a little clearer - something more like "Change utime to unsigned int to be able to hold times until 2106."
Quoted 10 lines
--- Monitor.c | 2 +- util.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)Monitor.c +0
-0
Monitor.c static int check_array(struct state *st, struct mdstat_ent *mdstat, · line 548
Quoted 8 lines
Monitor.c +1
-1@@ -542,7 +542,7 @@ static int check_array(struct state *st, struct mdstat_ent *mdstat,alert ("NewArray" , st->devname,NULL , ainfo); } - if (st->utime == array.utime && + if ((unsigned int)st->utime == array.utime && st->failed == array.failed_disks && st->working == array.working_disks && st->spare == array.spare_disks &&
Instead of the cast, please change the type in struct state.
util.c struct supertype *guess_super_type(int fd, enum guess_types guess_type) · line 1272
Quoted 12 lines
util.c +1
-1@@ -1267,7 +1267,7 @@ struct supertype *guess_super_type(int fd, enum guess_types guess_type)*/ struct superswitch *ss;struct supertype *st; -time_t besttime =0 ; +unsigned int besttime =0 ;int bestsuper =-1 ;int i;
This one is fine.
Thanks,
Jes