summaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorMarin Shalamanov <shalamanov@google.com>2020-06-19 16:05:17 +0200
committerMarin Shalamanov <shalamanov@google.com>2020-06-26 13:32:38 +0200
commita9bcfba420c502677d4188c3336363904d76d86b (patch)
treed32277713dbff28d811af195abe7d470c9aafb92 /base
parent79ef387d1a1b734a5c9b491b883c2e170dfacc41 (diff)
downloadlibhidl-a9bcfba420c502677d4188c3336363904d76d86b.tar.gz
Fix implicit conversions
Test: m libhidl Bug: 129481165 Change-Id: Ic9a6d974f0ad59c42c052d1cb02001407f4929a3
Diffstat (limited to 'base')
-rw-r--r--base/include/hidl/MQDescriptor.h7
1 files changed, 3 insertions, 4 deletions
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 @@ MQDescriptor<T, flavor>& MQDescriptor<T, flavor>::operator=(const MQDescriptor&
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 @@ MQDescriptor<T, flavor>::~MQDescriptor() {
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>