mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 23:18:21 +00:00
xclock port: make it actually show the time
This commit is contained in:
@@ -1,16 +1,16 @@
|
|||||||
diff --git xclock-clean/Clock.c xclock-workdir/Clock.c
|
diff --git xclock-clean/Clock.c xclock-workdir/Clock.c
|
||||||
index de6beb6..0e92cb6 100644
|
index de6beb6..6d726ef 100644
|
||||||
--- xclock-clean/Clock.c
|
--- xclock-clean/Clock.c
|
||||||
+++ xclock-workdir/Clock.c
|
+++ xclock-workdir/Clock.c
|
||||||
@@ -1281,6 +1281,8 @@ time_millis(struct tm *tm, struct timeval *tv)
|
@@ -1292,7 +1292,7 @@ static void
|
||||||
static unsigned long
|
round_time(float _update, struct tm *tm, struct timeval *tv)
|
||||||
time_intervals(unsigned long millis, unsigned long interval)
|
|
||||||
{
|
{
|
||||||
+ if(!interval)
|
/* interval in milliseconds */
|
||||||
+ return millis;
|
- unsigned long update = (int) (_update * 1000.0 + 0.5);
|
||||||
return (millis + interval / 2) / interval;
|
+ 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
|
diff --git xclock-clean/configure.ac xclock-workdir/configure.ac
|
||||||
index 7d9847b..e15fecd 100644
|
index 7d9847b..e15fecd 100644
|
||||||
--- xclock-clean/configure.ac
|
--- xclock-clean/configure.ac
|
||||||
|
|||||||
Reference in New Issue
Block a user