From a7fd9bd74619c2e4ac29b63aa704221950cad70f Mon Sep 17 00:00:00 2001 From: Iker Luengo Date: Wed, 28 Jul 2021 09:01:24 +0200 Subject: [PATCH] Refs 12051. Fix warnings on Windows Signed-off-by: Iker Luengo --- src/cpp/rtps/DataSharing/DataSharingNotification.hpp | 2 +- src/cpp/utils/shared_memory/SharedMemSegment.hpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cpp/rtps/DataSharing/DataSharingNotification.hpp b/src/cpp/rtps/DataSharing/DataSharingNotification.hpp index 0086d837917..529c7adf14e 100644 --- a/src/cpp/rtps/DataSharing/DataSharingNotification.hpp +++ b/src/cpp/rtps/DataSharing/DataSharingNotification.hpp @@ -127,7 +127,7 @@ class DataSharingNotification segment_id_ = reader_guid; segment_name_ = generate_segment_name(shared_dir, reader_guid); - size_t per_allocation_extra_size = T::compute_per_allocation_extra_size( + uint32_t per_allocation_extra_size = T::compute_per_allocation_extra_size( alignof(Notification), DataSharingNotification::domain_name()); uint32_t segment_size = static_cast(sizeof(Notification)) + per_allocation_extra_size; diff --git a/src/cpp/utils/shared_memory/SharedMemSegment.hpp b/src/cpp/utils/shared_memory/SharedMemSegment.hpp index f84fec2b59e..f0462b35820 100644 --- a/src/cpp/utils/shared_memory/SharedMemSegment.hpp +++ b/src/cpp/utils/shared_memory/SharedMemSegment.hpp @@ -339,10 +339,10 @@ class SharedSegment : public SharedSegmentBase { managed_shared_memory_type test_segment(boost::interprocess::create_only, name.c_str(), - (std::max)((size_t)1024, allocation_alignment * 4)); + (std::max)((uint32_t)1024, static_cast(allocation_alignment * 4))); auto m1 = test_segment.get_free_memory(); - test_segment.allocate_aligned(1, allocation_alignment); + test_segment.allocate_aligned(1, static_cast(allocation_alignment)); auto m2 = test_segment.get_free_memory(); extra_size = static_cast(m1 - m2); }