From: Russ Allbery Date: Wed, 14 Jul 2010 17:02:08 +0000 (-0700) Subject: Fix ktime test on 64-bit systems X-Git-Tag: debian/1.5.75-2~2 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=d94a993eba86130e731f54e36780a0294ba00610;p=packages%2Fo%2Fopenafs.git Fix ktime test on 64-bit systems 0xffffffff is a bad representation for -1 when the size of the data type may vary. Rather than forcing everything to 32 bits and losing later on platforms with 64-bit time_t, change the table to use time_t and try to add a cast that will do the right thing. Change-Id: Id532c9b7a1fc215dc9fd532592fecb2ea45597a0 Reviewed-on: http://gerrit.openafs.org/2420 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear (cherry picked from commit a1351d48410383090befd63b34407caf55b8f654) --- diff --git a/tests/util/ktime-t.c b/tests/util/ktime-t.c index 568cd3a05..fefbcb370 100644 --- a/tests/util/ktime-t.c +++ b/tests/util/ktime-t.c @@ -24,10 +24,10 @@ static struct testTime { char *time; long code; - long sec; + time_t sec; } testTimes[] = { { "now", 1, 0 }, /* lookup current time */ - { "never", 0, 0xffffffff }, + { "never", 0, (afs_int32) -1 }, { "12/3/89", 0, 628664400 }, { "1/1/1", 0, 978325200 }, { "1/0/80", -2, 0 },