Fix invalid log format 29/133929/5
authorJiwoong Im <jiwoong.im@samsung.com>
Wed, 14 Jun 2017 04:49:51 +0000 (13:49 +0900)
committerJiwoong Im <jiwoong.im@samsung.com>
Mon, 26 Jun 2017 04:16:49 +0000 (13:16 +0900)
Change-Id: I4a9848d7df60e35d49082e6fce130d54ce59896d
Signed-off-by: Jiwoong Im <jiwoong.im@samsung.com>
alarm-manager-schedule.c
alarm-manager-timer.c
alarm-manager.c
src/alarm-lib-stub.c
src/alarm-lib.c

index 3f5e844..bcf1f48 100644 (file)
@@ -151,7 +151,7 @@ static time_t __alarm_next_duetime_once(__alarm_info_t *__alarm_info)
 
        if ((__alarm_info->alarm_info.alarm_type & ALARM_TYPE_RELATIVE) && __alarm_info->start != 0)
        {
-               ALARM_MGR_EXCEPTION_PRINT("Final due_time = %d, %s",
+               ALARM_MGR_EXCEPTION_PRINT("Final due_time = %ld, %s",
                                __alarm_info->start, ctime(&__alarm_info->start));
                return __alarm_info->start;
        }
@@ -188,10 +188,10 @@ static time_t __alarm_next_duetime_once(__alarm_info_t *__alarm_info)
                due_time_tmp = mktime(&duetime_tm);
                localtime_r(&due_time_tmp, &tmp_tm);
 
-               ALARM_MGR_LOG_PRINT("%d:%d:%d. duetime = %d", tmp_tm.tm_hour, tmp_tm.tm_min, tmp_tm.tm_sec, due_time);
+               ALARM_MGR_LOG_PRINT("%d:%d:%d. duetime = %ld", tmp_tm.tm_hour, tmp_tm.tm_min, tmp_tm.tm_sec, due_time);
                if (tmp_tm.tm_hour == start->hour && tmp_tm.tm_min == start->min && tmp_tm.tm_sec == start->sec) {
                        due_time = due_time_tmp;
-                       ALARM_MGR_EXCEPTION_PRINT("due_time = %d", due_time);
+                       ALARM_MGR_EXCEPTION_PRINT("due_time = %ld", due_time);
                }
        } else {
                localtime_r(&due_time, &tmp_tm);
@@ -201,11 +201,11 @@ static time_t __alarm_next_duetime_once(__alarm_info_t *__alarm_info)
                        /* When the calculated duetime is forwarded 1hour due to DST, Adds 23hours. */
                        due_time += 60 * 60 * 23;
                        localtime_r(&due_time, &duetime_tm);
-                       ALARM_MGR_EXCEPTION_PRINT("due_time = %d", due_time);
+                       ALARM_MGR_EXCEPTION_PRINT("due_time = %ld", due_time);
                }
        }
 
-       ALARM_MGR_EXCEPTION_PRINT("Final due_time = %d, %s", due_time, ctime(&due_time));
+       ALARM_MGR_EXCEPTION_PRINT("Final due_time = %ld, %s", due_time, ctime(&due_time));
        return due_time;
 }
 
@@ -362,7 +362,7 @@ static time_t __alarm_next_duetime_weekly(__alarm_info_t *__alarm_info)
 
        due_time = mktime(&duetime_tm);
        localtime_r(&due_time, &tmp_tm);
-       ALARM_MGR_LOG_PRINT("%d:%d:%d. duetime = %d, isdst = %d", tmp_tm.tm_hour, tmp_tm.tm_min, tmp_tm.tm_sec, due_time, tmp_tm.tm_isdst);
+       ALARM_MGR_LOG_PRINT("%d:%d:%d. duetime = %ld, isdst = %d", tmp_tm.tm_hour, tmp_tm.tm_min, tmp_tm.tm_sec, due_time, tmp_tm.tm_isdst);
 
        if (due_time <= current_time) {
                ALARM_MGR_EXCEPTION_PRINT("duetime is less than or equal to current time. current_dst = %d", current_dst);
@@ -371,21 +371,21 @@ static time_t __alarm_next_duetime_weekly(__alarm_info_t *__alarm_info)
                due_time = mktime(&duetime_tm);
                localtime_r(&due_time, &tmp_tm);
 
-               SECURE_LOGD("%d:%d:%d. duetime = %d", tmp_tm.tm_hour, tmp_tm.tm_min, tmp_tm.tm_sec, due_time);
+               SECURE_LOGD("%d:%d:%d. duetime = %ld", tmp_tm.tm_hour, tmp_tm.tm_min, tmp_tm.tm_sec, due_time);
                if (tmp_tm.tm_hour != start->hour || tmp_tm.tm_min != start->min || tmp_tm.tm_sec != start->sec) {
                        duetime_tm.tm_hour = start->hour;
                        duetime_tm.tm_min = start->min;
                        duetime_tm.tm_sec = start->sec;
                        duetime_tm.tm_isdst = -1;
                        due_time = mktime(&duetime_tm);
-                       ALARM_MGR_LOG_PRINT("due_time = %d", due_time);
+                       ALARM_MGR_LOG_PRINT("due_time = %ld", due_time);
                }
        } else {
                if (current_dst == 1 && tmp_tm.tm_isdst == 1 && tmp_tm.tm_hour == start->hour + 1) {
                        /* When the calculated duetime is forwarded 1hour due to DST, Adds 23hours. */
                        due_time += 60 * 60 * 23;
                        localtime_r(&due_time, &duetime_tm);
-                       ALARM_MGR_LOG_PRINT("due_time = %d", due_time);
+                       ALARM_MGR_LOG_PRINT("due_time = %ld", due_time);
                }
        }
 
@@ -395,7 +395,7 @@ static time_t __alarm_next_duetime_weekly(__alarm_info_t *__alarm_info)
 
        wday = duetime_tm.tm_wday;
 
-       ALARM_MGR_LOG_PRINT("current_time(%d) due_time(%d)", current_time, due_time);
+       ALARM_MGR_LOG_PRINT("current_time(%ld) due_time(%ld)", current_time, due_time);
 
        /* CQ defect(72810) : only one time alarm function is not working
           under all recurrence_disabled. */
