Enable clang for libui/libgui/surfaceflinger
Enables clang and C++11 for libui/libgui/surfaceflinger, and
eliminates all compile-time warnings.
Change-Id: Ie237fdb5ae44f2bfcddaa884f9c65ec3f08ae50f
diff --git a/libs/gui/Android.mk b/libs/gui/Android.mk
index ca94aa3..fffe28a 100644
--- a/libs/gui/Android.mk
+++ b/libs/gui/Android.mk
@@ -1,7 +1,10 @@
-LOCAL_PATH:= $(call my-dir)
+LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
-LOCAL_SRC_FILES:= \
+LOCAL_CLANG := true
+LOCAL_CPPFLAGS := -std=c++11
+
+LOCAL_SRC_FILES := \
IGraphicBufferConsumer.cpp \
IConsumerListener.cpp \
BitTube.cpp \
@@ -47,7 +50,7 @@
liblog
-LOCAL_MODULE:= libgui
+LOCAL_MODULE := libgui
ifeq ($(TARGET_BOARD_PLATFORM), tegra)
LOCAL_CFLAGS += -DDONT_USE_FENCE_SYNC
diff --git a/libs/gui/SensorEventQueue.cpp b/libs/gui/SensorEventQueue.cpp
index 1305e9f..6f5f204 100644
--- a/libs/gui/SensorEventQueue.cpp
+++ b/libs/gui/SensorEventQueue.cpp
@@ -157,7 +157,7 @@
ssize_t size = ::send(mSensorChannel->getFd(), &mNumAcksToSend, sizeof(mNumAcksToSend),
MSG_DONTWAIT | MSG_NOSIGNAL);
if (size < 0) {
- ALOGE("sendAck failure %d %d", size, mNumAcksToSend);
+ ALOGE("sendAck failure %zd %d", size, mNumAcksToSend);
} else {
mNumAcksToSend = 0;
}
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
index 6446926..547dc7d 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -752,14 +752,14 @@
status_t ScreenshotClient::update(const sp<IBinder>& display, Rect sourceCrop,
bool useIdentityTransform) {
- return ScreenshotClient::update(display, sourceCrop, 0, 0, 0, -1UL,
+ return ScreenshotClient::update(display, sourceCrop, 0, 0, 0, -1U,
useIdentityTransform, ISurfaceComposer::eRotateNone);
}
status_t ScreenshotClient::update(const sp<IBinder>& display, Rect sourceCrop,
uint32_t reqWidth, uint32_t reqHeight, bool useIdentityTransform) {
return ScreenshotClient::update(display, sourceCrop, reqWidth, reqHeight,
- 0, -1UL, useIdentityTransform, ISurfaceComposer::eRotateNone);
+ 0, -1U, useIdentityTransform, ISurfaceComposer::eRotateNone);
}
void ScreenshotClient::release() {