Skip to content

Commit

Permalink
Refs #2976. Linters.
Browse files Browse the repository at this point in the history
  • Loading branch information
MiguelCompany committed Jun 14, 2018
1 parent f963d8f commit 07d3094
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
19 changes: 11 additions & 8 deletions rmw_fastrtps_cpp/include/rmw_fastrtps_cpp/TypeSupport_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -824,8 +824,8 @@ size_t TypeSupport<MembersType>::calculateMaxSerializedSize(

template<typename MembersType>
size_t TypeSupport<MembersType>::getSerializedDataLength(
const MembersType * members,
const void * ros_message,
const MembersType * members,
const void * ros_message,
size_t current_alignment)
{
assert(members);
Expand Down Expand Up @@ -964,12 +964,14 @@ bool TypeSupport<MembersType>::serialize(
assert(data);
assert(payload);

eprosima::fastcdr::FastBuffer fastbuffer((char*) payload->data, payload->max_size); // Object that manages the raw buffer.
eprosima::fastcdr::FastBuffer fastbuffer(
reinterpret_cast<char *>(payload->data),
payload->max_size); // Object that manages the raw buffer.
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN,
eprosima::fastcdr::Cdr::DDS_CDR); // Object that serializes the data.
eprosima::fastcdr::Cdr::DDS_CDR); // Object that serializes the data.
this->serializeROSmessage(data, ser);
payload->encapsulation = ser.endianness() ==
eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE;
this->serializeROSmessage(data, ser);
payload->length = (uint32_t)ser.getSerializedDataLength();
return true;
}
Expand All @@ -980,12 +982,13 @@ bool TypeSupport<MembersType>::deserialize(
void * data)
{
assert(data);
eprosima::fastcdr::FastBuffer fastbuffer((char*)payload->data, payload->length);
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char *>(payload->data),
payload->length);
return this->deserializeROSmessage(&fastbuffer, data);
}

template<typename MembersType>
std::function<uint32_t()>
std::function<uint32_t()>
TypeSupport<MembersType>::getSerializedSizeProvider(void * data)
{
assert(data);
Expand All @@ -995,7 +998,7 @@ TypeSupport<MembersType>::getSerializedSizeProvider(void * data)
}

return [this, data]() -> uint32_t {
return
return
4 + static_cast<uint32_t>(
TypeSupport::getSerializedDataLength(members_, data, 0));
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class ServiceListener : public eprosima::fastrtps::SubscriberListener
identity = sinfo.sample_identity;
ret_val = (eprosima::fastrtps::rtps::ALIVE == sinfo.sampleKind);
}

std::lock_guard<std::mutex> lock(internalMutex_);
if (conditionMutex_ != nullptr) {
std::unique_lock<std::mutex> clock(*conditionMutex_);
Expand Down
2 changes: 1 addition & 1 deletion rmw_fastrtps_cpp/src/rmw_request.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ rmw_take_request(
assert(info);

eprosima::fastrtps::rtps::SampleIdentity identity;

if(info->listener_->getRequest(ros_request, identity) ) {
// Get header
memcpy(request_header->writer_guid, &identity.writer_guid(),
Expand Down

0 comments on commit 07d3094

Please sign in to comment.