This patch fixes pointer-to-int-cast error which the option is enabled in
gcc-4.9 compiler.
[ 180s] drm_slp_bufmgr.c: In function 'drm_slp_bo_map':
[ 180s] drm_slp_bufmgr.c:104:19: error: cast from pointer to integer of
different size [-Werror=pointer-to-int-cast]
[ 180s] ret = (unsigned int)bo_handle.ptr;
Change-Id: I89919ce10fff3bc85efdca1a3903d4919ec0f9eb
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
return (drm_slp_bo)bo;
}
-unsigned int
+void *
drm_slp_bo_map(drm_slp_bo bo, int device, int opt)
{
tbm_bo_handle bo_handle;
- unsigned int ret = 0;
+ void *ret = NULL;
bo_handle = tbm_bo_map ((tbm_bo)bo, device, opt);
if (bo_handle.ptr == NULL)
{
TBM_LOG ("[libdrm_slp:%d]: error bo_handle is null\n", getpid());
- return 0;
+ return NULL;
}
switch (device)
case TBM_DEVICE_2D:
case TBM_DEVICE_3D:
case TBM_DEVICE_MM:
- ret = (unsigned int)bo_handle.u32;
+ ret = (void *)((uintptr_t)bo_handle.u32);
break;
case TBM_DEVICE_CPU:
- ret = (unsigned int)bo_handle.ptr;
+ ret = bo_handle.ptr;
break;
default:
TBM_LOG ("[libdrm_slp:%d]: error wrong device type\n", getpid());
- return 0;
+ return NULL;
}
return ret;
/*Functions for bo*/
void drm_slp_bo_unref(drm_slp_bo bo);
drm_slp_bo drm_slp_bo_import(drm_slp_bufmgr bufmgr, unsigned int key);
-unsigned int drm_slp_bo_map(drm_slp_bo bo, int device, int opt);
+void *drm_slp_bo_map(drm_slp_bo bo, int device, int opt);
int drm_slp_bo_unmap(drm_slp_bo bo, int device);
#endif /* _DRM_SLP_BUFMGR_H_ */