Skip to content

Commit

Permalink
Refs #20352: Fix windows build
Browse files Browse the repository at this point in the history
Signed-off-by: cferreiragonz <[email protected]>
  • Loading branch information
cferreiragonz committed Mar 12, 2024
1 parent b929fdf commit 376e650
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
9 changes: 4 additions & 5 deletions include/fastdds/rtps/network/NetworkBuffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
#ifndef _FASTDDS_RTPS_NETWORK_NETWORKBUFFER_HPP
#define _FASTDDS_RTPS_NETWORK_NETWORKBUFFER_HPP

#include <cstdint> // uint32_t
#include <cstdlib> // size_t
#include <cstdint>
#include <asio.hpp>

namespace eprosima {
Expand All @@ -36,11 +35,11 @@ struct NetworkBuffer final
//! Pointer to the buffer where the data is stored.
const void* buffer;
//! Number of bytes to use starting at @c buffer.
size_t size;
uint32_t size;

NetworkBuffer(
const void* ptr,
size_t s)
uint32_t s)
: buffer(ptr)
, size(s)
{
Expand All @@ -54,7 +53,7 @@ struct NetworkBuffer final

NetworkBuffer(
const fastrtps::rtps::octet* ptr,
size_t s)
uint32_t s)
: buffer(ptr)
, size(s)
{
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/rtps/transport/TCPChannelResource.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class TCPChannelResource : public ChannelResource
const fastrtps::rtps::octet* header,
size_t header_size,
const fastrtps::rtps::octet* data,
size_t data_size,
uint32_t data_size,
asio::error_code& ec)
{
NetworkBuffer buffers(data, data_size);
Expand Down
3 changes: 2 additions & 1 deletion src/cpp/rtps/transport/test_UDPv4Transport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ bool test_UDPv4Transport::log_drop(
const std::list<NetworkBuffer>& buffers,
uint32_t size)
{
uint32_t total_size = size;
if (test_UDPv4Transport_DropLog.size() < test_UDPv4Transport_DropLogLength)
{
vector<octet> message;
Expand All @@ -502,7 +503,7 @@ bool test_UDPv4Transport::log_drop(
auto byte_data = static_cast<const octet*>(buf.buffer);
message.insert(message.end(), byte_data, byte_data + buf.size);
}
assert(message.size() == size);
assert(message.size() == total_size);
test_UDPv4Transport_DropLog.push_back(message);
return true;
}
Expand Down

0 comments on commit 376e650

Please sign in to comment.