[PATCH dockapps 2/4] wmmoonclock: fix type of arguments to `gmtime(3)` and `localtime(3)`

2 views
Skip to first unread message

Jeremy Sowden

unread,
Dec 24, 2024, 10:56:05 AM12/24/24
to Window Maker Dev
With recent versions of gcc, on architectures where `long` and `time_t` are not
the same size, passing pointers to `long` to `gmtime(3)` and `localtime(3)`,
leads to "incompatible pointer type" errors. Use `time_t` instead.

Link: https://bugs.debian.org/1091282
Signed-off-by: Jeremy Sowden <jer...@azazel.net>
---
wmmoonclock/src/wmMoonClock.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/wmmoonclock/src/wmMoonClock.c b/wmmoonclock/src/wmMoonClock.c
index df579e677967..bf34b534c3fa 100644
--- a/wmmoonclock/src/wmMoonClock.c
+++ b/wmmoonclock/src/wmMoonClock.c
@@ -157,7 +157,8 @@ int main(int argc, char *argv[]) {
struct tm *GMTTime, *LocalTime;
XEvent event;
int i, n, j, ImageNumber, Year, Month, DayOfMonth, digit;
- long CurrentLocalTime, CurrentGMTTime, date;
+ time_t CurrentLocalTime, CurrentGMTTime;
+ long date;
double UT, val, RA, DEC, UTRise, UTSet, LocalHour, hour24();
int D, H, M, S, sgn, A, B, q;
CTrans c;
--
2.45.2

Reply all
Reply to author
Forward
0 new messages