summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Shi <simonsmh@gmail.com>2019-01-16 06:27:01 +0100
committerSimon Shi <simonsmh@gmail.com>2019-01-16 09:43:46 +0100
commitfcfc634ea63e64f0b87dea05a753e2cd017c4972 (patch)
treea2c98043fd8c2bb449a5ac0048bd509334befbce
parentminuitwrp: Support haptics drivers registered with LED class framework (diff)
downloadandroid_bootable_recovery-fcfc634ea63e64f0b87dea05a753e2cd017c4972.tar
android_bootable_recovery-fcfc634ea63e64f0b87dea05a753e2cd017c4972.tar.gz
android_bootable_recovery-fcfc634ea63e64f0b87dea05a753e2cd017c4972.tar.bz2
android_bootable_recovery-fcfc634ea63e64f0b87dea05a753e2cd017c4972.tar.lz
android_bootable_recovery-fcfc634ea63e64f0b87dea05a753e2cd017c4972.tar.xz
android_bootable_recovery-fcfc634ea63e64f0b87dea05a753e2cd017c4972.tar.zst
android_bootable_recovery-fcfc634ea63e64f0b87dea05a753e2cd017c4972.zip
-rw-r--r--minui/graphics_overlay.cpp6
-rw-r--r--minuitwrp/graphics_fbdev.cpp6
-rw-r--r--minuitwrp/graphics_overlay.cpp6
3 files changed, 6 insertions, 12 deletions
diff --git a/minui/graphics_overlay.cpp b/minui/graphics_overlay.cpp
index b7e62d945..5988d70ad 100644
--- a/minui/graphics_overlay.cpp
+++ b/minui/graphics_overlay.cpp
@@ -448,12 +448,10 @@ GRSurface* MinuiBackendOverlay::Flip() {
if (double_buffered) {
#if defined(RECOVERY_BGRA)
// In case of BGRA, do some byte swapping
- unsigned int idx;
- unsigned char tmp;
unsigned char* ucfb_vaddr = (unsigned char*)gr_draw->data;
- for (idx = 0 ; idx < (gr_draw->height * gr_draw->row_bytes);
+ for (int idx = 0 ; idx < (gr_draw->height * gr_draw->row_bytes);
idx += 4) {
- tmp = ucfb_vaddr[idx];
+ unsigned char tmp = ucfb_vaddr[idx];
ucfb_vaddr[idx ] = ucfb_vaddr[idx + 2];
ucfb_vaddr[idx + 2] = tmp;
}
diff --git a/minuitwrp/graphics_fbdev.cpp b/minuitwrp/graphics_fbdev.cpp
index a1c42d05c..8cf85f5eb 100644
--- a/minuitwrp/graphics_fbdev.cpp
+++ b/minuitwrp/graphics_fbdev.cpp
@@ -285,12 +285,10 @@ static GRSurface* fbdev_init(minui_backend* backend) {
static GRSurface* fbdev_flip(minui_backend* backend __unused) {
#if defined(RECOVERY_BGRA)
// In case of BGRA, do some byte swapping
- unsigned int idx;
- unsigned char tmp;
unsigned char* ucfb_vaddr = (unsigned char*)gr_draw->data;
- for (idx = 0 ; idx < (gr_draw->height * gr_draw->row_bytes);
+ for (int idx = 0 ; idx < (gr_draw->height * gr_draw->row_bytes);
idx += 4) {
- tmp = ucfb_vaddr[idx];
+ unsigned char tmp = ucfb_vaddr[idx];
ucfb_vaddr[idx ] = ucfb_vaddr[idx + 2];
ucfb_vaddr[idx + 2] = tmp;
}
diff --git a/minuitwrp/graphics_overlay.cpp b/minuitwrp/graphics_overlay.cpp
index 84ea6e0ea..e4fc4191e 100644
--- a/minuitwrp/graphics_overlay.cpp
+++ b/minuitwrp/graphics_overlay.cpp
@@ -491,12 +491,10 @@ int overlay_display_frame(int fd, void* data, size_t size)
static GRSurface* overlay_flip(minui_backend* backend __unused) {
#if defined(RECOVERY_BGRA)
// In case of BGRA, do some byte swapping
- unsigned int idx;
- unsigned char tmp;
unsigned char* ucfb_vaddr = (unsigned char*)gr_draw->data;
- for (idx = 0 ; idx < (gr_draw->height * gr_draw->row_bytes);
+ for (int idx = 0 ; idx < (gr_draw->height * gr_draw->row_bytes);
idx += 4) {
- tmp = ucfb_vaddr[idx];
+ unsigned char tmp = ucfb_vaddr[idx];
ucfb_vaddr[idx ] = ucfb_vaddr[idx + 2];
ucfb_vaddr[idx + 2] = tmp;
}