From 31dcb41d25471648752ac61573b39b8a1c97bd22 Mon Sep 17 00:00:00 2001 From: Naseer Ahmed Date: Sun, 15 Jul 2012 23:56:21 -0700 Subject: [PATCH] display: Fix warnings, make warnings as errors Change-Id: I61f22765b04112be48e62135db930c415c9c7d37 --- common.mk | 2 ++ libcopybit/copybit_c2d.cpp | 4 ++-- libgralloc/alloc_controller.cpp | 2 +- libhwcomposer/hwc_mdpcomp.cpp | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/common.mk b/common.mk index a48476e..ecf5d66 100644 --- a/common.mk +++ b/common.mk @@ -16,6 +16,8 @@ common_libs := liblog libutils libcutils libhardware #Common C flags common_flags := -DDEBUG_CALC_FPS -Wno-missing-field-initializers +common_flags += -Werror + ifeq ($(ARCH_ARM_HAVE_NEON),true) common_flags += -D__ARM_HAVE_NEON endif diff --git a/libcopybit/copybit_c2d.cpp b/libcopybit/copybit_c2d.cpp index 5eec414..365be5f 100644 --- a/libcopybit/copybit_c2d.cpp +++ b/libcopybit/copybit_c2d.cpp @@ -446,7 +446,7 @@ static int set_image( uint32 surfaceId, const struct copybit_image_t *rhs, info.height = rhs->h; info.format = rhs->format; - yuvPlaneInfo yuvInfo; + yuvPlaneInfo yuvInfo = {0}; status = calculate_yuv_offset_and_stride(info, yuvInfo); if(status != COPYBIT_SUCCESS) { ALOGE("%s: calculate_yuv_offset_and_stride error", __FUNCTION__); @@ -701,7 +701,7 @@ static void set_rects(struct copybit_context_t *ctx, /** copy the bits */ static int msm_copybit(struct copybit_context_t *dev, blitlist *list, uint32 target) { - int objects; + unsigned int objects; for(objects = 0; objects < list->count; objects++) { list->blitObjects[objects].next = &(list->blitObjects[objects+1]); diff --git a/libgralloc/alloc_controller.cpp b/libgralloc/alloc_controller.cpp index 1802a75..e4d1d68 100644 --- a/libgralloc/alloc_controller.cpp +++ b/libgralloc/alloc_controller.cpp @@ -152,7 +152,7 @@ int IonController::allocate(alloc_data& data, int usage) IMemAlloc* IonController::getAllocator(int flags) { - IMemAlloc* memalloc; + IMemAlloc* memalloc = NULL; if (flags & private_handle_t::PRIV_FLAGS_USES_ION) { memalloc = mIonAlloc; } else { diff --git a/libhwcomposer/hwc_mdpcomp.cpp b/libhwcomposer/hwc_mdpcomp.cpp index 8107400..35b7e7b 100644 --- a/libhwcomposer/hwc_mdpcomp.cpp +++ b/libhwcomposer/hwc_mdpcomp.cpp @@ -343,7 +343,7 @@ bool MDPComp::is_doable(hwc_composer_device_t *dev, } //Number of layers - if(list->numHwLayers < 1 || list->numHwLayers > sMaxLayers) { + if(list->numHwLayers < 1 || list->numHwLayers > (uint32_t) sMaxLayers) { ALOGD_IF(isDebug(), "%s: Unsupported number of layers",__FUNCTION__); return false; }