qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v2] qtest: avoid a warning with RTC test


From: Blue Swirl
Subject: [Qemu-devel] [PATCH v2] qtest: avoid a warning with RTC test
Date: Fri, 30 Mar 2012 19:19:19 +0000

Avoid this warning on OpenBSD:
  CC    tests/rtc-test.o
/src/qemu/tests/rtc-test.c: In function 'check_time':
/src/qemu/tests/rtc-test.c:171: warning: format '%ld' expects type
'long int', but argument 2 has type 'time_t'
/src/qemu/tests/rtc-test.c:173: warning: format '%ld' expects type
'long int', but argument 2 has type 'time_t'

Signed-off-by: Blue Swirl <address@hidden>
---

v2: make t and s longs.

---
 tests/rtc-test.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/rtc-test.c b/tests/rtc-test.c
index c32b36a..983a980 100644
--- a/tests/rtc-test.c
+++ b/tests/rtc-test.c
@@ -161,12 +161,12 @@ static void check_time(int wiggle)
     }

     if (!(tm_cmp(&start, datep) <= 0 && tm_cmp(datep, &end) <= 0)) {
-        time_t t, s;
+        long t, s;

         start.tm_isdst = datep->tm_isdst;

-        t = mktime(datep);
-        s = mktime(&start);
+        t = (long)mktime(datep);
+        s = (long)mktime(&start);
         if (t < s) {
             g_test_message("RTC is %ld second(s) behind
wall-clock\n", (s - t));
         } else {
-- 
1.7.9



reply via email to

[Prev in Thread] Current Thread [Next in Thread]