Remove build warnings of sensor logger 39/105739/1
authorSomin Kim <somin926.kim@samsung.com>
Mon, 19 Dec 2016 10:31:12 +0000 (19:31 +0900)
committerSomin Kim <somin926.kim@samsung.com>
Mon, 19 Dec 2016 10:31:12 +0000 (19:31 +0900)
Change-Id: I95c406121642eb614a8745f31df0c216e541edc6
Signed-off-by: Somin Kim <somin926.kim@samsung.com>
src/sensor/pedometer/PedometerLogger.cpp
src/sensor/pressure/PressureLogger.cpp
src/sensor/sleep/SleepLogger.cpp

index d4c820aae00a46e891b712aa93c8869600c3cbde..b27fa3dda9c31a791edd43c0de653971cfc4c65d 100644 (file)
@@ -14,6 +14,7 @@
  * limitations under the License.
  */
 
+#include <inttypes.h>
 #include <sqlite3.h>
 #include <SensorRecorderTypes.h>
 #include "../TypesInternal.h"
@@ -156,7 +157,7 @@ void PedometerLogger::__recordBatch(sensor_pedometer_data_t *eventData, uint64_t
                }
 
                /* TODO: check the timestamps.. they look strange.. */
-               g_snprintf(buffer, sizeof(buffer), "(%llu, %llu, %d, %d, %.3f, %.3f),",
+               g_snprintf(buffer, sizeof(buffer), "(%" PRIu64 ", %" PRIu64 ", %d, %d, %.3f, %.3f),",
                                i == 0 ? __baseline.timestamp : SEC_TO_MS(static_cast<uint64_t>(eventData->diffs[i-1].timestamp)),
                                SEC_TO_MS(static_cast<uint64_t>(eventData->diffs[i].timestamp)),
                                eventData->diffs[i].walk_steps,
index 8cdc5473ba365cb0e4c5df640aa6d6ee2b3049d5..0bb1fe4bec95b24b8681ba8b333100c6958cc237 100644 (file)
@@ -14,6 +14,7 @@
  * limitations under the License.
  */
 
+#include <inttypes.h>
 #include <sqlite3.h>
 #include <SensorRecorderTypes.h>
 #include "../TypesInternal.h"
@@ -98,7 +99,7 @@ void PressureLogger::__record(float pressure, uint64_t eventTime)
        IF_FAIL_VOID(eventTime - __lastEventTime >= RESAMPLING_INTERVAL);
 
        char buffer[64];
-       g_snprintf(buffer, sizeof(buffer), "(%llu, %.5f),", eventTime, pressure);
+       g_snprintf(buffer, sizeof(buffer), "(%" PRIu64 ", %.5f),", eventTime, pressure);
        _D("[%u] %s", __cacheCount, buffer);
 
        __insertionQuery += buffer;
index 9771ae60e5d44b845fd0dcc0db4c5e30276711f9..171df5b9de95732f6e8032d6c9ab463bb87f05e5 100644 (file)
@@ -14,6 +14,7 @@
  * limitations under the License.
  */
 
+#include <inttypes.h>
 #include <sqlite3.h>
 #include <SensorRecorderTypes.h>
 #include "../TypesInternal.h"
@@ -164,6 +165,6 @@ void SleepLogger::__appendQuery(uint64_t startTime, uint64_t endTime)
        IF_FAIL_VOID(startTime > 0 && endTime > startTime);
 
        char buffer[64];
-       g_snprintf(buffer, sizeof(buffer), "(%llu, %llu),", startTime, endTime);
+       g_snprintf(buffer, sizeof(buffer), "(%" PRIu64 ", %" PRIu64 "),", startTime, endTime);
        __insertionQuery += buffer;
 }