Merge "Fix implicit conversion" am: 3dc9190ac4

Original change: https://android-review.googlesource.com/c/platform/system/libhidl/+/1352105

Change-Id: I47a8c8c69653e87890a4d5f196270ae630517ac1
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 @@
 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 @@
     }
 }
 
-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.