return type is changed to signed type for time related functions 27/179527/2
authorJeonghoon Park <jh1979.park@samsung.com>
Fri, 18 May 2018 10:12:33 +0000 (19:12 +0900)
committerJeonghoon Park <jh1979.park@samsung.com>
Fri, 18 May 2018 10:13:37 +0000 (10:13 +0000)
Change-Id: Ifc82a0a610734d05bd68eda62e034305ecda387d

common/common-util.c
common/common-util.h
daemon/src/tizen-things-daemon.c
lib/things-service/src/things-service.c

index 1f15fbe..56ce36e 100644 (file)
@@ -24,7 +24,7 @@
 #define CLOCK_MONOTONIC_COARSE CLOCK_MONOTONIC
 #endif
 
-unsigned long long common_get_monotonic_time(void)
+long long common_get_monotonic_time(void)
 {
        struct timespec ts;
        int result;
@@ -37,7 +37,7 @@ unsigned long long common_get_monotonic_time(void)
        return (((unsigned long long) ts.tv_sec) * 1000000) + (ts.tv_nsec / 1000);
 }
 
-unsigned long long common_get_monotonic_coarse_time(void)
+long long common_get_monotonic_coarse_time(void)
 {
        struct timespec ts;
        int result;
@@ -50,9 +50,9 @@ unsigned long long common_get_monotonic_coarse_time(void)
        return (((unsigned long long) ts.tv_sec) * 1000000) + (ts.tv_nsec / 1000);
 }
 
-unsigned long long common_get_epoch_time(void)
+long long common_get_epoch_time(void)
 {
-       unsigned long long int ret_time = 0;
+       long long int ret_time = 0;
        struct timespec time_s;
 
        if (0 == clock_gettime(CLOCK_REALTIME, &time_s))
@@ -61,9 +61,9 @@ unsigned long long common_get_epoch_time(void)
        return ret_time;
 }
 
-unsigned long long common_get_epoch_coarse_time(void)
+long long common_get_epoch_coarse_time(void)
 {
-       unsigned long long int ret_time = 0;
+       long long int ret_time = 0;
        struct timespec time_s;
 
        if (0 == clock_gettime(CLOCK_REALTIME_COARSE, &time_s))
index f7c574c..22c0489 100644 (file)
 
 #define EPOCH_TIME_REF 1526515200000000 /* 2018-05-17 GMT */
 
-unsigned long long common_get_monotonic_time(void);
-unsigned long long common_get_monotonic_coarse_time(void);
+long long common_get_monotonic_time(void);
+long long common_get_monotonic_coarse_time(void);
 
-unsigned long long common_get_epoch_time(void);
-unsigned long long common_get_epoch_coarse_time(void);
+long long common_get_epoch_time(void);
+long long common_get_epoch_coarse_time(void);
 int common_get_epoch_timespec(struct timespec *tp);
 int common_get_epoch_coarse_timespec(struct timespec *tp);
 
index 567104a..6b25ebe 100644 (file)
@@ -45,9 +45,9 @@ typedef struct __ttd_data {
 static gboolean __daemon_job_handler(gpointer data);
 static gboolean __cloud_try_connect(gpointer data);
 
-static unsigned long long _get_monotonic_time(void)
+static long long _get_monotonic_time(void)
 {
-       unsigned long long m_time = 0;
+       long long m_time = 0;
        m_time  = common_get_monotonic_time();
        if (m_time == 0)
                _E("failed to get monotonic time");
@@ -250,7 +250,7 @@ static gboolean __do_device_register(gpointer data)
 int main(int argc, char* argv[])
 {
        ttd_data *d_data = NULL;
-       unsigned long long start = 0;
+       long long start = 0;
 
        start = _get_monotonic_time();
 
index aa50aec..270feb6 100644 (file)
@@ -59,9 +59,9 @@ static char *_get_token(const char *appID)
        char *checksum = NULL;
        char *key = NULL;
 
-       key = g_strdup_printf("%s-%u-%llu",
+       key = g_strdup_printf("%s-%u-%lld",
                        appID, getpid(), common_get_monotonic_coarse_time());
-       checksum = g_compute_checksum_for_string (G_CHECKSUM_MD5, key, -1);
+       checksum = g_compute_checksum_for_string(G_CHECKSUM_MD5, key, -1);
        g_free(key);
 
        return checksum;