hwc: Use proper typecasts
- Remove compiler warnings
- Use proper typecasts
Change-Id: I7391f32ae31283239f5cebb93b02f3ce3a5c99f3
diff --git a/libhwcomposer/hwc_virtual.cpp b/libhwcomposer/hwc_virtual.cpp
index 37d87e2..f68d08f 100644
--- a/libhwcomposer/hwc_virtual.cpp
+++ b/libhwcomposer/hwc_virtual.cpp
@@ -95,8 +95,8 @@
const int dpy = HWC_DISPLAY_VIRTUAL;
if (list && list->outbuf && list->numHwLayers > 0) {
- reset_layer_prop(ctx, dpy, list->numHwLayers - 1);
- uint32_t last = list->numHwLayers - 1;
+ reset_layer_prop(ctx, dpy, (int)list->numHwLayers - 1);
+ uint32_t last = (uint32_t)list->numHwLayers - 1;
hwc_layer_1_t *fbLayer = &list->hwLayers[last];
int fbWidth = 0, fbHeight = 0;
getLayerResolution(fbLayer, fbWidth, fbHeight);
@@ -147,7 +147,7 @@
const int dpy = HWC_DISPLAY_VIRTUAL;
if (list && list->outbuf && list->numHwLayers > 0) {
- uint32_t last = list->numHwLayers - 1;
+ uint32_t last = (uint32_t)list->numHwLayers - 1;
hwc_layer_1_t *fbLayer = &list->hwLayers[last];
if(ctx->dpyAttr[dpy].connected
@@ -188,7 +188,8 @@
ret = -1;
}
- Writeback::getInstance()->queueBuffer(ohnd->fd, ohnd->offset);
+ Writeback::getInstance()->queueBuffer(ohnd->fd,
+ (uint32_t)ohnd->offset);
if(!Overlay::displayCommit(ctx->dpyAttr[dpy].fd)) {
ALOGE("%s: display commit fail!", __FUNCTION__);
ret = -1;
@@ -252,7 +253,7 @@
ctx->dpyAttr[dpy].isActive &&
ctx->dpyAttr[dpy].connected &&
canUseMDPforVirtualDisplay(ctx,list)) {
- reset_layer_prop(ctx, dpy, list->numHwLayers - 1);
+ reset_layer_prop(ctx, dpy, (int)list->numHwLayers - 1);
if(!ctx->dpyAttr[dpy].isPause) {
ctx->dpyAttr[dpy].isConfiguring = false;
setListStats(ctx, list, dpy);
@@ -284,7 +285,7 @@
ctx->dpyAttr[dpy].connected &&
(!ctx->dpyAttr[dpy].isPause) &&
canUseMDPforVirtualDisplay(ctx,list)) {
- uint32_t last = list->numHwLayers - 1;
+ uint32_t last = (uint32_t)list->numHwLayers - 1;
hwc_layer_1_t *fbLayer = &list->hwLayers[last];
int fd = -1; //FenceFD from the Copybit(valid in async mode)
bool copybitDone = false;