Skip to content
This repository has been archived by the owner on Oct 7, 2021. It is now read-only.

update style to match latest uncrustify #206

Merged
merged 1 commit into from
Sep 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions rmw_opensplice_cpp/src/demangle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,12 @@ _demangle_service_from_topic(const std::string & topic_name)
_get_ros_service_request_prefix(),
_get_ros_service_response_prefix(),
};
if (std::none_of(prefixes.cbegin(), prefixes.cend(), [&prefix](auto x) {
return prefix == x;
}))
if (
std::none_of(
prefixes.cbegin(), prefixes.cend(),
[&prefix](auto x) {
return prefix == x;
}))
{
// not a ROS service topic
return "";
Expand Down
6 changes: 3 additions & 3 deletions rmw_opensplice_cpp/src/qos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ using rosidl_typesupport_opensplice_cpp::impl::check_get_default_datareader_qos;
using rosidl_typesupport_opensplice_cpp::impl::check_get_default_datawriter_qos;

template<typename DDSEntityQos>
bool set_entity_qos_from_profile(const rmw_qos_profile_t & qos_profile,
bool set_entity_qos_from_profile(
const rmw_qos_profile_t & qos_profile,
DDSEntityQos & entity_qos)
{
switch (qos_profile.history) {
Expand Down Expand Up @@ -77,8 +78,7 @@ bool set_entity_qos_from_profile(const rmw_qos_profile_t & qos_profile,
assert(entity_qos.history.depth >= 0);
if (
entity_qos.history.kind == DDS::KEEP_LAST_HISTORY_QOS &&
static_cast<size_t>(entity_qos.history.depth) < qos_profile.depth
)
static_cast<size_t>(entity_qos.history.depth) < qos_profile.depth)
{
if (qos_profile.depth > (std::numeric_limits<DDS::Long>::max)()) {
RMW_SET_ERROR_MSG(
Expand Down
3 changes: 2 additions & 1 deletion rmw_opensplice_cpp/src/rmw_response.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ rmw_send_response(
}

rmw_ret_t
rmw_take_response(const rmw_client_t * client, rmw_request_id_t * request_header,
rmw_take_response(
const rmw_client_t * client, rmw_request_id_t * request_header,
void * ros_response, bool * taken)
{
if (!client) {
Expand Down
20 changes: 11 additions & 9 deletions rmw_opensplice_cpp/src/types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@ CustomDataReaderListener::CustomDataReaderListener()
if (discovery_logging_value) {
std::string str(discovery_logging_value, discovery_logging_size);
std::string str_lower(str);
std::transform(str_lower.begin(), str_lower.end(), str_lower.begin(), [](unsigned char c) {
return std::tolower(c);
});
std::transform(
str_lower.begin(), str_lower.end(), str_lower.begin(),
[](unsigned char c) {
return std::tolower(c);
});
if (str != "0" && str_lower != "false" && str_lower != "off") {
print_discovery_logging_ = true;
}
Expand All @@ -73,12 +75,12 @@ CustomDataReaderListener::count_topic(const char * topic_name)
topic_names_and_types_.begin(),
topic_names_and_types_.end(),
[&](auto tnt) -> bool {
auto fqdn = _demangle_if_ros_topic(tnt.first);
if (fqdn == topic_name) {
return true;
}
return false;
});
auto fqdn = _demangle_if_ros_topic(tnt.first);
if (fqdn == topic_name) {
return true;
}
return false;
});
size_t count;
if (it == topic_names_and_types_.end()) {
count = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ class Requester
sequence_number_(0)
{}

const char * init(const DDS::DataReaderQos * datareader_qos,
const char * init(
const DDS::DataReaderQos * datareader_qos,
const DDS::DataWriterQos * datawriter_qos,
bool avoid_ros_namespace_conventions) noexcept
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ class Responder
response_topic_(nullptr)
{}

const char * init(const DDS::DataReaderQos * datareader_qos,
const char * init(
const DDS::DataReaderQos * datareader_qos,
const DDS::DataWriterQos * datawriter_qos,
bool avoid_ros_namespace_conventions)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ take_response__@(spec.srv_name)(
}

const char *
destroy_requester__@(spec.srv_name)(void * untyped_requester, void (* deallocator)(void *))
destroy_requester__@(spec.srv_name)(void * untyped_requester, void (*deallocator)(void *))
{
using RequesterT = rosidl_typesupport_opensplice_cpp::Requester<
@(__dds_msg_type_prefix)_Request_,
Expand All @@ -534,7 +534,7 @@ destroy_requester__@(spec.srv_name)(void * untyped_requester, void (* deallocato
}

const char *
destroy_responder__@(spec.srv_name)(void * untyped_responder, void (* deallocator)(void *))
destroy_responder__@(spec.srv_name)(void * untyped_responder, void (*deallocator)(void *))
{
using ResponderT = rosidl_typesupport_opensplice_cpp::Responder<
@(__dds_msg_type_prefix)_Request_,
Expand Down