]> git.webhop.me Git - lcd4linux.git/commitdiff
timer.c: I had forgotten how to initialize a "struct" :)
authormzuther <mzuther@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Sat, 6 Feb 2010 23:51:27 +0000 (23:51 +0000)
committermzuther <mzuther@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Sat, 6 Feb 2010 23:51:27 +0000 (23:51 +0000)
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1104 3ae390bd-cb1e-0410-b409-cd5a39f66f1f

timer.c

diff --git a/timer.c b/timer.c
index a38b76bf2ebae1b76d51ca220fb15574e47074f7..dfdb6e85eecf3d03d965c9c274761d8aacf2ca61 100644 (file)
--- a/timer.c
+++ b/timer.c
@@ -77,9 +77,10 @@ int nTimers = 0;
 
 static void timer_inc(struct timeval *tv, const int msec)
 {
-    struct timeval diff;
-    diff.tv_sec = msec / 1000;
-    diff.tv_usec = (msec % 1000) * 1000;
+    struct timeval diff = {
+       .tv_sec = msec / 1000,
+       .tv_usec = (msec % 1000) * 1000
+    };
 
     timeradd(tv, &diff, tv);
 }