Loading libs/binder/IPCThreadState.cpp +2 −0 Original line number Original line Diff line number Diff line Loading @@ -285,7 +285,9 @@ static const void* printCommand(std::ostream& out, const void* _cmd) { return cmd; return cmd; } } LIBBINDER_IGNORE("-Wzero-as-null-pointer-constant") static pthread_mutex_t gTLSMutex = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t gTLSMutex = PTHREAD_MUTEX_INITIALIZER; LIBBINDER_IGNORE_END() static std::atomic<bool> gHaveTLS(false); static std::atomic<bool> gHaveTLS(false); static pthread_key_t gTLS = 0; static pthread_key_t gTLS = 0; static std::atomic<bool> gShutdown = false; static std::atomic<bool> gShutdown = false; Loading libs/binder/PersistableBundle.cpp +2 −2 Original line number Original line Diff line number Diff line Loading @@ -113,7 +113,7 @@ status_t PersistableBundle::writeToParcel(Parcel* parcel) const { // Backpatch length. This length value includes the length header. // Backpatch length. This length value includes the length header. parcel->setDataPosition(length_pos); parcel->setDataPosition(length_pos); size_t length = end_pos - start_pos; size_t length = end_pos - start_pos; if (length > std::numeric_limits<int32_t>::max()) { if (length > static_cast<size_t>(std::numeric_limits<int32_t>::max())) { ALOGE("Parcel length (%zu) too large to store in 32-bit signed int", length); ALOGE("Parcel length (%zu) too large to store in 32-bit signed int", length); return BAD_VALUE; return BAD_VALUE; } } Loading Loading @@ -319,7 +319,7 @@ status_t PersistableBundle::writeToParcelInner(Parcel* parcel) const { * pairs themselves. * pairs themselves. */ */ size_t num_entries = size(); size_t num_entries = size(); if (num_entries > std::numeric_limits<int32_t>::max()) { if (num_entries > static_cast<size_t>(std::numeric_limits<int32_t>::max())) { ALOGE("The size of this PersistableBundle (%zu) too large to store in 32-bit signed int", ALOGE("The size of this PersistableBundle (%zu) too large to store in 32-bit signed int", num_entries); num_entries); return BAD_VALUE; return BAD_VALUE; Loading libs/binder/Utils.h +13 −0 Original line number Original line Diff line number Diff line Loading @@ -58,6 +58,19 @@ } \ } \ } while (0) } while (0) #define LIBBINDER_PRAGMA(arg) _Pragma(#arg) #if defined(__clang__) #define LIBBINDER_PRAGMA_FOR_COMPILER(arg) LIBBINDER_PRAGMA(clang arg) #elif defined(__GNUC__) #define LIBBINDER_PRAGMA_FOR_COMPILER(arg) LIBBINDER_PRAGMA(GCC arg) #else #define LIBBINDER_PRAGMA_FOR_COMPILER(arg) #endif #define LIBBINDER_IGNORE(warning_flag) \ LIBBINDER_PRAGMA_FOR_COMPILER(diagnostic push) \ LIBBINDER_PRAGMA_FOR_COMPILER(diagnostic ignored warning_flag) #define LIBBINDER_IGNORE_END() LIBBINDER_PRAGMA_FOR_COMPILER(diagnostic pop) namespace android { namespace android { /** /** Loading libs/binder/ndk/include_ndk/android/persistable_bundle.h +5 −0 Original line number Original line Diff line number Diff line Loading @@ -29,6 +29,11 @@ #include <sys/cdefs.h> #include <sys/cdefs.h> #include <sys/types.h> #include <sys/types.h> #ifndef __clang__ #define _Nullable #define _Nonnull #endif __BEGIN_DECLS __BEGIN_DECLS /* /* Loading libs/binder/ndk/service_manager.cpp +3 −0 Original line number Original line Diff line number Diff line Loading @@ -18,6 +18,7 @@ #include <binder/IServiceManager.h> #include <binder/IServiceManager.h> #include <binder/LazyServiceRegistrar.h> #include <binder/LazyServiceRegistrar.h> #include "../Utils.h" #include "ibinder_internal.h" #include "ibinder_internal.h" #include "status_internal.h" #include "status_internal.h" Loading Loading @@ -89,7 +90,9 @@ AIBinder* AServiceManager_getService(const char* instance) { } } sp<IServiceManager> sm = defaultServiceManager(); sp<IServiceManager> sm = defaultServiceManager(); LIBBINDER_IGNORE("-Wdeprecated-declarations") sp<IBinder> binder = sm->getService(String16(instance)); sp<IBinder> binder = sm->getService(String16(instance)); LIBBINDER_IGNORE_END() sp<AIBinder> ret = ABpBinder::lookupOrCreateFromBinder(binder); sp<AIBinder> ret = ABpBinder::lookupOrCreateFromBinder(binder); AIBinder_incStrong(ret.get()); AIBinder_incStrong(ret.get()); Loading Loading
libs/binder/IPCThreadState.cpp +2 −0 Original line number Original line Diff line number Diff line Loading @@ -285,7 +285,9 @@ static const void* printCommand(std::ostream& out, const void* _cmd) { return cmd; return cmd; } } LIBBINDER_IGNORE("-Wzero-as-null-pointer-constant") static pthread_mutex_t gTLSMutex = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t gTLSMutex = PTHREAD_MUTEX_INITIALIZER; LIBBINDER_IGNORE_END() static std::atomic<bool> gHaveTLS(false); static std::atomic<bool> gHaveTLS(false); static pthread_key_t gTLS = 0; static pthread_key_t gTLS = 0; static std::atomic<bool> gShutdown = false; static std::atomic<bool> gShutdown = false; Loading
libs/binder/PersistableBundle.cpp +2 −2 Original line number Original line Diff line number Diff line Loading @@ -113,7 +113,7 @@ status_t PersistableBundle::writeToParcel(Parcel* parcel) const { // Backpatch length. This length value includes the length header. // Backpatch length. This length value includes the length header. parcel->setDataPosition(length_pos); parcel->setDataPosition(length_pos); size_t length = end_pos - start_pos; size_t length = end_pos - start_pos; if (length > std::numeric_limits<int32_t>::max()) { if (length > static_cast<size_t>(std::numeric_limits<int32_t>::max())) { ALOGE("Parcel length (%zu) too large to store in 32-bit signed int", length); ALOGE("Parcel length (%zu) too large to store in 32-bit signed int", length); return BAD_VALUE; return BAD_VALUE; } } Loading Loading @@ -319,7 +319,7 @@ status_t PersistableBundle::writeToParcelInner(Parcel* parcel) const { * pairs themselves. * pairs themselves. */ */ size_t num_entries = size(); size_t num_entries = size(); if (num_entries > std::numeric_limits<int32_t>::max()) { if (num_entries > static_cast<size_t>(std::numeric_limits<int32_t>::max())) { ALOGE("The size of this PersistableBundle (%zu) too large to store in 32-bit signed int", ALOGE("The size of this PersistableBundle (%zu) too large to store in 32-bit signed int", num_entries); num_entries); return BAD_VALUE; return BAD_VALUE; Loading
libs/binder/Utils.h +13 −0 Original line number Original line Diff line number Diff line Loading @@ -58,6 +58,19 @@ } \ } \ } while (0) } while (0) #define LIBBINDER_PRAGMA(arg) _Pragma(#arg) #if defined(__clang__) #define LIBBINDER_PRAGMA_FOR_COMPILER(arg) LIBBINDER_PRAGMA(clang arg) #elif defined(__GNUC__) #define LIBBINDER_PRAGMA_FOR_COMPILER(arg) LIBBINDER_PRAGMA(GCC arg) #else #define LIBBINDER_PRAGMA_FOR_COMPILER(arg) #endif #define LIBBINDER_IGNORE(warning_flag) \ LIBBINDER_PRAGMA_FOR_COMPILER(diagnostic push) \ LIBBINDER_PRAGMA_FOR_COMPILER(diagnostic ignored warning_flag) #define LIBBINDER_IGNORE_END() LIBBINDER_PRAGMA_FOR_COMPILER(diagnostic pop) namespace android { namespace android { /** /** Loading
libs/binder/ndk/include_ndk/android/persistable_bundle.h +5 −0 Original line number Original line Diff line number Diff line Loading @@ -29,6 +29,11 @@ #include <sys/cdefs.h> #include <sys/cdefs.h> #include <sys/types.h> #include <sys/types.h> #ifndef __clang__ #define _Nullable #define _Nonnull #endif __BEGIN_DECLS __BEGIN_DECLS /* /* Loading
libs/binder/ndk/service_manager.cpp +3 −0 Original line number Original line Diff line number Diff line Loading @@ -18,6 +18,7 @@ #include <binder/IServiceManager.h> #include <binder/IServiceManager.h> #include <binder/LazyServiceRegistrar.h> #include <binder/LazyServiceRegistrar.h> #include "../Utils.h" #include "ibinder_internal.h" #include "ibinder_internal.h" #include "status_internal.h" #include "status_internal.h" Loading Loading @@ -89,7 +90,9 @@ AIBinder* AServiceManager_getService(const char* instance) { } } sp<IServiceManager> sm = defaultServiceManager(); sp<IServiceManager> sm = defaultServiceManager(); LIBBINDER_IGNORE("-Wdeprecated-declarations") sp<IBinder> binder = sm->getService(String16(instance)); sp<IBinder> binder = sm->getService(String16(instance)); LIBBINDER_IGNORE_END() sp<AIBinder> ret = ABpBinder::lookupOrCreateFromBinder(binder); sp<AIBinder> ret = ABpBinder::lookupOrCreateFromBinder(binder); AIBinder_incStrong(ret.get()); AIBinder_incStrong(ret.get()); Loading