From 01ee4938a5ab139eed13fbfd99b3ebd17e9322d4 Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Thu, 18 Oct 2018 10:27:20 -0700 Subject: libbinder_ndk: camel case for string APIs To be consistent. Bug: 111445392 Test: atest android.binder.cts Change-Id: I343abada4f1a1188bcb5887d122d3d09c1775b76 --- libs/binder/ndk/include_ndk/android/binder_parcel.h | 8 ++++---- libs/binder/ndk/include_ndk/android/binder_parcel_utils.h | 6 +++--- libs/binder/ndk/parcel.cpp | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'libs') diff --git a/libs/binder/ndk/include_ndk/android/binder_parcel.h b/libs/binder/ndk/include_ndk/android/binder_parcel.h index 73df69c0e3..d36b3c06f3 100644 --- a/libs/binder/ndk/include_ndk/android/binder_parcel.h +++ b/libs/binder/ndk/include_ndk/android/binder_parcel.h @@ -136,12 +136,12 @@ typedef int8_t* (*AParcel_byteArrayGetter)(void* arrayData); * * If allocation fails, null should be returned. */ -typedef void* (*AParcel_string_reallocator)(void* stringData, size_t length); +typedef void* (*AParcel_stringReallocator)(void* stringData, size_t length); /** * This is called to get the buffer from a stringData object. */ -typedef char* (*AParcel_string_getter)(void* stringData); +typedef char* (*AParcel_stringGetter)(void* stringData); /** * Writes an AIBinder to the next location in a non-null parcel. Can be null. @@ -198,8 +198,8 @@ binder_status_t AParcel_writeString(AParcel* parcel, const char* string, size_t * If this function returns a success, the buffer returned by allocator when passed stringData will * contain a null-terminated c-str read from the binder. */ -binder_status_t AParcel_readString(const AParcel* parcel, AParcel_string_reallocator reallocator, - AParcel_string_getter getter, void** stringData) +binder_status_t AParcel_readString(const AParcel* parcel, AParcel_stringReallocator reallocator, + AParcel_stringGetter getter, void** stringData) __INTRODUCED_IN(29); // @START-PRIMITIVE-READ-WRITE diff --git a/libs/binder/ndk/include_ndk/android/binder_parcel_utils.h b/libs/binder/ndk/include_ndk/android/binder_parcel_utils.h index 6341b46d21..faeb78fdfa 100644 --- a/libs/binder/ndk/include_ndk/android/binder_parcel_utils.h +++ b/libs/binder/ndk/include_ndk/android/binder_parcel_utils.h @@ -270,7 +270,7 @@ inline binder_status_t AParcel_readVector(const AParcel* parcel, std::ve * Takes a std::string and reallocates it to the specified length. For use with AParcel_readString. * See use below in AParcel_readString. */ -static inline void* AParcel_std_string_reallocator(void* stringData, size_t length) { +static inline void* AParcel_stdStringReallocator(void* stringData, size_t length) { std::string* str = static_cast(stringData); str->resize(length - 1); return stringData; @@ -279,7 +279,7 @@ static inline void* AParcel_std_string_reallocator(void* stringData, size_t leng /** * Takes a std::string and returns the inner char*. */ -static inline char* AParcel_std_string_getter(void* stringData) { +static inline char* AParcel_stdStringGetter(void* stringData) { std::string* str = static_cast(stringData); return &(*str)[0]; } @@ -296,7 +296,7 @@ static inline binder_status_t AParcel_writeString(AParcel* parcel, const std::st */ static inline binder_status_t AParcel_readString(const AParcel* parcel, std::string* str) { void* stringData = static_cast(str); - return AParcel_readString(parcel, AParcel_std_string_reallocator, AParcel_std_string_getter, + return AParcel_readString(parcel, AParcel_stdStringReallocator, AParcel_stdStringGetter, &stringData); } diff --git a/libs/binder/ndk/parcel.cpp b/libs/binder/ndk/parcel.cpp index 5279b549ce..29094dba7b 100644 --- a/libs/binder/ndk/parcel.cpp +++ b/libs/binder/ndk/parcel.cpp @@ -255,8 +255,8 @@ binder_status_t AParcel_writeString(AParcel* parcel, const char* string, size_t return STATUS_OK; } -binder_status_t AParcel_readString(const AParcel* parcel, AParcel_string_reallocator reallocator, - AParcel_string_getter getter, void** stringData) { +binder_status_t AParcel_readString(const AParcel* parcel, AParcel_stringReallocator reallocator, + AParcel_stringGetter getter, void** stringData) { size_t len16; const char16_t* str16 = parcel->get()->readString16Inplace(&len16); @@ -287,7 +287,7 @@ binder_status_t AParcel_readString(const AParcel* parcel, AParcel_string_realloc char* str8 = getter(*stringData); if (str8 == nullptr) { - LOG(WARNING) << __func__ << ": AParcel_string_allocator failed to allocate."; + LOG(WARNING) << __func__ << ": AParcel_stringReallocator failed to allocate."; return STATUS_NO_MEMORY; } -- cgit v1.2.3-59-g8ed1b