OSDN Git Service

Fix build break: Make sure we use use unsigned comparisons.
authorStephen Hines <srhines@google.com>
Wed, 16 Nov 2016 19:34:09 +0000 (11:34 -0800)
committerStephen Hines <srhines@google.com>
Wed, 16 Nov 2016 20:09:37 +0000 (20:09 +0000)
The original CL was comparing signed and unsigned values, which triggers
a warning/error diagnostic.

Test: Built bullhead successfully.
Change-Id: I5fd6736690f9697b2b6c800f98a7ce3a6ada9c35

include/binder/Parcel.h

index bd2213d..b0d53ef 100644 (file)
@@ -681,13 +681,13 @@ status_t Parcel::unsafeReadTypedVector(
         return UNEXPECTED_NULL;
     }
 
-    if (val->max_size() < size) {
+    if (val->max_size() < static_cast<size_t>(size)) {
         return NO_MEMORY;
     }
 
     val->resize(static_cast<size_t>(size));
 
-    if (val->size() < size) {
+    if (val->size() < static_cast<size_t>(size)) {
         return NO_MEMORY;
     }