From 3bdc5b826803dca10d3625c56de38d6c55d869c8 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Thu, 20 Nov 2014 11:50:23 -0800 Subject: [PATCH] C++11 compatibility. * Explicit conversion for atomic_uintptr_t initialization. * Fix string literal concatenation to not be a UD literal. * Use __typeof__ instead of typeof (should become decltype once this actually moves to C++11). Bug: 18466763 Change-Id: I4eedddfb945a2a703ed27317cb6e2b3041b1ebfc --- libs/binder/Binder.cpp | 2 +- libs/binder/Parcel.cpp | 2 +- services/surfaceflinger/DdmConnection.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/binder/Binder.cpp b/libs/binder/Binder.cpp index 296a98b0b..9d200fb21 100644 --- a/libs/binder/Binder.cpp +++ b/libs/binder/Binder.cpp @@ -72,7 +72,7 @@ public: BBinder::BBinder() { - atomic_init(&mExtras, 0); + atomic_init(&mExtras, static_cast(0)); } bool BBinder::isBinderAlive() const diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp index 1dbb06fef..99e539c13 100644 --- a/libs/binder/Parcel.cpp +++ b/libs/binder/Parcel.cpp @@ -1452,7 +1452,7 @@ void Parcel::ipcSetDataReference(const uint8_t* data, size_t dataSize, for (size_t i = 0; i < mObjectsSize; i++) { binder_size_t offset = mObjects[i]; if (offset < minOffset) { - ALOGE("%s: bad object offset %"PRIu64" < %"PRIu64"\n", + ALOGE("%s: bad object offset %" PRIu64 " < %" PRIu64 "\n", __func__, (uint64_t)offset, (uint64_t)minOffset); mObjectsSize = 0; break; diff --git a/services/surfaceflinger/DdmConnection.cpp b/services/surfaceflinger/DdmConnection.cpp index 2477921e3..5143b983e 100644 --- a/services/surfaceflinger/DdmConnection.cpp +++ b/services/surfaceflinger/DdmConnection.cpp @@ -59,11 +59,11 @@ void DdmConnection::start(const char* name) { } jint (*JNI_CreateJavaVM)(JavaVM** p_vm, JNIEnv** p_env, void* vm_args); - JNI_CreateJavaVM = (typeof JNI_CreateJavaVM)dlsym(libart_dso, "JNI_CreateJavaVM"); + JNI_CreateJavaVM = (__typeof__(JNI_CreateJavaVM))dlsym(libart_dso, "JNI_CreateJavaVM"); ALOGE_IF(!JNI_CreateJavaVM, "DdmConnection: %s", dlerror()); jint (*registerNatives)(JNIEnv* env, jclass clazz); - registerNatives = (typeof registerNatives)dlsym(libandroid_runtime_dso, + registerNatives = (__typeof__(registerNatives))dlsym(libandroid_runtime_dso, "Java_com_android_internal_util_WithFramework_registerNatives"); ALOGE_IF(!registerNatives, "DdmConnection: %s", dlerror());