diff options
author | Youngjae Cho <y0.cho@samsung.com> | 2019-09-24 11:43:49 +0900 |
---|---|---|
committer | Youngjae Cho <y0.cho@samsung.com> | 2019-09-24 11:43:49 +0900 |
commit | 889a110f73bca0bd4099f395389c674842a3204d (patch) | |
tree | 6e8141098c2f7bd44806ddbe8b4e6798f11f330d | |
parent | 6d3732762f4b2c2a331bacf4c82c206a2454b32f (diff) | |
download | device-manager-plugin-emul-889a110f73bca0bd4099f395389c674842a3204d.tar.gz device-manager-plugin-emul-889a110f73bca0bd4099f395389c674842a3204d.tar.bz2 device-manager-plugin-emul-889a110f73bca0bd4099f395389c674842a3204d.zip |
Add float typecasting to prevent the loss of fractional part in divisiontizen_5.5.m2_releasesubmit/tizen_5.5_mobile_hotfix/20201026.185101submit/tizen_5.5/20191031.000001submit/tizen/20190924.060448accepted/tizen/unified/20190925.033612accepted/tizen/5.5/unified/mobile/hotfix/20201027.081255accepted/tizen/5.5/unified/20191031.014549tizen_5.5_mobile_hotfixaccepted/tizen_5.5_unified_mobile_hotfix
Change-Id: I596e67df50c253591bc8365e60623b31ca4c51d1
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
-rw-r--r-- | src/device_manager_plugin_emul.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/device_manager_plugin_emul.c b/src/device_manager_plugin_emul.c index ebca0c4..6f0e226 100644 --- a/src/device_manager_plugin_emul.c +++ b/src/device_manager_plugin_emul.c @@ -374,7 +374,7 @@ int OEM_sys_get_backlight_brightness(int index, int *value, int power_saving) devmgr_log("Can't read max_brightness node[%s]", path); return ret; } - pwr_saving_offset = (int)((PWR_SAVING_CANDELA_CRITERION * max_brightness / MAX_CANDELA_CRITERION) + 0.5); + pwr_saving_offset = (int)((PWR_SAVING_CANDELA_CRITERION * (float)max_brightness / MAX_CANDELA_CRITERION) + 0.5); if (*value > max_brightness - pwr_saving_offset) *value = max_brightness; @@ -409,7 +409,7 @@ static int OEM_sys_set_backlight_brightness(int index, int value, int power_savi devmgr_log("Can't read max_brightness node[%s]", path); return ret; } - pwr_saving_offset = (int)((PWR_SAVING_CANDELA_CRITERION * max_brightness / MAX_CANDELA_CRITERION) + 0.5); + pwr_saving_offset = (int)((PWR_SAVING_CANDELA_CRITERION * (float)max_brightness / MAX_CANDELA_CRITERION) + 0.5); if (value < pwr_saving_offset) value = 0; |