Fix warning of converting pointer from integer 71/261871/1
authorYoungjae Cho <y0.cho@samsung.com>
Wed, 28 Jul 2021 05:10:32 +0000 (14:10 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Wed, 28 Jul 2021 05:16:31 +0000 (14:16 +0900)
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 <y0.cho@samsung.com>
src/callback.c
src/haptic.c

index f19d785..76c43d4 100644 (file)
@@ -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
 
index 6d99509..5f70397 100644 (file)
@@ -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;
 }