summaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorMarin Shalamanov <shalamanov@google.com>2020-06-29 13:45:32 +0200
committerMarin Shalamanov <shalamanov@google.com>2020-06-29 13:49:11 +0200
commit08cfe867b0c8bfafe39d2c4da289853c8030c059 (patch)
tree6f5dc2876de4fcc6aa30f794f42cafaf4caf7292 /base
parenta9bcfba420c502677d4188c3336363904d76d86b (diff)
downloadlibhidl-08cfe867b0c8bfafe39d2c4da289853c8030c059.tar.gz
Fix implicit conversion
Fixes "implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'uint32_t' (aka 'unsigned int')". Test: m Bug: 129481165 Change-Id: I06830fb7439b7f9f44e4ceb506628d117c49c739
Diffstat (limited to 'base')
-rw-r--r--base/include/hidl/MQDescriptor.h20
1 files changed, 8 insertions, 12 deletions
diff --git a/base/include/hidl/MQDescriptor.h b/base/include/hidl/MQDescriptor.h
index 07caa95..eb244e5 100644
--- a/base/include/hidl/MQDescriptor.h
+++ b/base/include/hidl/MQDescriptor.h
@@ -164,14 +164,10 @@ using MQDescriptorSync = MQDescriptor<T, kSynchronizedReadWrite>;
template<typename T>
using MQDescriptorUnsync = MQDescriptor<T, kUnsynchronizedWrite>;
-template<typename T, MQFlavor flavor>
-MQDescriptor<T, flavor>::MQDescriptor(
- const std::vector<GrantorDescriptor>& grantors,
- native_handle_t* nhandle,
- size_t size)
- : mHandle(nhandle),
- mQuantum(size),
- mFlags(flavor) {
+template <typename T, MQFlavor flavor>
+MQDescriptor<T, flavor>::MQDescriptor(const std::vector<GrantorDescriptor>& grantors,
+ native_handle_t* nhandle, size_t size)
+ : mHandle(nhandle), mQuantum(static_cast<uint32_t>(size)), mFlags(flavor) {
mGrantors.resize(grantors.size());
for (size_t i = 0; i < grantors.size(); ++i) {
if (isAlignedToWordBoundary(grantors[i].offset) == false) {
@@ -181,10 +177,10 @@ MQDescriptor<T, flavor>::MQDescriptor(
}
}
-template<typename T, MQFlavor flavor>
-MQDescriptor<T, flavor>::MQDescriptor(size_t bufferSize, native_handle_t *nHandle,
- size_t messageSize, bool configureEventFlag)
- : mHandle(nHandle), mQuantum(messageSize), mFlags(flavor) {
+template <typename T, MQFlavor flavor>
+MQDescriptor<T, flavor>::MQDescriptor(size_t bufferSize, native_handle_t* nHandle,
+ size_t messageSize, bool configureEventFlag)
+ : mHandle(nHandle), mQuantum(static_cast<uint32_t>(messageSize)), mFlags(flavor) {
/*
* If configureEventFlag is true, allocate an additional spot in mGrantor
* for containing the fd and offset for mmapping the EventFlag word.