Binder: enable/fix some warnings
Bug: 341997808
Test: mma
Change-Id: Ibd44eda768a714e85399a15f3c8e534d715f87ce
diff --git a/libs/binder/PersistableBundle.cpp b/libs/binder/PersistableBundle.cpp
index 5b157cc..abb6612 100644
--- a/libs/binder/PersistableBundle.cpp
+++ b/libs/binder/PersistableBundle.cpp
@@ -113,7 +113,7 @@
// Backpatch length. This length value includes the length header.
parcel->setDataPosition(length_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);
return BAD_VALUE;
}
@@ -319,7 +319,7 @@
* pairs themselves.
*/
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",
num_entries);
return BAD_VALUE;