summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Steven Moreland <smoreland@google.com> 2018-12-18 12:43:19 -0800
committer android-build-merger <android-build-merger@google.com> 2018-12-18 12:43:19 -0800
commitd97f0ec4bbde9697166a2a0536baf80846698052 (patch)
tree73cd49074ccb9851863e6b9e36829cc1189b190c
parent61f6a8793b1514288ecf2cc36acdd846d608c57f (diff)
parentaf01b5d1bad9678a03229730a974b01ea391ef94 (diff)
Merge "Fix -Wsize-comparison failures." am: f2147cf2a9 am: 872cc103ea
am: af01b5d1ba Change-Id: I295854f5cdfffd2bb405deecdbe66941c8264254
-rw-r--r--libs/binder/ndk/include_ndk/android/binder_parcel_utils.h8
1 files changed, 4 insertions, 4 deletions
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 fcdf7af22c..f3bc31b0bb 100644
--- a/libs/binder/ndk/include_ndk/android/binder_parcel_utils.h
+++ b/libs/binder/ndk/include_ndk/android/binder_parcel_utils.h
@@ -43,7 +43,7 @@ static inline bool AParcel_stdVectorAllocator(void* vectorData, int32_t length,
if (length < 0) return false;
std::vector<T>* vec = static_cast<std::vector<T>*>(vectorData);
- if (length > vec->max_size()) return false;
+ if (static_cast<size_t>(length) > vec->max_size()) return false;
vec->resize(length);
*outBuffer = vec->data();
@@ -65,7 +65,7 @@ static inline bool AParcel_nullableStdVectorAllocator(void* vectorData, int32_t
*vec = std::optional<std::vector<T>>(std::vector<T>{});
- if (length > (*vec)->max_size()) return false;
+ if (static_cast<size_t>(length) > (*vec)->max_size()) return false;
(*vec)->resize(length);
*outBuffer = (*vec)->data();
@@ -88,7 +88,7 @@ static inline bool AParcel_stdVectorExternalAllocator(void* vectorData, int32_t
if (length < 0) return false;
std::vector<T>* vec = static_cast<std::vector<T>*>(vectorData);
- if (length > vec->max_size()) return false;
+ if (static_cast<size_t>(length) > vec->max_size()) return false;
vec->resize(length);
return true;
@@ -116,7 +116,7 @@ static inline bool AParcel_nullableStdVectorExternalAllocator(void* vectorData,
*vec = std::optional<std::vector<T>>(std::vector<T>{});
- if (length > (*vec)->max_size()) return false;
+ if (static_cast<size_t>(length) > (*vec)->max_size()) return false;
(*vec)->resize(length);
return true;