Pixelflinger: Fix issue of pointers being stored in ints
Pixelflinger's code makes assumptions, at certain places,
that pointers can be stored as ints. This patch makes use
of uintptr_t wherever pointers are stored as int or cast
to int.
Change-Id: Ie76f425cbc82ac038a747f77a95bd31774f4a8e8
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
diff --git a/libpixelflinger/scanline.cpp b/libpixelflinger/scanline.cpp
index 9663a2b..96a71f3 100644
--- a/libpixelflinger/scanline.cpp
+++ b/libpixelflinger/scanline.cpp
@@ -1717,7 +1717,7 @@
gen.width = t.surface.width;
gen.height = t.surface.height;
gen.stride = t.surface.stride;
- gen.data = int32_t(t.surface.data);
+ gen.data = uintptr_t(t.surface.data);
gen.dsdx = ti.dsdx;
gen.dtdx = ti.dtdx;
}
@@ -2125,7 +2125,7 @@
int sR, sG, sB;
uint32_t s, d;
- if (ct==1 || uint32_t(dst)&2) {
+ if (ct==1 || uintptr_t(dst)&2) {
last_one:
s = GGL_RGBA_TO_HOST( *src++ );
*dst++ = convertAbgr8888ToRgb565(s);