Skip to content

Commit

Permalink
Fixed some basic review comments.
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
  • Loading branch information
MiguelCompany committed Apr 5, 2021
1 parent 87b2371 commit 6ac968a
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 21 deletions.
4 changes: 1 addition & 3 deletions rmw_fastrtps_cpp/src/publisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,7 @@ rmw_fastrtps_cpp::create_publisher(

/////
// Create the custom Publisher struct (info)
CustomPublisherInfo * info = nullptr;

info = new (std::nothrow) CustomPublisherInfo();
auto info = new (std::nothrow) CustomPublisherInfo();
if (!info) {
RMW_SET_ERROR_MSG("create_publisher() failed to allocate CustomPublisherInfo");
return nullptr;
Expand Down
2 changes: 1 addition & 1 deletion rmw_fastrtps_cpp/src/rmw_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ rmw_create_client(
info->response_topic_ = response_topic_name;

// Keyword to find DataWriter and DataReader QoS
std::string topic_name_fallback = "client";
const std::string topic_name_fallback = "client";

/////
// Create response DataReader
Expand Down
2 changes: 1 addition & 1 deletion rmw_fastrtps_cpp/src/rmw_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ rmw_create_service(
}

// Keyword to find DataWrtier and DataReader QoS
std::string topic_name_fallback = "service";
const std::string topic_name_fallback = "service";

/////
// Create request DataReader
Expand Down
4 changes: 1 addition & 3 deletions rmw_fastrtps_cpp/src/subscription.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,7 @@ create_subscription(

/////
// Create the custom Subscriber struct (info)
CustomSubscriberInfo * info = nullptr;

info = new (std::nothrow) CustomSubscriberInfo();
auto info = new (std::nothrow) CustomSubscriberInfo();
if (!info) {
RMW_SET_ERROR_MSG("create_subscription() failed to allocate CustomSubscriberInfo");
return nullptr;
Expand Down
4 changes: 1 addition & 3 deletions rmw_fastrtps_dynamic_cpp/src/publisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,7 @@ rmw_fastrtps_dynamic_cpp::create_publisher(

/////
// Create the custom Publisher struct (info)
CustomPublisherInfo * info = nullptr;

info = new (std::nothrow) CustomPublisherInfo();
auto info = new (std::nothrow) CustomPublisherInfo();
if (!info) {
RMW_SET_ERROR_MSG("create_publisher() failed to allocate CustomPublisherInfo");
return nullptr;
Expand Down
2 changes: 1 addition & 1 deletion rmw_fastrtps_dynamic_cpp/src/rmw_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ rmw_create_client(
info->response_topic_ = response_topic_name;

// Keyword to find DataWrtier and DataReader QoS
std::string topic_name_fallback = "client";
const std::string topic_name_fallback = "client";

/////
// Create response DataReader
Expand Down
9 changes: 3 additions & 6 deletions rmw_fastrtps_dynamic_cpp/src/rmw_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,9 @@ rmw_create_service(
// Find and check existing topics and types

// Create Topic and Type names
const void * untyped_request_members;
const void * untyped_response_members;

untyped_request_members = get_request_ptr(
const void * untyped_request_members = get_request_ptr(
type_support->data, type_support->typesupport_identifier);
untyped_response_members = get_response_ptr(
const void * untyped_response_members = get_response_ptr(
type_support->data, type_support->typesupport_identifier);

std::string request_type_name = _create_type_name(
Expand Down Expand Up @@ -322,7 +319,7 @@ rmw_create_service(
}

// Keyword to find DataWrtier and DataReader QoS
std::string topic_name_fallback = "service";
const std::string topic_name_fallback = "service";

/////
// Create request DataReader
Expand Down
4 changes: 1 addition & 3 deletions rmw_fastrtps_dynamic_cpp/src/subscription.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,7 @@ create_subscription(

/////
// Create the custom Subscriber struct (info)
CustomSubscriberInfo * info = nullptr;

info = new (std::nothrow) CustomSubscriberInfo();
auto info = new (std::nothrow) CustomSubscriberInfo();
if (!info) {
RMW_SET_ERROR_MSG("create_subscription() failed to allocate CustomSubscriberInfo");
return nullptr;
Expand Down

0 comments on commit 6ac968a

Please sign in to comment.