diff options
author | Tao Bao <tbao@google.com> | 2016-11-16 19:10:53 +0100 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2016-11-16 19:10:54 +0100 |
commit | 0bedc8e14c8872393ed1a9c3daad4091a3c90b0d (patch) | |
tree | 7c5ac472f60ca965c98eb2cf547f8685bcdd3101 /minui/resources.cpp | |
parent | Merge "updater: Fix the wrong return value for package_extract_file()." (diff) | |
parent | Use static_cast to cast pointers returned by malloc/calloc/realloc/mmap. (diff) | |
download | android_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/resources.cpp')
-rw-r--r-- | minui/resources.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/minui/resources.cpp b/minui/resources.cpp index 455ef2784..34e7b8be3 100644 --- a/minui/resources.cpp +++ b/minui/resources.cpp @@ -37,7 +37,7 @@ static GRSurface* malloc_surface(size_t data_size) { size_t size = sizeof(GRSurface) + data_size + SURFACE_DATA_ALIGNMENT; - unsigned char* temp = reinterpret_cast<unsigned char*>(malloc(size)); + unsigned char* temp = static_cast<unsigned char*>(malloc(size)); if (temp == NULL) return NULL; GRSurface* surface = reinterpret_cast<GRSurface*>(temp); surface->data = temp + sizeof(GRSurface) + @@ -221,7 +221,7 @@ int res_create_display_surface(const char* name, GRSurface** pSurface) { png_set_bgr(png_ptr); #endif - p_row = reinterpret_cast<unsigned char*>(malloc(width * 4)); + p_row = static_cast<unsigned char*>(malloc(width * 4)); for (y = 0; y < height; ++y) { png_read_row(png_ptr, p_row, NULL); transform_rgb_to_draw(p_row, surface->data + y * surface->row_bytes, channels, width); @@ -281,7 +281,7 @@ int res_create_multi_display_surface(const char* name, int* frames, int* fps, goto exit; } - surface = reinterpret_cast<GRSurface**>(calloc(*frames, sizeof(GRSurface*))); + surface = static_cast<GRSurface**>(calloc(*frames, sizeof(GRSurface*))); if (surface == NULL) { result = -8; goto exit; @@ -298,7 +298,7 @@ int res_create_multi_display_surface(const char* name, int* frames, int* fps, png_set_bgr(png_ptr); #endif - p_row = reinterpret_cast<unsigned char*>(malloc(width * 4)); + p_row = static_cast<unsigned char*>(malloc(width * 4)); for (y = 0; y < height; ++y) { png_read_row(png_ptr, p_row, NULL); int frame = y % *frames; |