From a6f61bbfce2072c830755e986c89187db010bb23 Mon Sep 17 00:00:00 2001 From: Youngjae Cho Date: Wed, 28 Jul 2021 14:10:32 +0900 Subject: [PATCH] Fix warning of converting pointer from integer warning: cast to pointer from integer of different size The above warning is only generated in 64bit compile environment. Change-Id: Idffb00ec61ac9029f94ceca14c13882b7ac33fdf Signed-off-by: Youngjae Cho --- src/callback.c | 8 ++++---- src/haptic.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/callback.c b/src/callback.c index f19d785..76c43d4 100644 --- a/src/callback.c +++ b/src/callback.c @@ -53,7 +53,7 @@ static void battery_capacity_cb(keynode_t *key, void *data) /* invoke the each callback with value */ SYS_G_LIST_FOREACH_SAFE(device_cb_list[type], elem, elem_next, cb_info) - cb_info->cb(type, (void*)val, cb_info->data); + cb_info->cb(type, (void*)(intptr_t)val, cb_info->data); } //LCOV_EXCL_STOP @@ -69,7 +69,7 @@ static void battery_charging_cb(keynode_t *key, void *data) /* invoke the each callback with value */ SYS_G_LIST_FOREACH_SAFE(device_cb_list[type], elem, elem_next, cb_info) - cb_info->cb(type, (void*)val, cb_info->data); + cb_info->cb(type, (void*)(intptr_t)val, cb_info->data); } //LCOV_EXCL_STOP @@ -98,7 +98,7 @@ static void battery_level_cb(keynode_t *key, void *data) /* invoke the each callback with value */ SYS_G_LIST_FOREACH_SAFE(device_cb_list[type], elem, elem_next, cb_info) - cb_info->cb(type, (void*)status, cb_info->data); + cb_info->cb(type, (void*)(intptr_t)status, cb_info->data); } //LCOV_EXCL_STOP @@ -156,7 +156,7 @@ static void flash_state_cb(GDBusConnection *conn, /* invoke the each callback with value */ SYS_G_LIST_FOREACH_SAFE(device_cb_list[type], elem, elem_next, cb_info) - cb_info->cb(type, (void*)val, cb_info->data); + cb_info->cb(type, (void*)(intptr_t)val, cb_info->data); } //LCOV_EXCL_STOP diff --git a/src/haptic.c b/src/haptic.c index 6d99509..5f70397 100644 --- a/src/haptic.c +++ b/src/haptic.c @@ -303,7 +303,7 @@ int device_haptic_vibrate(haptic_device_h device_handle, int duration, int feedb return errno_to_device_error(ret_val); //LCOV_EXCL_LINE System Error if (effect_handle) - *effect_handle = (haptic_effect_h)val; + *effect_handle = (haptic_effect_h)(intptr_t)val; return DEVICE_ERROR_NONE; } -- 2.7.4