From fb385114cd65449990d620d382fa7cbd3d377428 Mon Sep 17 00:00:00 2001 From: Don Cross Date: Sat, 4 Nov 2023 16:20:09 -0400 Subject: [PATCH] Fixed type warnings in integer expressions. --- generate/template/astronomy.c | 4 ++-- source/c/astronomy.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/generate/template/astronomy.c b/generate/template/astronomy.c index bf520ec1..07d42993 100644 --- a/generate/template/astronomy.c +++ b/generate/template/astronomy.c @@ -1312,10 +1312,10 @@ astro_utc_t Astronomy_UtcFromTime_Julian(astro_time_t time) const int64_t h = 5 * g + 2; utc.day = (h % 153) / 5 + 1; utc.month = ((h / 153 + 2) % 12) + 1; - utc.year = e / 1461 - 4716 + (12 + 2 - utc.month) / 12; + utc.year = (int)(e / 1461 - 4716 + (12 + 2 - utc.month) / 12); if (cycles > 0) - utc.year -= cycles * 4; + utc.year -= (int)(cycles * 4); double ignore; double dayFraction = modf(julianDatePlus12Hours, &ignore); diff --git a/source/c/astronomy.c b/source/c/astronomy.c index b798519c..d150380d 100644 --- a/source/c/astronomy.c +++ b/source/c/astronomy.c @@ -1318,10 +1318,10 @@ astro_utc_t Astronomy_UtcFromTime_Julian(astro_time_t time) const int64_t h = 5 * g + 2; utc.day = (h % 153) / 5 + 1; utc.month = ((h / 153 + 2) % 12) + 1; - utc.year = e / 1461 - 4716 + (12 + 2 - utc.month) / 12; + utc.year = (int)(e / 1461 - 4716 + (12 + 2 - utc.month) / 12); if (cycles > 0) - utc.year -= cycles * 4; + utc.year -= (int)(cycles * 4); double ignore; double dayFraction = modf(julianDatePlus12Hours, &ignore);