@@ -432,7 +432,7 @@ static time_t __alarm_next_duetime_weekly(__alarm_info_t *__alarm_info)
        else if (before_tm.tm_isdst == 0 && after_tm.tm_isdst == 1)
                due_time -= 60 * 60;    /* Subtract an hour */
 
-       ALARM_MGR_LOG_PRINT("Final due_time = %d", due_time);
+       ALARM_MGR_LOG_PRINT("Final due_time = %ld", due_time);
        return due_time;
 }
 
@@ -483,7 +483,7 @@ time_t _alarm_next_duetime(__alarm_info_t *__alarm_info)
                        due_time = mktime(due_tm);
        }
 
-       ALARM_MGR_LOG_PRINT("alarm_id: %d, next duetime: %d", __alarm_info->alarm_id, due_time);
+       ALARM_MGR_LOG_PRINT("alarm_id: %d, next duetime: %ld", __alarm_info->alarm_id, due_time);
 
        if (__alarm_info->end != 0 && __alarm_info->end < due_time) {
                ALARM_MGR_LOG_PRINT("due time > end time");
@@ -512,7 +512,7 @@ static bool __find_next_alarm_to_be_scheduled(time_t *min_due_time)
 
                double interval = 0;
 
-               SECURE_LOGD("alarm[%d] with duetime(%u) at current(%u) pid: (%d)\n",
+               SECURE_LOGD("alarm[%d] with duetime(%ld) at current(%ld) pid: (%d)\n",
                                entry->alarm_id, due_time, current_time, entry->pid);
                if (due_time == 0)      /*0 means this alarm has been disabled*/ {
                        continue;
index 60dbc72..02c40af 100644 (file)
@@ -65,7 +65,7 @@ bool _alarm_set_timer(__alarm_server_context_t *alarm_context, int timer, time_t
        time(&current_time);
 
        interval = difftime(due_time, current_time);
-       ALARM_MGR_LOG_PRINT("[alarm-server][timer]: remain time from current is %f , due_time is %d.", interval, due_time);
+       ALARM_MGR_LOG_PRINT("[alarm-server][timer]: remain time from current is %f , due_time is %ld.", interval, due_time);
 
        /*set timer as absolute time */
        /*we create dummy timer when the interval is longer than one day. */
@@ -87,7 +87,7 @@ bool _alarm_set_timer(__alarm_server_context_t *alarm_context, int timer, time_t
        time_spec.it_interval.tv_sec = time_spec.it_interval.tv_nsec = 0;
 
        if (interval > 0 && timerfd_settime(timer, TFD_TIMER_ABSTIME, &time_spec, NULL) != 0) {
-               ALARM_MGR_EXCEPTION_PRINT("set timer has failed : timer(%d), due_time(%u) , errno(%d).", timer, due_time, errno);
+               ALARM_MGR_EXCEPTION_PRINT("set timer has failed : timer(%d), due_time(%ld) , errno(%d).", timer, due_time, errno);
                return false;
        }
        /* we set c_due_time to due_time due to allow newly created alarm can
index 10d6a4f..7664a49 100644 (file)
@@ -266,7 +266,7 @@ void __hashtable_foreach_cb(gpointer key, gpointer value, gpointer user_data)
 {
        appid_cache_t *data = value;
        if (data)
-               ALARM_MGR_LOG_PRINT("# %s(%d) - %s - %d", data->unique_name, data->pid, data->is_app);
+               ALARM_MGR_LOG_PRINT("# %s(%d) - %d", data->unique_name, data->pid, data->is_app);
 }
 
 void __free_cached_value(gpointer data)
@@ -828,7 +828,7 @@ static bool __alarm_update_due_time_of_all_items_in_list(double diff_time)
 
                double interval = 0;
 
-               ALARM_MGR_LOG_PRINT("alarm[%d] with duetime(%u) at current(%u)", entry->alarm_id, due_time, current_time);
+               ALARM_MGR_LOG_PRINT("alarm[%d] with duetime(%ld) at current(%ld)", entry->alarm_id, due_time, current_time);
                if (due_time == 0) {    /* 0 means this alarm has been disabled */
                        continue;
                }
@@ -944,7 +944,7 @@ static bool __alarm_create_appsvc(alarm_info_t *alarm_info, alarm_id_t *alarm_id
 
        if (alarm_context.c_due_time < current_time) {
                ALARM_MGR_EXCEPTION_PRINT("Caution!! alarm_context.c_due_time "
-               "(%d) is less than current time(%d)", alarm_context.c_due_time, current_time);
+               "(%ld) is less than current time(%ld)", alarm_context.c_due_time, current_time);
                alarm_context.c_due_time = -1;
        }
 
@@ -961,11 +961,11 @@ static bool __alarm_create_appsvc(alarm_info_t *alarm_info, alarm_id_t *alarm_id
                return true;
        } else if (current_time == due_time) {
                ALARM_MGR_EXCEPTION_PRINT("[alarm-server]:Create alarm: "
-                    "current_time(%d) is same as due_time(%d)", current_time,
+                    "current_time(%ld) is same as due_time(%ld)", current_time,
                     due_time);
                return true;
        } else if (difftime(due_time, current_time) < 0) {
-               ALARM_MGR_EXCEPTION_PRINT("[alarm-server]: Expired Due Time.[Due time=%d, Current Time=%d]!!!Do not add to schedule list\n", due_time, current_time);
+               ALARM_MGR_EXCEPTION_PRINT("[alarm-server]: Expired Due Time.[Due time=%ld, Current Time=%ld]!!!Do not add to schedule list\n", due_time, current_time);
                return true;
        } else {
                localtime_r(&due_time, &ts_ret);
@@ -975,7 +975,7 @@ static bool __alarm_create_appsvc(alarm_info_t *alarm_info, alarm_id_t *alarm_id
                                    due_time_r);
        }
 
-       ALARM_MGR_LOG_PRINT("[alarm-server]:alarm_context.c_due_time(%d), due_time(%d)", alarm_context.c_due_time, due_time);
+       ALARM_MGR_LOG_PRINT("[alarm-server]:alarm_context.c_due_time(%ld), due_time(%ld)", alarm_context.c_due_time, due_time);
 
        if (alarm_context.c_due_time == -1 || due_time < alarm_context.c_due_time) {
                _clear_scheduled_alarm_list();
@@ -1057,7 +1057,7 @@ static bool __alarm_create(alarm_info_t *alarm_info, alarm_id_t *alarm_id, uid_t
        time(&current_time);
 
        SECURE_LOGD("[alarm-server]:pid=%d, app_unique_name=%s, "
-               "app_service_name=%s,dst_service_name=%s, c_due_time=%d", \
+               "app_service_name=%s,dst_service_name=%s, c_due_time=%ld", \
                pid, g_quark_to_string(__alarm_info->quark_app_unique_name), \
                g_quark_to_string(__alarm_info->quark_app_service_name), \
                g_quark_to_string(__alarm_info->quark_dst_service_name), \
@@ -1065,7 +1065,7 @@ static bool __alarm_create(alarm_info_t *alarm_info, alarm_id_t *alarm_id, uid_t
 
        if (alarm_context.c_due_time < current_time) {
                ALARM_MGR_EXCEPTION_PRINT("Caution!! alarm_context.c_due_time "
-               "(%d) is less than current time(%d)", alarm_context.c_due_time, current_time);
+               "(%ld) is less than current time(%ld)", alarm_context.c_due_time, current_time);
                alarm_context.c_due_time = -1;
        }
 
@@ -1079,11 +1079,11 @@ static bool __alarm_create(alarm_info_t *alarm_info, alarm_id_t *alarm_id, uid_t
                ALARM_MGR_EXCEPTION_PRINT("[alarm-server]:Create a new alarm: due_time is 0, alarm(%d).", *alarm_id);
                return true;
        } else if (current_time == due_time) {
-               ALARM_MGR_EXCEPTION_PRINT("[alarm-server]:Create alarm: current_time(%d) is same as due_time(%d).",
+               ALARM_MGR_EXCEPTION_PRINT("[alarm-server]:Create alarm: current_time(%ld) is same as due_time(%ld).",
                        current_time, due_time);
                return true;
        } else if (difftime(due_time, current_time) <  0) {
-               ALARM_MGR_EXCEPTION_PRINT("[alarm-server]: Expired Due Time.[Due time=%d, Current Time=%d]!!!Do not add to schedule list.",
+               ALARM_MGR_EXCEPTION_PRINT("[alarm-server]: Expired Due Time.[Due time=%ld, Current Time=%ld]!!!Do not add to schedule list.",
                        due_time, current_time);
                return true;
        } else {
@@ -1094,7 +1094,7 @@ static bool __alarm_create(alarm_info_t *alarm_info, alarm_id_t *alarm_id, uid_t
                SECURE_LOGD("[alarm-server]:Create a new alarm: alarm(%d) due_time(%s)", *alarm_id, due_time_r);
        }
 
-       ALARM_MGR_LOG_PRINT("[alarm-server]:alarm_context.c_due_time(%d), due_time(%d)", alarm_context.c_due_time, due_time);
+       ALARM_MGR_LOG_PRINT("[alarm-server]:alarm_context.c_due_time(%ld), due_time(%ld)", alarm_context.c_due_time, due_time);
 
        if (alarm_context.c_due_time == -1 || due_time < alarm_context.c_due_time) {
                _clear_scheduled_alarm_list();
@@ -1174,7 +1174,7 @@ static bool __alarm_create_noti(alarm_info_t *alarm_info, alarm_id_t *alarm_id,
        time(&current_time);
 
        SECURE_LOGD("[alarm-server]:pid=%d, app_unique_name=%s, "
-               "app_service_name=%s,dst_service_name=%s, c_due_time=%d", \
+               "app_service_name=%s,dst_service_name=%s, c_due_time=%ld", \
                pid, g_quark_to_string(__alarm_info->quark_app_unique_name), \
                g_quark_to_string(__alarm_info->quark_app_service_name), \
                g_quark_to_string(__alarm_info->quark_dst_service_name), \
@@ -1182,7 +1182,7 @@ static bool __alarm_create_noti(alarm_info_t *alarm_info, alarm_id_t *alarm_id,
 
        if (alarm_context.c_due_time < current_time) {
                ALARM_MGR_EXCEPTION_PRINT("Caution!! alarm_context.c_due_time "
-               "(%d) is less than current time(%d)", alarm_context.c_due_time, current_time);
+               "(%ld) is less than current time(%ld)", alarm_context.c_due_time, current_time);
                alarm_context.c_due_time = -1;
        }
 
@@ -1196,11 +1196,11 @@ static bool __alarm_create_noti(alarm_info_t *alarm_info, alarm_id_t *alarm_id,
                ALARM_MGR_EXCEPTION_PRINT("[alarm-server]:Create a new alarm: due_time is 0, alarm(%d).", *alarm_id);
                return true;
        } else if (current_time == due_time) {
-               ALARM_MGR_EXCEPTION_PRINT("[alarm-server]:Create alarm: current_time(%d) is same as due_time(%d).",
+               ALARM_MGR_EXCEPTION_PRINT("[alarm-server]:Create alarm: current_time(%ld) is same as due_time(%ld).",
                        current_time, due_time);
                return true;
        } else if (difftime(due_time, current_time) <  0) {
-               ALARM_MGR_EXCEPTION_PRINT("[alarm-server]: Expired Due Time.[Due time=%d, Current Time=%d]!!!Do not add to schedule list.",
+               ALARM_MGR_EXCEPTION_PRINT("[alarm-server]: Expired Due Time.[Due time=%ld, Current Time=%ld]!!!Do not add to schedule list.",
                        due_time, current_time);
                return true;
        } else {
@@ -1209,7 +1209,7 @@ static bool __alarm_create_noti(alarm_info_t *alarm_info, alarm_id_t *alarm_id,
                SECURE_LOGD("[alarm-server]:Create a new alarm: alarm(%d) due_time(%s)", *alarm_id, due_time_r);
        }
 
-       ALARM_MGR_LOG_PRINT("[alarm-server]:alarm_context.c_due_time(%d), due_time(%d)", alarm_context.c_due_time, due_time);
+       ALARM_MGR_LOG_PRINT("[alarm-server]:alarm_context.c_due_time(%ld), due_time(%ld)", alarm_context.c_due_time, due_time);
 
        if (alarm_context.c_due_time == -1 || due_time < alarm_context.c_due_time) {
                _clear_scheduled_alarm_list();
@@ -1238,7 +1238,7 @@ static bool __alarm_update(uid_t uid, int pid, alarm_id_t alarm_id,
 
        if (alarm_context.c_due_time < current_time) {
                ALARM_MGR_EXCEPTION_PRINT("Caution!! alarm_context.c_due_time "
-               "(%d) is less than current time(%d)", alarm_context.c_due_time, current_time);
+               "(%ld) is less than current time(%ld)", alarm_context.c_due_time, current_time);
                alarm_context.c_due_time = -1;
        }
 
@@ -1275,11 +1275,11 @@ static bool __alarm_update(uid_t uid, int pid, alarm_id_t alarm_id,
                return true;
        } else if (current_time == due_time) {
                ALARM_MGR_EXCEPTION_PRINT("[alarm-server]:Update alarm: "
-               "current_time(%d) is same as due_time(%d)", current_time,
+               "current_time(%ld) is same as due_time(%ld)", current_time,
                due_time);
                return true;
        } else if (difftime(due_time, current_time) < 0) {
-               ALARM_MGR_EXCEPTION_PRINT("[alarm-server]: Expired Due Time.[Due time=%d, Current Time=%d]!!!Do not add to schedule list\n", due_time, current_time);
+               ALARM_MGR_EXCEPTION_PRINT("[alarm-server]: Expired Due Time.[Due time=%ld, Current Time=%ld]!!!Do not add to schedule list\n", due_time, current_time);
                return true;
        } else {
                char due_time_r[100] = { 0 };
@@ -1290,7 +1290,7 @@ static bool __alarm_update(uid_t uid, int pid, alarm_id_t alarm_id,
                                    "due_time(%s)\n", alarm_id, due_time_r);
        }
 
-       ALARM_MGR_LOG_PRINT("[alarm-server]:alarm_context.c_due_time(%d), due_time(%d)", alarm_context.c_due_time, due_time);
+       ALARM_MGR_LOG_PRINT("[alarm-server]:alarm_context.c_due_time(%ld), due_time(%ld)", alarm_context.c_due_time, due_time);
 
        if (alarm_context.c_due_time == -1 || due_time < alarm_context.c_due_time) {
                _clear_scheduled_alarm_list();
@@ -1298,11 +1298,11 @@ static bool __alarm_update(uid_t uid, int pid, alarm_id_t alarm_id,
                _alarm_set_timer(&alarm_context, alarm_context.timer, due_time);
                alarm_context.c_due_time = due_time;
                ALARM_MGR_LOG_PRINT("[alarm-server1]:alarm_context.c_due_time "
-                    "(%d), due_time(%d)", alarm_context.c_due_time, due_time);
+                    "(%ld), due_time(%ld)", alarm_context.c_due_time, due_time);
        } else if (due_time == alarm_context.c_due_time) {
                _add_to_scheduled_alarm_list(__alarm_info);
                ALARM_MGR_LOG_PRINT("[alarm-server2]:alarm_context.c_due_time "
-                    "(%d), due_time(%d)", alarm_context.c_due_time, due_time);
+                    "(%ld), due_time(%ld)", alarm_context.c_due_time, due_time);
        }
 
        __rtc_set();
@@ -1726,17 +1726,17 @@ static void __alarm_expired()
        time(&current_time);
 
        interval = difftime(alarm_context.c_due_time, current_time);
-       ALARM_MGR_LOG_PRINT("[alarm-server]: c_due_time(%d), current_time(%d), interval(%d)",
+       ALARM_MGR_LOG_PRINT("[alarm-server]: c_due_time(%ld), current_time(%ld), interval(%f)",
                alarm_context.c_due_time, current_time, interval);
 
        if (alarm_context.c_due_time > current_time + 1) {
-               ALARM_MGR_EXCEPTION_PRINT("[alarm-server]: False Alarm. due time is (%d) seconds future",
+               ALARM_MGR_EXCEPTION_PRINT("[alarm-server]: False Alarm. due time is (%ld) seconds future",
                        alarm_context.c_due_time - current_time);
                goto done;
        }
        /* 10 seconds is maximum permitted delay from timer expire to this function */
        if (alarm_context.c_due_time + 10 < current_time) {
-               ALARM_MGR_EXCEPTION_PRINT("[alarm-server]: False Alarm. due time is (%d) seconds past.",
+               ALARM_MGR_EXCEPTION_PRINT("[alarm-server]: False Alarm. due time is (%ld) seconds past.",
                        current_time - alarm_context.c_due_time);
                goto done;
        }
@@ -1855,7 +1855,7 @@ static void __alarm_expired()
                        }
 
                        ret = pkgmgrinfo_appinfo_get_usr_appinfo(appid, __alarm_info->uid, &appinfo_handle);
-                       ALARM_MGR_LOG_PRINT("appid : %s (%x)", appid, appinfo_handle);
+                       ALARM_MGR_LOG_PRINT("appid : %s (%p)", appid, appinfo_handle);
                        if (appinfo_handle)
                                pkgmgrinfo_appinfo_destroy_appinfo(appinfo_handle);
 
@@ -1924,7 +1924,7 @@ static void __alarm_expired()
                ALARM_MGR_LOG_PRINT("alarm_id[%d] is expired.", alarm_id);
 
 #ifdef _APPFW_FEATURE_ALARM_MANAGER_MODULE_LOG
-               snprintf(log_message, sizeof(log_message), "alarmID: %d, pid: %d, duetime: %d", alarm_id, app_pid, (int)__alarm_info->due_time);
+               snprintf(log_message, sizeof(log_message), "alarmID: %d, pid: %d, duetime: %ld", alarm_id, app_pid, __alarm_info->due_time);
                __save_module_log("EXPIRED", log_message);
 #endif
 
@@ -1976,7 +1976,7 @@ static gboolean __alarm_handler_idle(gpointer user_data)
         */
        time(&current_time);
        if (alarm_context.c_due_time == current_time) {
-               ALARM_MGR_LOG_PRINT("Expire alarms forcibly when duetime is same to current time(%d).", current_time);
+               ALARM_MGR_LOG_PRINT("Expire alarms forcibly when duetime is same to current time(%ld).", current_time);
                __alarm_expired();
                _alarm_schedule();
        }
@@ -2012,7 +2012,7 @@ static void __on_system_time_external_changed(keynode_t *node, void *data)
        ALARM_MGR_LOG_PRINT("diff_time is %f, New time is %s\n", diff_time, ctime(&cur_time));
 
        ALARM_MGR_LOG_PRINT("[alarm-server] System time has been changed externally\n");
-       ALARM_MGR_LOG_PRINT("1.alarm_context.c_due_time is %d\n",
+       ALARM_MGR_LOG_PRINT("1.alarm_context.c_due_time is %ld\n",
                            alarm_context.c_due_time);
 
        __set_time(cur_time);
@@ -2026,7 +2026,7 @@ static void __on_system_time_external_changed(keynode_t *node, void *data)
 
        __alarm_update_due_time_of_all_items_in_list(diff_time);
 
-       ALARM_MGR_LOG_PRINT("2.alarm_context.c_due_time is %d\n",
+       ALARM_MGR_LOG_PRINT("2.alarm_context.c_due_time is %ld\n",
                            alarm_context.c_due_time);
        _clear_scheduled_alarm_list();
        _alarm_schedule();
@@ -2191,7 +2191,7 @@ bool __get_caller_unique_name(int pid, char *unique_name, bool *is_app, uid_t ui
                fd = open(proc_file, O_RDONLY);
                if (fd < 0) {
                        SECURE_LOGE("Caution!! pid(%d) seems to be killed.",
-                                       pid, proc_file);
+                                       pid);
                        return false;
                } else {
                        if (read(fd, process_name, sizeof(process_name) - 1) <= 0) {
@@ -2404,7 +2404,7 @@ gboolean __alarm_expired_directly(gpointer user_data)
                if (g_dummy_timer_is_set == true) {
                        ALARM_MGR_LOG_PRINT("dummy alarm timer has expired.");
                } else {
-                       ALARM_MGR_LOG_PRINT("due_time=%d is expired.", alarm_info->due_time);
+                       ALARM_MGR_LOG_PRINT("due_time=%ld is expired.", alarm_info->due_time);
                        __alarm_expired();
                }
 
@@ -2432,7 +2432,7 @@ void __reschedule_alarms_with_newtime(int cur_time, int new_time, double diff_ti
        bundle_free(b);
 
        __alarm_update_due_time_of_all_items_in_list(diff_time); /* Rescheduling alarms with ALARM_TYPE_RELATIVE */
-       ALARM_MGR_LOG_PRINT("Next duetime is %d", alarm_context.c_due_time);
+       ALARM_MGR_LOG_PRINT("Next duetime is %ld", alarm_context.c_due_time);
 
        _clear_scheduled_alarm_list();
        _alarm_schedule();
@@ -2560,7 +2560,7 @@ gboolean alarm_manager_alarm_set_time(AlarmManager *pObj, GDBusMethodInvocation
        }
 
        __set_time(time_sec); /* Change both OS time and RTC */
-       ALARM_MGR_LOG_PRINT("[TIMESTAMP]Current time(%d), New time(%d)(%s), diff_time(%f)",
+       ALARM_MGR_LOG_PRINT("[TIMESTAMP]Current time(%ld), New time(%d)(%s), diff_time(%f)",
                                                                        cur_time.tv_sec, time_sec, ctime((const time_t *)&time_sec), diff_time);
 
        __reschedule_alarms_with_newtime(cur_time.tv_sec, time_sec, diff_time);
@@ -2585,7 +2585,7 @@ gboolean alarm_manager_alarm_set_time_with_propagation_delay(AlarmManager *pObj,
 
        /* Check validation of requested time */
        if (req_sec > cur_time.tv_sec || (req_sec == cur_time.tv_sec && req_nsec > cur_time.tv_nsec)) {
-               ALARM_MGR_EXCEPTION_PRINT("The requeted time(%d.%09d) must be equal to or less than current time(%d.%09d).",
+               ALARM_MGR_EXCEPTION_PRINT("The requeted time(%d.%09d) must be equal to or less than current time(%ld.%09ld).",
                        req_sec, req_nsec, cur_time.tv_sec, cur_time.tv_nsec);
                g_dbus_method_invocation_return_value(invoc, g_variant_new("(i)", ERR_ALARM_INVALID_PARAM));
                return true;
@@ -2613,9 +2613,9 @@ gboolean alarm_manager_alarm_set_time_with_propagation_delay(AlarmManager *pObj,
        __set_time(real_newtime); /* Change both OS time and RTC */
 
        diff_time = difftime(real_newtime, cur_time.tv_sec);
-       ALARM_MGR_LOG_PRINT("[TIMESTAMP]Current time(%d.%09d), New time(%d.%09d), Real Newtime(%d), diff_time(%f)",
+       ALARM_MGR_LOG_PRINT("[TIMESTAMP]Current time(%ld.%09ld), New time(%d.%09d), Real Newtime(%d), diff_time(%f)",
                cur_time.tv_sec, cur_time.tv_nsec, new_sec, new_nsec, real_newtime, diff_time);
-       ALARM_MGR_LOG_PRINT("Requested(%d.%09d) Delay(%d.%09d) Sleep(%09d)", req_sec, req_nsec, delay.tv_sec, delay.tv_nsec, sleep_time.tv_nsec);
+       ALARM_MGR_LOG_PRINT("Requested(%d.%09d) Delay(%ld.%09ld) Sleep(%09ld)", req_sec, req_nsec, delay.tv_sec, delay.tv_nsec, sleep_time.tv_nsec);
        __reschedule_alarms_with_newtime(cur_time.tv_sec, real_newtime, diff_time);
        g_dbus_method_invocation_return_value(invoc, g_variant_new("(i)", ALARMMGR_RESULT_SUCCESS));
        return true;
@@ -2661,7 +2661,7 @@ gboolean alarm_manager_alarm_set_timezone(AlarmManager *pObject, GDBusMethodInvo
        /* Rescheduling alarms */
        _alarm_disable_timer(alarm_context);
        __alarm_update_due_time_of_all_items_in_list(0);
-       ALARM_MGR_LOG_PRINT("next expiring due_time is %d", alarm_context.c_due_time);
+       ALARM_MGR_LOG_PRINT("next expiring due_time is %ld", alarm_context.c_due_time);
 
        _clear_scheduled_alarm_list();
        _alarm_schedule();
@@ -2934,7 +2934,7 @@ time_t _get_periodic_alarm_standard_time(void)
        if (periodic_alarm_standard_time == 0)
                periodic_alarm_standard_time = g_random_int_range(0, BILLION) + 1;
 
-       ALARM_MGR_LOG_PRINT("periodic_standard_time : [%d]", periodic_alarm_standard_time);
+       ALARM_MGR_LOG_PRINT("periodic_standard_time : [%ld]", periodic_alarm_standard_time);
        return periodic_alarm_standard_time;
 }
 
@@ -3566,7 +3566,7 @@ gboolean alarm_manager_alarm_get_all_info(AlarmManager *pObject, GDBusMethodInvo
                if (uid >= REGULAR_UID_MIN && entry->uid != uid)
                        continue;
                ++index;
-               SECURE_LOGD("#%d alarm id[%d] app_name[%s] duetime[%d]",
+               SECURE_LOGD("#%d alarm id[%d] app_name[%s] duetime[%ld]",
                        index, entry->alarm_id, g_quark_to_string(entry->quark_app_unique_name), entry->start);
 
                alarm_info_t *alarm_info = (alarm_info_t *) &(entry->alarm_info);
index b6f282d..6d40278 100644 (file)
@@ -102,7 +102,8 @@ bool _send_alarm_create_noti(alarm_context_t context, alarm_info_t *alarm_info,
                /* g_dbus_proxy_call_sync error */
                /* error_code should be set */
                ALARM_MGR_EXCEPTION_PRINT(
-                               "alarm_manager_call_alarm_create_noti_sync()failed. alarm_id[%d], return_code[%d].", alarm_id, return_code);
+                               "alarm_manager_call_alarm_create_noti_sync()failed. alarm_id[%d], return_code[%d].",
+                               *(int *)alarm_id, return_code);
                if (error_code) {
                        if (error && error->code == G_DBUS_ERROR_ACCESS_DENIED)
                                *error_code = ERR_ALARM_NO_PERMISSION;
@@ -169,7 +170,8 @@ bool _send_alarm_create_appsvc(alarm_context_t context, alarm_info_t *alarm_info
                /* g_dbus_proxy_call_sync error */
                /* error_code should be set */
                ALARM_MGR_EXCEPTION_PRINT(
-                               "alarm_manager_call_alarm_create_appsvc_sync()failed. alarm_id[%d], return_code[%d].", alarm_id, return_code);
+                               "alarm_manager_call_alarm_create_appsvc_sync()failed. alarm_id[%d], return_code[%d].",
+                               *(int *)alarm_id, return_code);
                if (error_code) {
                        if (error && error->code == G_DBUS_ERROR_ACCESS_DENIED)
                                *error_code = ERR_ALARM_NO_PERMISSION;
@@ -232,7 +234,8 @@ bool _send_alarm_create(alarm_context_t context, alarm_info_t *alarm_info,
                /* g_dbus_proxy_call_sync error error */
                /* error_code should be set */
                ALARM_MGR_EXCEPTION_PRINT(
-                               "alarm_manager_call_alarm_create_sync()failed. alarm_id[%d], return_code[%d]", alarm_id, return_code);
+                               "alarm_manager_call_alarm_create_sync()failed. alarm_id[%d], return_code[%d]",
+                               *(int *)alarm_id, return_code);
                if (error_code) {
                        if (error && error->code == G_DBUS_ERROR_ACCESS_DENIED)
                                *error_code = ERR_ALARM_NO_PERMISSION;
@@ -274,7 +277,7 @@ bool _send_alarm_create_periodic(alarm_context_t context, int interval, int is_r
                                interval, is_ref, method,
                                alarm_id, &return_code, NULL, &error)) {
                ALARM_MGR_EXCEPTION_PRINT("alarm_manager_call_alarm_create_periodic_sync()failed. alarm_id[%d], return_code[%d]",
-                               alarm_id, return_code);
+                               *(int *)alarm_id, return_code);
                if (error_code) {
                        if (error && error->code == G_DBUS_ERROR_ACCESS_DENIED)
                                *error_code = ERR_ALARM_NO_PERMISSION;
@@ -308,7 +311,8 @@ bundle *_send_alarm_get_appsvc_info(alarm_context_t context, alarm_id_t alarm_id
                        ((AlarmManager*)context.proxy, alarm_id, &b_data, &return_code, NULL, &error)) {
                /* g_dbus_proxy_call_sync error */
                /*error_code should be set */
-               ALARM_MGR_EXCEPTION_PRINT("alarm_manager_call_alarm_get_appsvc_info_sync() failed. alarm_id[%d], return_code[%d].", alarm_id, return_code);
+               ALARM_MGR_EXCEPTION_PRINT("alarm_manager_call_alarm_get_appsvc_info_sync() failed. alarm_id[%d], return_code[%d].",
+                               (int)alarm_id, return_code);
                if (error_code) {
                        if (error && error->code == G_DBUS_ERROR_ACCESS_DENIED)
                                *error_code = ERR_ALARM_NO_PERMISSION;
@@ -354,7 +358,8 @@ notification_h _send_alarm_get_noti_info(alarm_context_t context, alarm_id_t ala
                        ((AlarmManager*)context.proxy, alarm_id, &noti_data, &return_code, NULL, &error)) {
                /* g_dbus_proxy_call_sync error */
                /*error_code should be set */
-               ALARM_MGR_EXCEPTION_PRINT("alarm_manager_call_alarm_get_appsvc_info_sync() failed. alarm_id[%d], return_code[%d].", alarm_id, return_code);
+               ALARM_MGR_EXCEPTION_PRINT("alarm_manager_call_alarm_get_appsvc_info_sync() failed. alarm_id[%d], return_code[%d].",
+                               (int)alarm_id, return_code);
                if (error_code) {
                        if (error && error->code == G_DBUS_ERROR_ACCESS_DENIED)
                                *error_code = ERR_ALARM_NO_PERMISSION;
@@ -441,7 +446,8 @@ bool _send_alarm_delete(alarm_context_t context, alarm_id_t alarm_id, int *error
                        ((AlarmManager*)context.proxy, alarm_id, &return_code, NULL, &error)) {
                /* g_dbus_proxy_call_sync error */
                /*error_code should be set */
-               ALARM_MGR_EXCEPTION_PRINT("alarm_manager_call_alarm_delete_sync() failed. alarm_id[%d], return_code[%d]", alarm_id, return_code);
+               ALARM_MGR_EXCEPTION_PRINT("alarm_manager_call_alarm_delete_sync() failed. alarm_id[%d], return_code[%d]",
+                               (int)alarm_id, return_code);
                if (error_code) {
                        if (error && error->code == G_DBUS_ERROR_ACCESS_DENIED)
                                *error_code = ERR_ALARM_NO_PERMISSION;
@@ -512,7 +518,8 @@ bool _send_alarm_get_list_of_ids(alarm_context_t context, int maxnum_of_ids,
                /* g_dbus_proxy_call_sync error */
                /*error_code should be set */
                ALARM_MGR_EXCEPTION_PRINT(
-                               "alarm_manager_call_alarm_get_list_of_ids_sync() failed by dbus. alarm_id[%d], return_code[%d]\n", alarm_id, return_code);
+                               "alarm_manager_call_alarm_get_list_of_ids_sync() failed by dbus. alarm_id[%d], return_code[%d]\n",
+                               *(int *)alarm_id, return_code);
                if (error_code) {
                        if (error && error->code == G_DBUS_ERROR_ACCESS_DENIED)
                                *error_code = ERR_ALARM_NO_PERMISSION;
@@ -600,7 +607,8 @@ bool _send_alarm_get_info(alarm_context_t context, alarm_id_t alarm_id,
                /* g_dbus_proxy_call_sync error */
                /* error_code should be set */
                ALARM_MGR_EXCEPTION_PRINT(
-                               "alarm_manager_call_alarm_get_info_sync() failed by dbus. alarm_id[%d], return_code[%d]\n", alarm_id, return_code);
+                               "alarm_manager_call_alarm_get_info_sync() failed by dbus. alarm_id[%d], return_code[%d]\n",
+                               (int)alarm_id, return_code);
                if (error_code) {
                        if (error && error->code == G_DBUS_ERROR_ACCESS_DENIED)
                                *error_code = ERR_ALARM_NO_PERMISSION;
@@ -635,7 +643,8 @@ bool _send_alarm_get_next_duetime(alarm_context_t context,
                /*g_dbus_proxy_call_sync error */
                /*error_code should be set */
                ALARM_MGR_EXCEPTION_PRINT(
-                               "alarm_manager_call_alarm_get_next_duetime_sync() failed by dbus. alarm_id[%d], return_code[%d]\n", alarm_id, return_code);
+                               "alarm_manager_call_alarm_get_next_duetime_sync() failed by dbus. alarm_id[%d], return_code[%d]\n",
+                               (int)alarm_id, return_code);
                if (error_code) {
                        if (error && error->code == G_DBUS_ERROR_ACCESS_DENIED)
                                *error_code = ERR_ALARM_NO_PERMISSION;
@@ -952,7 +961,8 @@ bool _send_alarm_update(alarm_context_t context, alarm_id_t alarm_id,
                                &return_code,
                                NULL, &error)) {
                ALARM_MGR_EXCEPTION_PRINT(
-                               "alarm_manager_call_alarm_update_sync()failed. alarm_id[%d], return_code[%d]", alarm_id, return_code);
+                               "alarm_manager_call_alarm_update_sync()failed. alarm_id[%d], return_code[%d]",
+                               (int)alarm_id, return_code);
                ALARM_MGR_EXCEPTION_PRINT("error->message is %s(%d)", error->message, error->code);
                if (error_code) {
                        if (error->code == G_DBUS_ERROR_ACCESS_DENIED)
index b3b2ead..7be1e5d 100644 (file)
@@ -943,7 +943,7 @@ EXPORT_API int alarmmgr_add_alarm_appsvc_with_localtime(alarm_entry_t *alarm, vo
                        alarm_info->start.day, alarm_info->start.month, alarm_info->start.year,
                        alarm_info->start.hour, alarm_info->start.min, alarm_info->start.sec,
                        alarm_info->end.year, alarm_info->end.month, alarm_info->end.day,
-                       alarm_info->mode.repeat, alarm_info->mode.u_interval, alarm_info->alarm_type);
+                       alarm_info->mode.repeat, (int)alarm_info->mode.u_interval.interval, alarm_info->alarm_type);
 
        /* TODO: This should be changed to > ALARM_REPEAT_MODE_MAX ? */
        if (mode->repeat >= ALARM_REPEAT_MODE_MAX)
@@ -1001,7 +1001,7 @@ EXPORT_API int alarmmgr_add_alarm_with_localtime(alarm_entry_t *alarm,
                        alarm_info->start.day, alarm_info->start.month, alarm_info->start.year,
                        alarm_info->start.hour, alarm_info->start.min, alarm_info->start.sec,
                        alarm_info->end.year, alarm_info->end.month, alarm_info->end.day,
-                       alarm_info->mode.repeat, alarm_info->mode.u_interval, alarm_info->alarm_type);
+                       alarm_info->mode.repeat, (int)alarm_info->mode.u_interval.interval, alarm_info->alarm_type);
 
        /* TODO: This should be changed to > ALARM_REPEAT_MODE_MAX ? */
        if (mode->repeat >= ALARM_REPEAT_MODE_MAX)
@@ -1080,7 +1080,7 @@ EXPORT_API int alarmmgr_add_alarm_noti_with_localtime(alarm_entry_t *alarm, noti
                        alarm_info->start.day, alarm_info->start.month, alarm_info->start.year,
                        alarm_info->start.hour, alarm_info->start.min, alarm_info->start.sec,
                        alarm_info->end.year, alarm_info->end.month, alarm_info->end.day,
-                       alarm_info->mode.repeat, alarm_info->mode.u_interval, alarm_info->alarm_type);
+                       alarm_info->mode.repeat, (int)alarm_info->mode.u_interval.interval, alarm_info->alarm_type);
 
        /* TODO: This should be changed to > ALARM_REPEAT_MODE_MAX ? */
        if (mode->repeat >= ALARM_REPEAT_MODE_MAX)
@@ -1205,10 +1205,10 @@ EXPORT_API int alarmmgr_add_alarm_appsvc(int alarm_type, time_t trigger_at_time,
                alarm_info.mode.u_interval.interval = interval;
        }
 
-       ALARM_MGR_LOG_PRINT("trigger_at_time(%d), start(%d-%d-%d, %02d:%02d:%02d), repeat(%d), interval(%d), type(%d)",
+       ALARM_MGR_LOG_PRINT("trigger_at_time(%ld), start(%d-%d-%d, %02d:%02d:%02d), repeat(%d), interval(%d), type(%d)",
                        trigger_at_time, alarm_info.start.day, alarm_info.start.month, alarm_info.start.year,
                        alarm_info.start.hour, alarm_info.start.min, alarm_info.start.sec,
-                       alarm_info.mode.repeat, alarm_info.mode.u_interval.interval, alarm_info.alarm_type);
+                       alarm_info.mode.repeat, (int)alarm_info.mode.u_interval.interval, alarm_info.alarm_type);
 
        if (!_send_alarm_create_appsvc(alarm_context, &alarm_info, alarm_id, b, &error_code))
                return error_code;
@@ -1279,10 +1279,10 @@ EXPORT_API int alarmmgr_add_alarm_noti(int alarm_type, time_t trigger_at_time,
                alarm_info.mode.u_interval.interval = interval;
        }
 
-       ALARM_MGR_LOG_PRINT("trigger_at_time(%d), start(%d-%d-%d, %02d:%02d:%02d), repeat(%d), interval(%d), type(%d)",
+       ALARM_MGR_LOG_PRINT("trigger_at_time(%ld), start(%d-%d-%d, %02d:%02d:%02d), repeat(%d), interval(%d), type(%d)",
                        trigger_at_time, alarm_info.start.day, alarm_info.start.month, alarm_info.start.year,
                        alarm_info.start.hour, alarm_info.start.min, alarm_info.start.sec,
-                       alarm_info.mode.repeat, alarm_info.mode.u_interval.interval, alarm_info.alarm_type);
+                       alarm_info.mode.repeat, (int)alarm_info.mode.u_interval.interval, alarm_info.alarm_type);
 
        if (!_send_alarm_create_noti(alarm_context, &alarm_info, alarm_id, noti, &error_code))
                return error_code;
@@ -1363,10 +1363,10 @@ static int _alarmmgr_add_alarm(int alarm_type,
                alarm_info.mode.u_interval.interval = interval;
        }
 
-       ALARM_MGR_LOG_PRINT("trigger_at_time(%d), start(%d-%d-%d, %02d:%02d:%02d), repeat(%d), interval(%d), type(%d)",
+       ALARM_MGR_LOG_PRINT("trigger_at_time(%ld), start(%d-%d-%d, %02d:%02d:%02d), repeat(%d), interval(%d), type(%d)",
                        trigger_at_time, alarm_info.start.day, alarm_info.start.month, alarm_info.start.year,
                        alarm_info.start.hour, alarm_info.start.min, alarm_info.start.sec,
-                       alarm_info.mode.repeat, alarm_info.mode.u_interval, alarm_info.alarm_type);
+                       alarm_info.mode.repeat, (int)alarm_info.mode.u_interval.interval, alarm_info.alarm_type);
 
        if (destination != NULL) {
                memset(dst_service_name, 0,
@@ -1490,10 +1490,10 @@ static int _alarmmgr_add_alarm_withcb(int alarm_type, time_t trigger_at_time,
                alarm_info.mode.u_interval.interval = interval;
        }
 
-       ALARM_MGR_LOG_PRINT("trigger_at_time(%d), start(%d-%d-%d, %02d:%02d:%02d), repeat(%d), interval(%d), type(%d)",
+       ALARM_MGR_LOG_PRINT("trigger_at_time(%ld), start(%d-%d-%d, %02d:%02d:%02d), repeat(%d), interval(%d), type(%d)",
                        trigger_at_time, alarm_info.start.day, alarm_info.start.month, alarm_info.start.year,
                        alarm_info.start.hour, alarm_info.start.min, alarm_info.start.sec,
-                       alarm_info.mode.repeat, alarm_info.mode.u_interval.interval, alarm_info.alarm_type);
+                       alarm_info.mode.repeat, (int)alarm_info.mode.u_interval.interval, alarm_info.alarm_type);
 
        if (!_send_alarm_create(alarm_context, &alarm_info, alarm_id, "null", "null", &error_code))
                return error_code;
@@ -1893,7 +1893,7 @@ EXPORT_API int alarmmgr_set_systime_async(int new_time, alarm_set_time_cb_t resu
 EXPORT_API int alarmmgr_set_systime_with_propagation_delay(struct timespec new_time, struct timespec req_time)
 {
        int error_code;
-       ALARM_MGR_LOG_PRINT("[alarm-lib] New: %d(sec) %09d(nsec), Requested: %d(sec) %09d(nsec)",
+       ALARM_MGR_LOG_PRINT("[alarm-lib] New: %ld(sec) %09ld(nsec), Requested: %ld(sec) %09ld(nsec)",
                        new_time.tv_sec, new_time.tv_nsec, req_time.tv_sec, req_time.tv_nsec);
 
        if (__sub_init() < 0)
@@ -1913,7 +1913,7 @@ EXPORT_API int alarmmgr_set_systime_with_propagation_delay_async(struct timespec
        int error_code;
        struct alarm_async_param_t *param;
 
-       ALARM_MGR_LOG_PRINT("[alarm-lib] New: %d(sec) %09d(nsec), Requested: %d(sec) %09d(nsec)",
+       ALARM_MGR_LOG_PRINT("[alarm-lib] New: %ld(sec) %09ld(nsec), Requested: %ld(sec) %09ld(nsec)",
                new_time.tv_sec, new_time.tv_nsec, req_time.tv_sec, req_time.tv_nsec);
 
        if (sub_initialized) {
@@ -2017,7 +2017,7 @@ EXPORT_API int alarmmgr_update_alarm(alarm_id_t alarm_id,
                        alarm_info->start.day, alarm_info->start.month, alarm_info->start.year,
                        alarm_info->start.hour, alarm_info->start.min, alarm_info->start.sec,
                        alarm_info->end.year, alarm_info->end.month, alarm_info->end.day,
-                       alarm_info->mode.repeat, alarm_info->mode.u_interval, alarm_info->alarm_type);
+                       alarm_info->mode.repeat, (int)alarm_info->mode.u_interval.interval, alarm_info->alarm_type);
 
        if (update_flag == ALARM_UPDATE_FLAG_TIME) {
                if (!__alarm_validate_date(&alarm_info->start, &error_code)) {