Mail Archives: djgpp-workers/2014/04/20/09:09:41
Am 20.04.2014 07:37, schrieb Ozkan Sezer:
> On 4/20/14, Juan Manuel Guerrero <juan DOT guerrero AT gmx DOT de> wrote:
> [snip]
>> * djgpp/src/libc/ansi/time/ctime.c: Fix warning: comparison is always
>> false due to limited range of data type.
> zoneinfo/src/localtime.c needs the same adjustment (failed
> mentioning this before, because it didn't stop the build.)
>
> Index: zoneinfo/src/localtime.c
> ===================================================================
> RCS file: /cvs/djgpp/djgpp/zoneinfo/src/localtime.c,v
> retrieving revision 1.5
> diff -u -p -r1.5 localtime.c
> --- zoneinfo/src/localtime.c 17 Aug 2013 21:04:13 -0000 1.5
> +++ zoneinfo/src/localtime.c 20 Apr 2014 05:33:28 -0000
> @@ -344,7 +344,7 @@ differ_by_repeat(const time_t t1, const
> if (TYPE_INTEGRAL(time_t) &&
> TYPE_BIT(time_t) - TYPE_SIGNED(time_t) < SECSPERREPEAT_BITS)
> return 0;
> - return t1 - t0 == SECSPERREPEAT;
> + return (int_fast64_t)t1 - (int_fast64_t)t0 == SECSPERREPEAT;
> }
>
> static int
>
> --
> O.S.
Committed patch below.
Did the perl fix work for you?
Regards,
Juan M. Guerrero
2014-04-20 Juan Manuel Guerrero <juan DOT guerrero AT gmx DOT de>
* djgpp/zoneinfo/src/localtime.c: Fix warning: comparison is always false due to limited range of data type. From Ozkan Sezer <sezeroz AT gmail DOT com>
Logging in to :pserver:anonymous AT cvs DOT delorie DOT com:2401/cvs/djgpp
Index: djgpp/zoneinfo/src/localtime.c
===================================================================
RCS file: /cvs/djgpp/djgpp/zoneinfo/src/localtime.c,v
retrieving revision 1.5
diff -p -U 5 -r1.5 localtime.c
--- djgpp/zoneinfo/src/localtime.c 17 Aug 2013 21:04:13 -0000 1.5
+++ djgpp/zoneinfo/src/localtime.c 20 Apr 2014 12:57:48 -0000
@@ -342,11 +342,11 @@ static int
differ_by_repeat(const time_t t1, const time_t t0)
{
if (TYPE_INTEGRAL(time_t) &&
TYPE_BIT(time_t) - TYPE_SIGNED(time_t) < SECSPERREPEAT_BITS)
return 0;
- return t1 - t0 == SECSPERREPEAT;
+ return (int_fast64_t)t1 - (int_fast64_t)t0 == SECSPERREPEAT;
}
static int
tzload(register const char *name, register struct state *const sp,
register const int doextend)
- Raw text -