xclock port: make it actually show the time

This commit is contained in:
Matheus
2022-10-24 23:08:32 -03:00
parent d4aa138036
commit e55960db68
+8 -8
View File
@@ -1,16 +1,16 @@
diff --git xclock-clean/Clock.c xclock-workdir/Clock.c
index de6beb6..0e92cb6 100644
index de6beb6..6d726ef 100644
--- xclock-clean/Clock.c
+++ xclock-workdir/Clock.c
@@ -1281,6 +1281,8 @@ time_millis(struct tm *tm, struct timeval *tv)
static unsigned long
time_intervals(unsigned long millis, unsigned long interval)
@@ -1292,7 +1292,7 @@ static void
round_time(float _update, struct tm *tm, struct timeval *tv)
{
+ if(!interval)
+ return millis;
return (millis + interval / 2) / interval;
}
/* interval in milliseconds */
- unsigned long update = (int) (_update * 1000.0 + 0.5);
+ unsigned long update = roundf(_update * 1000.0 + 0.5);
/* compute milliseconds since midnight */
unsigned long old_secs = time_seconds(tm);
diff --git xclock-clean/configure.ac xclock-workdir/configure.ac
index 7d9847b..e15fecd 100644
--- xclock-clean/configure.ac