Skip to content

Commit

Permalink
Fixed warnings - strict-prototypes (#800)
Browse files Browse the repository at this point in the history
Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
  • Loading branch information
ahcorde committed Apr 23, 2024
1 parent 3d1ae8f commit 2579950
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion rosidl_generator_c/resource/action__type_support.h.em
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const rosidl_action_type_support_t *
ROSIDL_TYPESUPPORT_INTERFACE__ACTION_SYMBOL_NAME(
rosidl_typesupport_c,
@(',\n '.join(action.namespaced_type.namespaced_name()))
)();
)(void);

@{
TEMPLATE(
Expand Down
2 changes: 1 addition & 1 deletion rosidl_generator_c/resource/msg__functions.c.em
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ bool
}

@(message_typename) *
@(message_typename)__create()
@(message_typename)__create(void)
{
rcutils_allocator_t allocator = rcutils_get_default_allocator();
@(message_typename) * msg = (@(message_typename) *)allocator.allocate(sizeof(@(message_typename)), allocator.state);
Expand Down
2 changes: 1 addition & 1 deletion rosidl_generator_c/resource/msg__functions.h.em
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void
*/
ROSIDL_GENERATOR_C_PUBLIC_@(package_name)
@(message_typename) *
@(message_typename)__create();
@(message_typename)__create(void);
/// Destroy @(interface_path_to_string(interface_path)) message.
/**
Expand Down
2 changes: 1 addition & 1 deletion rosidl_generator_c/resource/msg__type_support.h.em
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ const rosidl_message_type_support_t *
ROSIDL_TYPESUPPORT_INTERFACE__MESSAGE_SYMBOL_NAME(
rosidl_typesupport_c,
@(',\n '.join(message.structure.namespaced_type.namespaced_name()))
)();
)(void);
2 changes: 1 addition & 1 deletion rosidl_generator_c/resource/srv__type_support.h.em
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const rosidl_service_type_support_t *
ROSIDL_TYPESUPPORT_INTERFACE__SERVICE_SYMBOL_NAME(
rosidl_typesupport_c,
@(',\n '.join(service.namespaced_type.namespaced_name()))
)();
)(void);

// Forward declare the function to create a service event message for this type.
ROSIDL_GENERATOR_C_PUBLIC_@(package_name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "rosidl_generator_tests/msg/detail/defaults__struct.h"
#include "rosidl_generator_tests/msg/detail/defaults__functions.h"

int func()
int func(void)
{
rosidl_generator_tests__msg__Defaults * msg = rosidl_generator_tests__msg__Defaults__create();
if (!msg) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
#ifndef ROSIDL_GENERATOR_C__SEPARATE_COMPILATION_H_
#define ROSIDL_GENERATOR_C__SEPARATE_COMPILATION_H_

int func();
int func(void);

#endif // ROSIDL_GENERATOR_C__SEPARATE_COMPILATION_H_
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ bool string_char_equal(const rosidl_runtime_c__String * lhs, const char * rhs)
return 0 == memcmp(lhs->data, rhs, rhs_len);
}

int test_description_linkage();
int test_copied_type_description_struct_hashes();
int test_source_defined();
int test_same_name_types();
int test_description_linkage(void);
int test_copied_type_description_struct_hashes(void);
int test_source_defined(void);
int test_same_name_types(void);

int main(void)
{
Expand Down Expand Up @@ -103,7 +103,7 @@ int main(void)
return rc != 0;
}

int test_description_linkage()
int test_description_linkage(void)
{
// Smoke test linkage and basic values for msg, srv, action
// Message
Expand Down Expand Up @@ -168,7 +168,7 @@ int test_description_linkage()
return 0;
}

int test_source_defined()
int test_source_defined(void)
{
// Smoke test that definitions are present for raw type sources
// Message
Expand Down Expand Up @@ -277,7 +277,7 @@ int test_source_defined()
return 0;
}

int test_copied_type_description_struct_hashes()
int test_copied_type_description_struct_hashes(void)
{
#define runtimehash(x) rosidl_runtime_c__type_description__ ## x ## __get_type_hash(NULL)
#define msghash(x) type_description_interfaces__msg__ ## x ## __get_type_hash(NULL)
Expand Down Expand Up @@ -313,7 +313,7 @@ int test_copied_type_description_struct_hashes()
return rc;
}

int test_same_name_types()
int test_same_name_types(void)
{
// Msg and srv with same name in this package
// Regression check case, this was receiving "srv" encoding with Empty.srv sources
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ static int test_bounded_sequences(void)
return 0;
}

int test_unbounded_sequences()
int test_unbounded_sequences(void)
{
rosidl_generator_tests__msg__UnboundedSequences * seq = NULL;
seq = rosidl_generator_tests__msg__UnboundedSequences__create();
Expand Down Expand Up @@ -999,7 +999,7 @@ static int test_multi_nested(void)
return 0;
}

int test_wstrings()
int test_wstrings(void)
{
rosidl_generator_tests__msg__WStrings * wstr = NULL;
wstr = rosidl_generator_tests__msg__WStrings__create();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,17 @@ static rosidl_service_type_support_t @(function_prefix)__@(service.namespaced_ty

// Forward declaration of message type support functions for service members
const rosidl_message_type_support_t *
ROSIDL_TYPESUPPORT_INTERFACE__MESSAGE_SYMBOL_NAME(rosidl_typesupport_introspection_c, @(', '.join([package_name] + list(interface_path.parents[0].parts))), @(service.namespaced_type.name + SERVICE_REQUEST_MESSAGE_SUFFIX))();
ROSIDL_TYPESUPPORT_INTERFACE__MESSAGE_SYMBOL_NAME(rosidl_typesupport_introspection_c, @(', '.join([package_name] + list(interface_path.parents[0].parts))), @(service.namespaced_type.name + SERVICE_REQUEST_MESSAGE_SUFFIX))(void);

const rosidl_message_type_support_t *
ROSIDL_TYPESUPPORT_INTERFACE__MESSAGE_SYMBOL_NAME(rosidl_typesupport_introspection_c, @(', '.join([package_name] + list(interface_path.parents[0].parts))), @(service.namespaced_type.name + SERVICE_RESPONSE_MESSAGE_SUFFIX))();
ROSIDL_TYPESUPPORT_INTERFACE__MESSAGE_SYMBOL_NAME(rosidl_typesupport_introspection_c, @(', '.join([package_name] + list(interface_path.parents[0].parts))), @(service.namespaced_type.name + SERVICE_RESPONSE_MESSAGE_SUFFIX))(void);

const rosidl_message_type_support_t *
ROSIDL_TYPESUPPORT_INTERFACE__MESSAGE_SYMBOL_NAME(rosidl_typesupport_introspection_c, @(', '.join([package_name] + list(interface_path.parents[0].parts))), @(service.namespaced_type.name + SERVICE_EVENT_MESSAGE_SUFFIX))();
ROSIDL_TYPESUPPORT_INTERFACE__MESSAGE_SYMBOL_NAME(rosidl_typesupport_introspection_c, @(', '.join([package_name] + list(interface_path.parents[0].parts))), @(service.namespaced_type.name + SERVICE_EVENT_MESSAGE_SUFFIX))(void);

ROSIDL_TYPESUPPORT_INTROSPECTION_C_EXPORT_@(package_name)
const rosidl_service_type_support_t *
ROSIDL_TYPESUPPORT_INTERFACE__SERVICE_SYMBOL_NAME(rosidl_typesupport_introspection_c, @(', '.join([package_name] + list(interface_path.parents[0].parts))), @(service.namespaced_type.name))() {
ROSIDL_TYPESUPPORT_INTERFACE__SERVICE_SYMBOL_NAME(rosidl_typesupport_introspection_c, @(', '.join([package_name] + list(interface_path.parents[0].parts))), @(service.namespaced_type.name))(void) {
if (!@(function_prefix)__@(service.namespaced_type.name)_service_type_support_handle.typesupport_identifier) {
@(function_prefix)__@(service.namespaced_type.name)_service_type_support_handle.typesupport_identifier =
rosidl_typesupport_introspection_c__identifier;
Expand Down

0 comments on commit 2579950

Please sign in to comment.