Try to fix: time out expired immediately sandbox/jsmoeller/timerfix
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>
Thu, 19 Jul 2018 10:16:54 +0000 (19:16 +0900)
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>
Thu, 19 Jul 2018 10:16:54 +0000 (19:16 +0900)
Bug-AGL: SPEC-1471

Change-Id: I13b3cdc1b0f735588b4f352c6ed1822a5cb966af
Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
src/window_manager.cpp

index eadf7ff..27a87ed 100644 (file)
@@ -30,7 +30,7 @@ extern "C"
 namespace wm
 {
 
-static const unsigned kTimeOut = 3000000UL; /* 3s */
+static const unsigned kTimeOut = 3000000; /* 3s */
 
 /* DrawingArea name used by "{layout}.{area}" */
 const char kNameLayoutNormal[] = "normal";
@@ -1457,7 +1457,7 @@ void WindowManager::setTimer()
     {
         // firsttime set into sd_event
         int ret = sd_event_add_time(afb_daemon_get_event_loop(), &g_timer_ev_src,
-            CLOCK_REALTIME, time(NULL) * (1000000UL) + kTimeOut, 1, processTimerHandler, this);
+            CLOCK_REALTIME, time(NULL) * (1000000) + kTimeOut, 1, processTimerHandler, this);
         if (ret < 0)
         {
             HMI_ERROR("wm", "Could't set timer");
@@ -1466,7 +1466,7 @@ void WindowManager::setTimer()
     else
     {
         // update timer limitation after second time
-        sd_event_source_set_time(g_timer_ev_src, time(NULL) * (1000000UL) + kTimeOut);
+        sd_event_source_set_time(g_timer_ev_src, time(NULL) * (1000000) + kTimeOut);
         sd_event_source_set_enabled(g_timer_ev_src, SD_EVENT_ONESHOT);
     }
 }