Skip to content

Commit

Permalink
remove compilation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
IkerLuengo committed Feb 6, 2020
1 parent abb81b2 commit c5dc730
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 25 deletions.
2 changes: 1 addition & 1 deletion include/fastrtps/qos/QosPolicies.h
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@ class PartitionQosPolicy : public Parameter_t, public QosPolicy
const char* name)
{
//Realloc if needed;
uint32_t size = strlen(name)+1;
uint32_t size = (uint32_t)strlen(name)+1;
uint32_t alignment = ((size + 3) & ~3) - size;

if (max_size_ != 0 && (partitions_.max_size < partitions_.length +
Expand Down
1 change: 1 addition & 0 deletions include/fastrtps/rtps/writer/ReaderProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class ReaderProxy
* Constructor.
* @param times WriterTimes to use in the ReaderProxy.
* @param loc_alloc Maximum number of remote locators to keep in the ReaderProxy.
* @param limits Maximum size allowed for variable length fields on messages
* @param writer Pointer to the StatefulWriter creating the reader proxy.
*/
ReaderProxy(
Expand Down
18 changes: 9 additions & 9 deletions src/cpp/qos/ParameterTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,25 +310,25 @@ bool ParameterPropertyList_t::readFromCDRMessage(CDRMessage_t* msg, uint32_t siz

for(size_t i = 0; i < num_properties; ++i)
{
uint32_t size, alignment;
uint32_t property_size, alignment;

valid &= CDRMessage::readUInt32(msg,&size);
valid &= CDRMessage::readUInt32(msg,&property_size);
if (!valid)
{
return false;
}
alignment = ((size + 3) & ~3) - size;
push_back_helper (&msg->buffer[msg->pos], size, alignment);
msg->pos += (size + alignment);
alignment = ((property_size + 3) & ~3) - property_size;
push_back_helper (&msg->buffer[msg->pos], property_size, alignment);
msg->pos += (property_size + alignment);

valid &= CDRMessage::readUInt32(msg,&size);
valid &= CDRMessage::readUInt32(msg,&property_size);
if (!valid)
{
return false;
}
alignment = ((size + 3) & ~3) - size;
push_back_helper (&msg->buffer[msg->pos], size, alignment);
msg->pos += (size + alignment);
alignment = ((property_size + 3) & ~3) - property_size;
push_back_helper (&msg->buffer[msg->pos], property_size, alignment);
msg->pos += (property_size + alignment);
}
Nproperties_ = num_properties;
return valid;
Expand Down
10 changes: 5 additions & 5 deletions src/cpp/qos/QosPolicies.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,17 +255,17 @@ bool PartitionQosPolicy::readFromCDRMessage(CDRMessage_t* msg, uint32_t size)

for(size_t i = 0; i < num_partitions; ++i)
{
uint32_t size, alignment;
uint32_t partition_size, alignment;

valid &= CDRMessage::readUInt32(msg,&size);
valid &= CDRMessage::readUInt32(msg,&partition_size);
if (!valid)
{
return false;
}

push_back ((const char*)&msg->buffer[msg->pos]);
alignment = ((size + 3) & ~3) - size;
msg->pos += (size + alignment);
alignment = ((partition_size + 3) & ~3) - partition_size;
msg->pos += (partition_size + alignment);
}
Npartitions_ = num_partitions;
return valid;
Expand All @@ -274,7 +274,7 @@ bool PartitionQosPolicy::readFromCDRMessage(CDRMessage_t* msg, uint32_t size)
bool UserDataQosPolicy::addToCDRMessage(CDRMessage_t* msg)
{
bool valid = CDRMessage::addUInt16(msg, this->Pid);
uint32_t size = dataVec_.size();
uint32_t size = (uint32_t)dataVec_.size();
uint32_t align = ((size + 3) & ~3) - size;
this->length = (uint16_t)(4 + size + align);
valid &= CDRMessage::addUInt16(msg, this->length);
Expand Down
4 changes: 2 additions & 2 deletions src/cpp/rtps/builtin/data/ParticipantProxyData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ ParticipantProxyData::ParticipantProxyData(const RTPSParticipantAllocationAttrib
, plugin_security_attributes_(0UL)
#endif
, isAlive(false)
, m_properties(allocation.data_limits.max_properties)
, m_properties((uint32_t)allocation.data_limits.max_properties)
, lease_duration_event(nullptr)
, should_check_lease_duration(false)
, m_readers(allocation.readers)
, m_writers(allocation.writers)
{
m_userData.max_size(allocation.data_limits.max_user_data);
m_userData.max_size((uint32_t)allocation.data_limits.max_user_data);
}

ParticipantProxyData::ParticipantProxyData(const ParticipantProxyData& pdata)
Expand Down
8 changes: 4 additions & 4 deletions src/cpp/rtps/builtin/data/ReaderProxyData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ ReaderProxyData::ReaderProxyData (
const VariableLengthDataLimits& data_limits)
: ReaderProxyData(max_unicast_locators, max_multicast_locators)
{
m_qos.m_userData.max_size(data_limits.max_user_data);
m_qos.m_partition.max_size(data_limits.max_partitions);
m_qos.m_userData.max_size((uint32_t)data_limits.max_user_data);
m_qos.m_partition.max_size((uint32_t)data_limits.max_partitions);
}

ReaderProxyData::~ReaderProxyData()
Expand Down Expand Up @@ -836,8 +836,8 @@ void ReaderProxyData::clear()
m_isAlive = true;
m_topicKind = NO_KEY;
//clear user data but keep max size on qos
size_t max_user_data = m_qos.m_userData.max_size();
size_t max_partitions = m_qos.m_partition.max_size();
uint32_t max_user_data = m_qos.m_userData.max_size();
uint32_t max_partitions = m_qos.m_partition.max_size();
m_qos = ReaderQos();
m_qos.m_userData.max_size(max_user_data);
m_qos.m_partition.max_size(max_partitions);
Expand Down
8 changes: 4 additions & 4 deletions src/cpp/rtps/builtin/data/WriterProxyData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ WriterProxyData::WriterProxyData(
const VariableLengthDataLimits& data_limits)
: WriterProxyData(max_unicast_locators, max_multicast_locators)
{
m_qos.m_userData.max_size(data_limits.max_user_data);
m_qos.m_partition.max_size(data_limits.max_partitions);
m_qos.m_userData.max_size((uint32_t)data_limits.max_user_data);
m_qos.m_partition.max_size((uint32_t)data_limits.max_partitions);
}

WriterProxyData::WriterProxyData(
Expand Down Expand Up @@ -841,8 +841,8 @@ void WriterProxyData::clear()
m_topicName = "";
m_userDefinedId = 0;
//clear user data but keep max size on qos
size_t max_user_data = m_qos.m_userData.max_size();
size_t max_partition = m_qos.m_partition.max_size();
uint32_t max_user_data = m_qos.m_userData.max_size();
uint32_t max_partition = m_qos.m_partition.max_size();
m_qos = WriterQos();
m_qos.m_userData.max_size(max_user_data);
m_qos.m_partition.max_size(max_partition);
Expand Down

0 comments on commit c5dc730

Please sign in to comment.