mesh: Fix type checking for 32 vs 64 bit systems
authorBrian Gix <brian.gix@intel.com>
Wed, 27 Feb 2019 18:12:55 +0000 (10:12 -0800)
committerAnupam Roy <anupam.r@samsung.com>
Tue, 17 Dec 2019 14:15:01 +0000 (19:45 +0530)
Change-Id: I3636c1633d504f0bc4f04b8068503453cc111938
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
mesh/cfgmod-server.c
mesh/model.c

index 992d4ac..9dc82ee 100644 (file)
@@ -1129,7 +1129,7 @@ static bool cfg_srv_pkt(uint16_t src, uint32_t dst,
                gettimeofday(&time_now, NULL);
                time_now.tv_sec -= hb->sub_start;
 
-               if (time_now.tv_sec >= hb->sub_period)
+               if (time_now.tv_sec >= (long int) hb->sub_period)
                        time_now.tv_sec = 0;
                else
                        time_now.tv_sec = hb->sub_period - time_now.tv_sec;
index 1e302b7..5940f68 100644 (file)
@@ -414,15 +414,15 @@ static void cmplt(uint16_t remote, uint8_t status,
 
        gettimeofday(&tx_end, NULL);
        if (tx_end.tv_sec == tx_start.tv_sec) {
-               l_debug("Duration 0.%zu seconds",
+               l_debug("Duration 0.%6.6lu seconds",
                                tx_end.tv_usec - tx_start.tv_usec);
        } else {
                if (tx_start.tv_usec > tx_end.tv_usec)
-                       l_debug("Duration %zu.%zu seconds",
+                       l_debug("Duration %lu.%6.6lu seconds",
                                tx_end.tv_sec - tx_start.tv_sec - 1,
                                tx_end.tv_usec + 1000000 - tx_start.tv_usec);
                else
-                       l_debug("Duration %zu.%zu seconds",
+                       l_debug("Duration %lu.%6.6lu seconds",
                                        tx_end.tv_sec - tx_start.tv_sec,
                                        tx_end.tv_usec - tx_start.tv_usec);
        }