Skip to content

Commit

Permalink
Fixed warnings - strict-prototypes (#1148)
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 authored Apr 23, 2024
1 parent 7bafab5 commit 7af6d3a
Show file tree
Hide file tree
Showing 25 changed files with 36 additions and 38 deletions.
2 changes: 1 addition & 1 deletion rcl/include/rcl/lexer_lookahead.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ typedef struct rcl_lexer_lookahead2_s
RCL_PUBLIC
RCL_WARN_UNUSED
rcl_lexer_lookahead2_t
rcl_get_zero_initialized_lexer_lookahead2();
rcl_get_zero_initialized_lexer_lookahead2(void);

/// Initialize an rcl_lexer_lookahead2_t instance.
/**
Expand Down
2 changes: 1 addition & 1 deletion rcl/include/rcl/log_level.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ typedef struct rcl_log_levels_s
RCL_PUBLIC
RCL_WARN_UNUSED
rcl_log_levels_t
rcl_get_zero_initialized_log_levels();
rcl_get_zero_initialized_log_levels(void);

/// Initialize a log levels structure.
/**
Expand Down
2 changes: 1 addition & 1 deletion rcl/include/rcl/logging_rosout.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ rcl_logging_rosout_init(
RCL_PUBLIC
RCL_WARN_UNUSED
rcl_ret_t
rcl_logging_rosout_fini();
rcl_logging_rosout_fini(void);

/// Creates a rosout publisher for a node and registers it to be used by the logging system
/**
Expand Down
4 changes: 2 additions & 2 deletions rcl/src/rcl/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ struct rcl_client_impl_s
};

rcl_client_t
rcl_get_zero_initialized_client()
rcl_get_zero_initialized_client(void)
{
static rcl_client_t null_client = {0};
return null_client;
Expand Down Expand Up @@ -276,7 +276,7 @@ rcl_client_fini(rcl_client_t * client, rcl_node_t * node)
}

rcl_client_options_t
rcl_client_get_default_options()
rcl_client_get_default_options(void)
{
// !!! MAKE SURE THAT CHANGES TO THESE DEFAULTS ARE REFLECTED IN THE HEADER DOC STRING
static rcl_client_options_t default_options;
Expand Down
2 changes: 1 addition & 1 deletion rcl/src/rcl/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ extern "C"
#include "./subscription_impl.h"

rcl_event_t
rcl_get_zero_initialized_event()
rcl_get_zero_initialized_event(void)
{
static rcl_event_t null_event = {0};
return null_event;
Expand Down
4 changes: 2 additions & 2 deletions rcl/src/rcl/guard_condition.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct rcl_guard_condition_impl_s
};

rcl_guard_condition_t
rcl_get_zero_initialized_guard_condition()
rcl_get_zero_initialized_guard_condition(void)
{
static rcl_guard_condition_t null_guard_condition = {
.context = 0,
Expand Down Expand Up @@ -141,7 +141,7 @@ rcl_guard_condition_fini(rcl_guard_condition_t * guard_condition)
}

rcl_guard_condition_options_t
rcl_guard_condition_get_default_options()
rcl_guard_condition_get_default_options(void)
{
// !!! MAKE SURE THAT CHANGES TO THESE DEFAULTS ARE REFLECTED IN THE HEADER DOC STRING
static rcl_guard_condition_options_t default_options;
Expand Down
2 changes: 1 addition & 1 deletion rcl/src/rcl/lexer_lookahead.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct rcl_lexer_lookahead2_impl_s
};

rcl_lexer_lookahead2_t
rcl_get_zero_initialized_lexer_lookahead2()
rcl_get_zero_initialized_lexer_lookahead2(void)
{
static rcl_lexer_lookahead2_t zero_initialized = {
.impl = NULL,
Expand Down
2 changes: 1 addition & 1 deletion rcl/src/rcl/log_level.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "rcutils/strdup.h"

rcl_log_levels_t
rcl_get_zero_initialized_log_levels()
rcl_get_zero_initialized_log_levels(void)
{
const rcl_log_levels_t log_levels = {
.default_logger_level = RCUTILS_LOG_SEVERITY_UNSET,
Expand Down
2 changes: 1 addition & 1 deletion rcl/src/rcl/logging_rosout.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ _rcl_logging_rosout_clear_hashmap(
return status;
}

rcl_ret_t rcl_logging_rosout_fini()
rcl_ret_t rcl_logging_rosout_fini(void)
{
if (!__is_initialized) {
return RCL_RET_OK;
Expand Down
2 changes: 1 addition & 1 deletion rcl/src/rcl/node.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const char * rcl_create_node_logger_name(
}

rcl_node_t
rcl_get_zero_initialized_node()
rcl_get_zero_initialized_node(void)
{
static rcl_node_t null_node = {
.context = 0,
Expand Down
2 changes: 1 addition & 1 deletion rcl/src/rcl/node_options.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extern "C"
#include "rcl/logging_rosout.h"

rcl_node_options_t
rcl_node_get_default_options()
rcl_node_get_default_options(void)
{
// !!! MAKE SURE THAT CHANGES TO THESE DEFAULTS ARE REFLECTED IN THE HEADER DOC STRING
rcl_node_options_t default_options = {
Expand Down
4 changes: 2 additions & 2 deletions rcl/src/rcl/publisher.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ extern "C"
#include "./publisher_impl.h"

rcl_publisher_t
rcl_get_zero_initialized_publisher()
rcl_get_zero_initialized_publisher(void)
{
static rcl_publisher_t null_publisher = {0};
return null_publisher;
Expand Down Expand Up @@ -216,7 +216,7 @@ rcl_publisher_fini(rcl_publisher_t * publisher, rcl_node_t * node)
}

rcl_publisher_options_t
rcl_publisher_get_default_options()
rcl_publisher_get_default_options(void)
{
// !!! MAKE SURE THAT CHANGES TO THESE DEFAULTS ARE REFLECTED IN THE HEADER DOC STRING
static rcl_publisher_options_t default_options;
Expand Down
4 changes: 2 additions & 2 deletions rcl/src/rcl/service.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct rcl_service_impl_s
};

rcl_service_t
rcl_get_zero_initialized_service()
rcl_get_zero_initialized_service(void)
{
static rcl_service_t null_service = {0};
return null_service;
Expand Down Expand Up @@ -282,7 +282,7 @@ rcl_service_fini(rcl_service_t * service, rcl_node_t * node)
}

rcl_service_options_t
rcl_service_get_default_options()
rcl_service_get_default_options(void)
{
// !!! MAKE SURE THAT CHANGES TO THESE DEFAULTS ARE REFLECTED IN THE HEADER DOC STRING
static rcl_service_options_t default_options;
Expand Down
2 changes: 1 addition & 1 deletion rcl/src/rcl/service_event_publisher.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "rmw/error_handling.h"
#include "service_msgs/msg/service_event_info.h"

rcl_service_event_publisher_t rcl_get_zero_initialized_service_event_publisher()
rcl_service_event_publisher_t rcl_get_zero_initialized_service_event_publisher(void)
{
static rcl_service_event_publisher_t zero_service_event_publisher = {0};
return zero_service_event_publisher;
Expand Down
2 changes: 1 addition & 1 deletion rcl/src/rcl/service_event_publisher.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ typedef struct rcl_service_event_publisher_s
RCL_PUBLIC
RCL_WARN_UNUSED
rcl_service_event_publisher_t
rcl_get_zero_initialized_service_event_publisher();
rcl_get_zero_initialized_service_event_publisher(void);

/// Initialize a service event publisher.
/**
Expand Down
6 changes: 3 additions & 3 deletions rcl/src/rcl/subscription.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ extern "C"


rcl_subscription_t
rcl_get_zero_initialized_subscription()
rcl_get_zero_initialized_subscription(void)
{
static rcl_subscription_t null_subscription = {0};
return null_subscription;
Expand Down Expand Up @@ -224,7 +224,7 @@ rcl_subscription_fini(rcl_subscription_t * subscription, rcl_node_t * node)
}

rcl_subscription_options_t
rcl_subscription_get_default_options()
rcl_subscription_get_default_options(void)
{
// !!! MAKE SURE THAT CHANGES TO THESE DEFAULTS ARE REFLECTED IN THE HEADER DOC STRING
static rcl_subscription_options_t default_options;
Expand Down Expand Up @@ -382,7 +382,7 @@ rcl_subscription_options_set_content_filter_options(
}

rcl_subscription_content_filter_options_t
rcl_get_zero_initialized_subscription_content_filter_options()
rcl_get_zero_initialized_subscription_content_filter_options(void)
{
return (const rcl_subscription_content_filter_options_t) {
.rmw_subscription_content_filter_options =
Expand Down
2 changes: 1 addition & 1 deletion rcl/src/rcl/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ struct rcl_timer_impl_s
};

rcl_timer_t
rcl_get_zero_initialized_timer()
rcl_get_zero_initialized_timer(void)
{
static rcl_timer_t null_timer = {0};
return null_timer;
Expand Down
2 changes: 1 addition & 1 deletion rcl/src/rcl/wait.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ struct rcl_wait_set_impl_s
};

rcl_wait_set_t
rcl_get_zero_initialized_wait_set()
rcl_get_zero_initialized_wait_set(void)
{
static rcl_wait_set_t null_wait_set = {
.subscriptions = NULL,
Expand Down
2 changes: 0 additions & 2 deletions rcl/test/rcl/test_wait.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -654,9 +654,7 @@ TEST_F(WaitSetTestFixture, multi_wait_set_threaded) {
return false;
};
// *INDENT-ON*
size_t loop_count = 0;
while (loop_test()) {
loop_count++;
for (auto & test_set : test_sets) {
ret = rcl_trigger_guard_condition(&test_set.guard_condition);
ASSERT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str;
Expand Down
8 changes: 4 additions & 4 deletions rcl_lifecycle/include/rcl_lifecycle/rcl_lifecycle.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ extern "C"
*/
RCL_LIFECYCLE_PUBLIC
rcl_lifecycle_state_t
rcl_lifecycle_get_zero_initialized_state();
rcl_lifecycle_get_zero_initialized_state(void);

/// Initialize a rcl_lifecycle_state_init.
/**
Expand Down Expand Up @@ -123,7 +123,7 @@ rcl_lifecycle_state_fini(
*/
RCL_LIFECYCLE_PUBLIC
rcl_lifecycle_transition_t
rcl_lifecycle_get_zero_initialized_transition();
rcl_lifecycle_get_zero_initialized_transition(void);

/// Initialize a transition from a start state to the goal state.
/**
Expand Down Expand Up @@ -197,7 +197,7 @@ rcl_lifecycle_transition_fini(
/// Return a default initialized state machine options struct.
RCL_LIFECYCLE_PUBLIC
rcl_lifecycle_state_machine_options_t
rcl_lifecycle_get_default_state_machine_options();
rcl_lifecycle_get_default_state_machine_options(void);

/// Return a rcl_lifecycle_state_machine_t struct with members set to `NULL` or 0.
/**
Expand All @@ -206,7 +206,7 @@ rcl_lifecycle_get_default_state_machine_options();
*/
RCL_LIFECYCLE_PUBLIC
rcl_lifecycle_state_machine_t
rcl_lifecycle_get_zero_initialized_state_machine();
rcl_lifecycle_get_zero_initialized_state_machine(void);

/// Initialize state machine
/**
Expand Down
2 changes: 1 addition & 1 deletion rcl_lifecycle/include/rcl_lifecycle/transition_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ extern "C"
RCL_LIFECYCLE_PUBLIC
RCL_WARN_UNUSED
rcl_lifecycle_transition_map_t
rcl_lifecycle_get_zero_initialized_transition_map();
rcl_lifecycle_get_zero_initialized_transition_map(void);

/// Check if a transition map is active using a rcl_lifecycle_state_machine_t.
/*
Expand Down
2 changes: 1 addition & 1 deletion rcl_lifecycle/src/com_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ static const char * srv_get_available_transitions_service = "~/get_available_tra
static const char * srv_get_transition_graph = "~/get_transition_graph";

rcl_lifecycle_com_interface_t
rcl_lifecycle_get_zero_initialized_com_interface()
rcl_lifecycle_get_zero_initialized_com_interface(void)
{
rcl_lifecycle_com_interface_t com_interface;
com_interface.node_handle = NULL;
Expand Down
2 changes: 1 addition & 1 deletion rcl_lifecycle/src/com_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ extern "C"
#include "rcl_lifecycle/data_types.h"

rcl_lifecycle_com_interface_t
rcl_lifecycle_get_zero_initialized_com_interface();
rcl_lifecycle_get_zero_initialized_com_interface(void);

rcl_ret_t
RCL_WARN_UNUSED
Expand Down
8 changes: 4 additions & 4 deletions rcl_lifecycle/src/rcl_lifecycle.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ extern "C"
#include "./com_interface.h"

rcl_lifecycle_state_t
rcl_lifecycle_get_zero_initialized_state()
rcl_lifecycle_get_zero_initialized_state(void)
{
rcl_lifecycle_state_t state;
state.id = 0;
Expand Down Expand Up @@ -94,7 +94,7 @@ rcl_lifecycle_state_fini(
}

rcl_lifecycle_transition_t
rcl_lifecycle_get_zero_initialized_transition()
rcl_lifecycle_get_zero_initialized_transition(void)
{
rcl_lifecycle_transition_t transition;
transition.id = 0;
Expand Down Expand Up @@ -168,7 +168,7 @@ rcl_lifecycle_transition_fini(
}

rcl_lifecycle_state_machine_options_t
rcl_lifecycle_get_default_state_machine_options()
rcl_lifecycle_get_default_state_machine_options(void)
{
rcl_lifecycle_state_machine_options_t options;
options.enable_com_interface = true;
Expand All @@ -180,7 +180,7 @@ rcl_lifecycle_get_default_state_machine_options()

// get zero initialized state machine here
rcl_lifecycle_state_machine_t
rcl_lifecycle_get_zero_initialized_state_machine()
rcl_lifecycle_get_zero_initialized_state_machine(void)
{
rcl_lifecycle_state_machine_t state_machine;
state_machine.current_state = NULL;
Expand Down
2 changes: 1 addition & 1 deletion rcl_lifecycle/src/transition_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ extern "C"
#include "rcl_lifecycle/transition_map.h"

rcl_lifecycle_transition_map_t
rcl_lifecycle_get_zero_initialized_transition_map()
rcl_lifecycle_get_zero_initialized_transition_map(void)
{
static rcl_lifecycle_transition_map_t transition_map;
transition_map.states = NULL;
Expand Down

0 comments on commit 7af6d3a

Please sign in to comment.