From 40e0c4acef0b7213056474ce4c4141d6690a9614 Mon Sep 17 00:00:00 2001 From: "jinwang.an" Date: Mon, 28 Nov 2016 22:28:46 +0900 Subject: [PATCH] Modified src about get/set func for 64bit-arch. Change-Id: I2dd6d223d80d0cd48ccbb2f0bfb0976de620c31c Signed-off-by: jinwang.an --- src/system_setting_platform.c | 23 ++++++++++++++--------- src/system_settings.c | 12 +++++++++--- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/src/system_setting_platform.c b/src/system_setting_platform.c index fd0f945..4f60c56 100644 --- a/src/system_setting_platform.c +++ b/src/system_setting_platform.c @@ -152,11 +152,12 @@ int system_setting_get_font_size(system_settings_key_e key, system_setting_data_ { SETTING_TRACE_BEGIN; int vconf_value; + int ** val = (int**)value; if (system_setting_vconf_get_value_int(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, &vconf_value)) { return SYSTEM_SETTINGS_ERROR_IO_ERROR; } - *value = (void *)vconf_value; + **val = vconf_value; return SYSTEM_SETTINGS_ERROR_NONE; } @@ -770,7 +771,7 @@ int system_setting_set_font_size(system_settings_key_e key, system_setting_data_ { SETTING_TRACE_BEGIN; int *vconf_value; - vconf_value = (int *)value; + vconf_value = *(int **)value; if (*vconf_value < 0 || *vconf_value > SYSTEM_SETTINGS_FONT_SIZE_GIANT) { return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER; @@ -1408,8 +1409,9 @@ int system_setting_get_time_changed(system_settings_key_e key, system_setting_da { SETTING_TRACE_BEGIN; time_t cur_tick; + int ** val = (int**)value; cur_tick = time(NULL); - *value = (void *)cur_tick; + **val = cur_tick; /* struct tm * localtime = time (cur_tick); */ /* printf("%s\n", ctime(&cur_tick); */ return SYSTEM_SETTINGS_ERROR_NONE; @@ -1625,11 +1627,12 @@ int system_setting_get_screen_backlight_time(system_settings_key_e key, system_s { SETTING_TRACE_BEGIN; int vconf_value; + int ** val = (int**)value; if (system_setting_vconf_get_value_int(VCONFKEY_SETAPPL_LCD_TIMEOUT_NORMAL, &vconf_value)) { return SYSTEM_SETTINGS_ERROR_IO_ERROR; } - *value = (void *)vconf_value; + **val = vconf_value; return SYSTEM_SETTINGS_ERROR_NONE; } @@ -1640,7 +1643,7 @@ int system_setting_set_screen_backlight_time(system_settings_key_e key, system_s { SETTING_TRACE_BEGIN; int *vconf_value; - vconf_value = (int *)value; + vconf_value = *(int **)value; if (!(*vconf_value > 0 && *vconf_value < 600)) { SETTING_TRACE(" ERR Betweeny here 0 ~ 600"); @@ -1714,12 +1717,13 @@ int system_setting_unset_changed_callback_sound_notification(system_settings_key int system_setting_get_notification_repetition_period(system_settings_key_e key, system_setting_data_type_e data_type, void **value) { SETTING_TRACE_BEGIN; + int ** val = (int**)value; int vconf_value; if (system_setting_vconf_get_value_int(VCONFKEY_SETAPPL_NOTI_MSG_ALERT_REP_TYPE_INT, &vconf_value)) { return SYSTEM_SETTINGS_ERROR_IO_ERROR; } - *value = (void *)vconf_value; + **val = vconf_value; return SYSTEM_SETTINGS_ERROR_NONE; } @@ -1729,7 +1733,7 @@ int system_setting_set_notification_repetition_period(system_settings_key_e key, { SETTING_TRACE_BEGIN; int *vconf_value; - vconf_value = (int *)value; + vconf_value = *(int **)value; if (system_setting_vconf_set_value_int(VCONFKEY_SETAPPL_NOTI_MSG_ALERT_REP_TYPE_INT, *vconf_value)) { return SYSTEM_SETTINGS_ERROR_IO_ERROR; @@ -1845,11 +1849,12 @@ int system_setting_unset_changed_callback_network_wifi_notification(system_setti int system_setting_get_lock_state(system_settings_key_e key, system_setting_data_type_e data_type, void **value) { int vconf_value; + int ** val = (int**)value; if (system_setting_vconf_get_value_int(VCONFKEY_IDLE_LOCK_STATE_READ_ONLY, &vconf_value)) { return SYSTEM_SETTINGS_ERROR_IO_ERROR; } - *value = (void *)vconf_value; + **val = vconf_value; return SYSTEM_SETTINGS_ERROR_NONE; } @@ -1860,7 +1865,7 @@ int system_setting_set_lock_state(system_settings_key_e key, system_setting_data { SETTING_TRACE_BEGIN; int *vconf_value; - vconf_value = (int *)value; + vconf_value = *(int **)value; if (system_setting_vconf_set_value_int(VCONFKEY_IDLE_LOCK_STATE_READ_ONLY, *vconf_value)) { return SYSTEM_SETTINGS_ERROR_IO_ERROR; diff --git a/src/system_settings.c b/src/system_settings.c index 4130032..351a413 100644 --- a/src/system_settings.c +++ b/src/system_settings.c @@ -490,7 +490,8 @@ int system_settings_set_value_int(system_settings_key_e key, int value) } int *ptr = &value; - return system_settings_set_value(key, SYSTEM_SETTING_DATA_TYPE_INT, (void *)ptr); + int **p_ptr = &ptr; + return system_settings_set_value(key, SYSTEM_SETTING_DATA_TYPE_INT, (void *)p_ptr); } /* LCOV_EXCL_STOP */ @@ -500,8 +501,13 @@ int system_settings_get_value_int(system_settings_key_e key, int *value) if (!(key >= 0 && SYSTEM_SETTINGS_KEY_MAX > key)) { return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER; } - - return system_settings_get_value(key, SYSTEM_SETTING_DATA_TYPE_INT, (void **)value); + int value_int = 0; + int *ptr = &value_int; + int **p_ptr = &ptr; + int ret = 0; + ret = system_settings_get_value(key, SYSTEM_SETTING_DATA_TYPE_INT, (void **)p_ptr); + *value = value_int; + return ret; } /* LCOV_EXCL_START */ -- 2.7.4