summaryrefslogtreecommitdiffstats
path: root/minui/graphics_adf.cpp
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2016-11-16 19:10:53 +0100
committerGerrit Code Review <noreply-gerritcodereview@google.com>2016-11-16 19:10:54 +0100
commit0bedc8e14c8872393ed1a9c3daad4091a3c90b0d (patch)
tree7c5ac472f60ca965c98eb2cf547f8685bcdd3101 /minui/graphics_adf.cpp
parentMerge "updater: Fix the wrong return value for package_extract_file()." (diff)
parentUse static_cast to cast pointers returned by malloc/calloc/realloc/mmap. (diff)
downloadandroid_bootable_recovery-0bedc8e14c8872393ed1a9c3daad4091a3c90b0d.tar
android_bootable_recovery-0bedc8e14c8872393ed1a9c3daad4091a3c90b0d.tar.gz
android_bootable_recovery-0bedc8e14c8872393ed1a9c3daad4091a3c90b0d.tar.bz2
android_bootable_recovery-0bedc8e14c8872393ed1a9c3daad4091a3c90b0d.tar.lz
android_bootable_recovery-0bedc8e14c8872393ed1a9c3daad4091a3c90b0d.tar.xz
android_bootable_recovery-0bedc8e14c8872393ed1a9c3daad4091a3c90b0d.tar.zst
android_bootable_recovery-0bedc8e14c8872393ed1a9c3daad4091a3c90b0d.zip
Diffstat (limited to 'minui/graphics_adf.cpp')
-rw-r--r--minui/graphics_adf.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/minui/graphics_adf.cpp b/minui/graphics_adf.cpp
index 3c3541094..9e262b044 100644
--- a/minui/graphics_adf.cpp
+++ b/minui/graphics_adf.cpp
@@ -68,9 +68,9 @@ static int adf_surface_init(adf_pdata *pdata, drm_mode_modeinfo *mode, adf_surfa
surf->base.row_bytes = surf->pitch;
surf->base.pixel_bytes = (pdata->format == DRM_FORMAT_RGB565) ? 2 : 4;
- surf->base.data = reinterpret_cast<uint8_t*>(mmap(NULL,
- surf->pitch * surf->base.height, PROT_WRITE,
- MAP_SHARED, surf->fd, surf->offset));
+ surf->base.data = static_cast<uint8_t*>(mmap(NULL,
+ surf->pitch * surf->base.height, PROT_WRITE,
+ MAP_SHARED, surf->fd, surf->offset));
if (surf->base.data == MAP_FAILED) {
close(surf->fd);
return -errno;
@@ -259,7 +259,7 @@ static void adf_exit(minui_backend *backend)
minui_backend *open_adf()
{
- adf_pdata* pdata = reinterpret_cast<adf_pdata*>(calloc(1, sizeof(*pdata)));
+ adf_pdata* pdata = static_cast<adf_pdata*>(calloc(1, sizeof(*pdata)));
if (!pdata) {
perror("allocating adf backend failed");
return NULL;