Skip to content

Commit

Permalink
Removed warnings - strict-prototypes (#461)
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 1a40a5a commit 3da73bc
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions include/rcutils/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ typedef void (* rcutils_logging_output_handler_t)(
*/
RCUTILS_PUBLIC
RCUTILS_WARN_UNUSED
rcutils_logging_output_handler_t rcutils_logging_get_output_handler();
rcutils_logging_output_handler_t rcutils_logging_get_output_handler(void);

/// Set the current output handler.
/**
Expand Down Expand Up @@ -297,7 +297,7 @@ rcutils_ret_t rcutils_logging_format_message(
*/
RCUTILS_PUBLIC
RCUTILS_WARN_UNUSED
int rcutils_logging_get_default_logger_level();
int rcutils_logging_get_default_logger_level(void);

/// Set the default severity level for loggers.
/**
Expand Down
2 changes: 1 addition & 1 deletion include/rcutils/types/hash_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ rcutils_hash_map_string_cmp_func(const void * val1, const void * val2);
RCUTILS_PUBLIC
RCUTILS_WARN_UNUSED
rcutils_hash_map_t
rcutils_get_zero_initialized_hash_map();
rcutils_get_zero_initialized_hash_map(void);

/// Initialize a rcutils_hash_map_t, allocating space for given capacity.
/**
Expand Down
2 changes: 1 addition & 1 deletion include/rcutils/types/string_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ typedef struct RCUTILS_PUBLIC_TYPE rcutils_string_map_s
RCUTILS_PUBLIC
RCUTILS_WARN_UNUSED
rcutils_string_map_t
rcutils_get_zero_initialized_string_map();
rcutils_get_zero_initialized_string_map(void);

/// Initialize a rcutils_string_map_t, allocating space for given capacity.
/**
Expand Down
2 changes: 1 addition & 1 deletion resource/logging_macros.h.em
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ extern "C"
/**
* \return true to log the message, false to ignore the message
*/
typedef bool (* RclLogFilter)();
typedef bool (* RclLogFilter)(void);
/**
* \def RCUTILS_LOG_CONDITION_FUNCTION_BEFORE
* A macro checking the `function` condition.
Expand Down
2 changes: 1 addition & 1 deletion src/allocator.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ rcutils_get_zero_initialized_allocator(void)
}

rcutils_allocator_t
rcutils_get_default_allocator()
rcutils_get_default_allocator(void)
{
static rcutils_allocator_t default_allocator = {
.allocate = __default_allocate,
Expand Down
2 changes: 1 addition & 1 deletion src/hash_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ int rcutils_hash_map_string_cmp_func(const void * val1, const void * val2)
}

rcutils_hash_map_t
rcutils_get_zero_initialized_hash_map()
rcutils_get_zero_initialized_hash_map(void)
{
static rcutils_hash_map_t zero_initialized_hash_map = {NULL};
return zero_initialized_hash_map;
Expand Down
6 changes: 3 additions & 3 deletions src/testing/fault_injection.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ void rcutils_fault_injection_set_count(int_least64_t count)
rcutils_atomic_store(&g_rcutils_fault_injection_count, count);
}

int_least64_t rcutils_fault_injection_get_count()
int_least64_t rcutils_fault_injection_get_count(void)
{
int_least64_t count = 0;
rcutils_atomic_load(&g_rcutils_fault_injection_count, count);
return count;
}

bool rcutils_fault_injection_is_test_complete()
bool rcutils_fault_injection_is_test_complete(void)
{
#ifndef RCUTILS_ENABLE_FAULT_INJECTION
return true;
Expand All @@ -39,7 +39,7 @@ bool rcutils_fault_injection_is_test_complete()
#endif // RCUTILS_ENABLE_FAULT_INJECTION
}

int_least64_t _rcutils_fault_injection_maybe_fail()
int_least64_t _rcutils_fault_injection_maybe_fail(void)
{
bool set_atomic_success = false;
int_least64_t current_count = rcutils_fault_injection_get_count();
Expand Down
2 changes: 1 addition & 1 deletion test/dummy_shared_library/dummy_shared_library.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include "./dummy_shared_library.h" // NOLINT

void print_name()
void print_name(void)
{
printf("print_name\n");
}
2 changes: 1 addition & 1 deletion test/dummy_shared_library/dummy_shared_library.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
#include <stdio.h>

DUMMY_SHARED_LIBRARY_PUBLIC
void print_name();
void print_name(void);

#endif // DUMMY_SHARED_LIBRARY__DUMMY_SHARED_LIBRARY_H_
4 changes: 3 additions & 1 deletion test/test_atomics.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@
} while (0)

int
main()
main(int argc, char * argv[])
{
(void)argc;
(void)argv;
TEST_ATOMIC_TYPE(_Bool, atomic_bool);
TEST_ATOMIC_TYPE(char, atomic_char);
TEST_ATOMIC_TYPE(signed char, atomic_schar);
Expand Down

0 comments on commit 3da73bc

Please sign in to comment.