Merge "Fix implicit conversions" am: c6b9ee3705
Original change: https://android-review.googlesource.com/c/platform/system/libhidl/+/1351048
Change-Id: Ibb0df7df249fca2507e1826e39a63ca47dd4b0db
diff --git a/base/include/hidl/MQDescriptor.h b/base/include/hidl/MQDescriptor.h
index 0f61cb5..07caa95 100644
--- a/base/include/hidl/MQDescriptor.h
+++ b/base/include/hidl/MQDescriptor.h
@@ -234,9 +234,8 @@
mHandle->data[i] = dup(other.mHandle->data[i]);
}
- memcpy(&mHandle->data[other.mHandle->numFds],
- &other.mHandle->data[other.mHandle->numFds],
- other.mHandle->numInts * sizeof(int));
+ memcpy(&mHandle->data[other.mHandle->numFds], &other.mHandle->data[other.mHandle->numFds],
+ static_cast<size_t>(other.mHandle->numInts) * sizeof(int));
}
return *this;
@@ -258,7 +257,7 @@
template<typename T, MQFlavor flavor>
size_t MQDescriptor<T, flavor>::getSize() const {
- return mGrantors[DATAPTRPOS].extent;
+ return static_cast<size_t>(mGrantors[DATAPTRPOS].extent);
}
template<typename T, MQFlavor flavor>