summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorDan Stoza <stoza@google.com>2014-11-11 10:32:31 -0800
committerDan Albert <danalbert@google.com>2014-12-04 17:56:17 -0800
commit01049c8321aab30cd431e2febeddd79242ae5a4f (patch)
tree7a78d2e8f6d67618779e2c7f16202b87dcec1a02 /libs
parent38803268570f90e97452cd9a30ac831661829091 (diff)
downloadframeworks_native-01049c8321aab30cd431e2febeddd79242ae5a4f.zip
frameworks_native-01049c8321aab30cd431e2febeddd79242ae5a4f.tar.gz
frameworks_native-01049c8321aab30cd431e2febeddd79242ae5a4f.tar.bz2
Enable clang for libui/libgui/surfaceflinger
Enables clang and C++11 for libui/libgui/surfaceflinger, and eliminates all compile-time warnings. Change-Id: Ie237fdb5ae44f2bfcddaa884f9c65ec3f08ae50f (cherry picked from commit f10c46ef855b6410b20ebd8b1351d4d78d8eca8e)
Diffstat (limited to 'libs')
-rw-r--r--libs/gui/Android.mk9
-rw-r--r--libs/gui/SensorEventQueue.cpp2
-rw-r--r--libs/gui/SurfaceComposerClient.cpp4
-rw-r--r--libs/ui/Android.mk9
-rw-r--r--libs/ui/FramebufferNativeWindow.cpp2
-rw-r--r--libs/ui/GraphicBuffer.cpp33
6 files changed, 32 insertions, 27 deletions
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 @@ LOCAL_SHARED_LIBRARIES := \
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 @@ void SensorEventQueue::sendAck(const ASensorEvent* events, int count) {
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 04ee1b9..1be7895 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -752,14 +752,14 @@ status_t ScreenshotClient::update(const sp<IBinder>& display,
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() {
diff --git a/libs/ui/Android.mk b/libs/ui/Android.mk
index eec97be..eff540a 100644
--- a/libs/ui/Android.mk
+++ b/libs/ui/Android.mk
@@ -12,10 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-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 := \
Fence.cpp \
FramebufferNativeWindow.cpp \
FrameStats.cpp \
@@ -38,7 +41,7 @@ ifneq ($(BOARD_FRAMEBUFFER_FORCE_FORMAT),)
LOCAL_CFLAGS += -DFRAMEBUFFER_FORCE_FORMAT=$(BOARD_FRAMEBUFFER_FORCE_FORMAT)
endif
-LOCAL_MODULE:= libui
+LOCAL_MODULE := libui
include $(BUILD_SHARED_LIBRARY)
diff --git a/libs/ui/FramebufferNativeWindow.cpp b/libs/ui/FramebufferNativeWindow.cpp
index 918f2e7..295300e 100644
--- a/libs/ui/FramebufferNativeWindow.cpp
+++ b/libs/ui/FramebufferNativeWindow.cpp
@@ -29,7 +29,9 @@
#include <ui/ANativeObjectBase.h>
#include <ui/Fence.h>
+#define INCLUDED_FROM_FRAMEBUFFER_NATIVE_WINDOW_CPP
#include <ui/FramebufferNativeWindow.h>
+#undef INCLUDED_FROM_FRAMEBUFFER_NATIVE_WINDOW_CPP
#include <ui/Rect.h>
#include <EGL/egl.h>
diff --git a/libs/ui/GraphicBuffer.cpp b/libs/ui/GraphicBuffer.cpp
index e768f13..f4e781b 100644
--- a/libs/ui/GraphicBuffer.cpp
+++ b/libs/ui/GraphicBuffer.cpp
@@ -45,31 +45,29 @@ GraphicBuffer::GraphicBuffer()
: BASE(), mOwner(ownData), mBufferMapper(GraphicBufferMapper::get()),
mInitCheck(NO_ERROR), mId(getUniqueId())
{
- width =
- height =
- stride =
- format =
+ width =
+ height =
+ stride =
+ format =
usage = 0;
handle = NULL;
}
-GraphicBuffer::GraphicBuffer(uint32_t w, uint32_t h,
- PixelFormat reqFormat, uint32_t reqUsage)
+GraphicBuffer::GraphicBuffer(int w, int h, PixelFormat reqFormat, int reqUsage)
: BASE(), mOwner(ownData), mBufferMapper(GraphicBufferMapper::get()),
mInitCheck(NO_ERROR), mId(getUniqueId())
{
- width =
- height =
- stride =
- format =
+ width =
+ height =
+ stride =
+ format =
usage = 0;
handle = NULL;
mInitCheck = initSize(w, h, reqFormat, reqUsage);
}
-GraphicBuffer::GraphicBuffer(uint32_t w, uint32_t h,
- PixelFormat inFormat, uint32_t inUsage,
- uint32_t inStride, native_handle_t* inHandle, bool keepOwnership)
+GraphicBuffer::GraphicBuffer(int w, int h, PixelFormat inFormat, int inUsage,
+ int inStride, native_handle_t* inHandle, bool keepOwnership)
: BASE(), mOwner(keepOwnership ? ownHandle : ownNone),
mBufferMapper(GraphicBufferMapper::get()),
mInitCheck(NO_ERROR), mId(getUniqueId())
@@ -131,8 +129,7 @@ ANativeWindowBuffer* GraphicBuffer::getNativeBuffer() const
const_cast<GraphicBuffer*>(this));
}
-status_t GraphicBuffer::reallocate(uint32_t w, uint32_t h, PixelFormat f,
- uint32_t reqUsage)
+status_t GraphicBuffer::reallocate(int w, int h, PixelFormat f, int reqUsage)
{
if (mOwner != ownData)
return INVALID_OPERATION;
@@ -171,10 +168,10 @@ status_t GraphicBuffer::lock(uint32_t usage, void** vaddr)
status_t GraphicBuffer::lock(uint32_t usage, const Rect& rect, void** vaddr)
{
- if (rect.left < 0 || rect.right > this->width ||
+ if (rect.left < 0 || rect.right > this->width ||
rect.top < 0 || rect.bottom > this->height) {
ALOGE("locking pixels (%d,%d,%d,%d) outside of buffer (w=%d, h=%d)",
- rect.left, rect.top, rect.right, rect.bottom,
+ rect.left, rect.top, rect.right, rect.bottom,
this->width, this->height);
return BAD_VALUE;
}
@@ -314,7 +311,7 @@ status_t GraphicBuffer::unflatten(
if (numFds >= maxNumber || numInts >= (maxNumber - 10)) {
width = height = stride = format = usage = 0;
handle = NULL;
- ALOGE("unflatten: numFds or numInts is too large: %d, %d",
+ ALOGE("unflatten: numFds or numInts is too large: %zd, %zd",
numFds, numInts);
return BAD_VALUE;
}