Skip to content

Commit 3da73bc

Browse files
authored
Removed warnings - strict-prototypes (#461)
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
1 parent 1a40a5a commit 3da73bc

File tree

10 files changed

+15
-13
lines changed

10 files changed

+15
-13
lines changed

include/rcutils/logging.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ typedef void (* rcutils_logging_output_handler_t)(
237237
*/
238238
RCUTILS_PUBLIC
239239
RCUTILS_WARN_UNUSED
240-
rcutils_logging_output_handler_t rcutils_logging_get_output_handler();
240+
rcutils_logging_output_handler_t rcutils_logging_get_output_handler(void);
241241

242242
/// Set the current output handler.
243243
/**
@@ -297,7 +297,7 @@ rcutils_ret_t rcutils_logging_format_message(
297297
*/
298298
RCUTILS_PUBLIC
299299
RCUTILS_WARN_UNUSED
300-
int rcutils_logging_get_default_logger_level();
300+
int rcutils_logging_get_default_logger_level(void);
301301

302302
/// Set the default severity level for loggers.
303303
/**

include/rcutils/types/hash_map.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ rcutils_hash_map_string_cmp_func(const void * val1, const void * val2);
119119
RCUTILS_PUBLIC
120120
RCUTILS_WARN_UNUSED
121121
rcutils_hash_map_t
122-
rcutils_get_zero_initialized_hash_map();
122+
rcutils_get_zero_initialized_hash_map(void);
123123

124124
/// Initialize a rcutils_hash_map_t, allocating space for given capacity.
125125
/**

include/rcutils/types/string_map.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ typedef struct RCUTILS_PUBLIC_TYPE rcutils_string_map_s
5757
RCUTILS_PUBLIC
5858
RCUTILS_WARN_UNUSED
5959
rcutils_string_map_t
60-
rcutils_get_zero_initialized_string_map();
60+
rcutils_get_zero_initialized_string_map(void);
6161

6262
/// Initialize a rcutils_string_map_t, allocating space for given capacity.
6363
/**

resource/logging_macros.h.em

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ extern "C"
138138
/**
139139
* \return true to log the message, false to ignore the message
140140
*/
141-
typedef bool (* RclLogFilter)();
141+
typedef bool (* RclLogFilter)(void);
142142
/**
143143
* \def RCUTILS_LOG_CONDITION_FUNCTION_BEFORE
144144
* A macro checking the `function` condition.

src/allocator.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ rcutils_get_zero_initialized_allocator(void)
7676
}
7777

7878
rcutils_allocator_t
79-
rcutils_get_default_allocator()
79+
rcutils_get_default_allocator(void)
8080
{
8181
static rcutils_allocator_t default_allocator = {
8282
.allocate = __default_allocate,

src/hash_map.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ int rcutils_hash_map_string_cmp_func(const void * val1, const void * val2)
7575
}
7676

7777
rcutils_hash_map_t
78-
rcutils_get_zero_initialized_hash_map()
78+
rcutils_get_zero_initialized_hash_map(void)
7979
{
8080
static rcutils_hash_map_t zero_initialized_hash_map = {NULL};
8181
return zero_initialized_hash_map;

src/testing/fault_injection.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ void rcutils_fault_injection_set_count(int_least64_t count)
2323
rcutils_atomic_store(&g_rcutils_fault_injection_count, count);
2424
}
2525

26-
int_least64_t rcutils_fault_injection_get_count()
26+
int_least64_t rcutils_fault_injection_get_count(void)
2727
{
2828
int_least64_t count = 0;
2929
rcutils_atomic_load(&g_rcutils_fault_injection_count, count);
3030
return count;
3131
}
3232

33-
bool rcutils_fault_injection_is_test_complete()
33+
bool rcutils_fault_injection_is_test_complete(void)
3434
{
3535
#ifndef RCUTILS_ENABLE_FAULT_INJECTION
3636
return true;
@@ -39,7 +39,7 @@ bool rcutils_fault_injection_is_test_complete()
3939
#endif // RCUTILS_ENABLE_FAULT_INJECTION
4040
}
4141

42-
int_least64_t _rcutils_fault_injection_maybe_fail()
42+
int_least64_t _rcutils_fault_injection_maybe_fail(void)
4343
{
4444
bool set_atomic_success = false;
4545
int_least64_t current_count = rcutils_fault_injection_get_count();

test/dummy_shared_library/dummy_shared_library.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

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

17-
void print_name()
17+
void print_name(void)
1818
{
1919
printf("print_name\n");
2020
}

test/dummy_shared_library/dummy_shared_library.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@
2828
#include <stdio.h>
2929

3030
DUMMY_SHARED_LIBRARY_PUBLIC
31-
void print_name();
31+
void print_name(void);
3232

3333
#endif // DUMMY_SHARED_LIBRARY__DUMMY_SHARED_LIBRARY_H_

test/test_atomics.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@
4242
} while (0)
4343

4444
int
45-
main()
45+
main(int argc, char * argv[])
4646
{
47+
(void)argc;
48+
(void)argv;
4749
TEST_ATOMIC_TYPE(_Bool, atomic_bool);
4850
TEST_ATOMIC_TYPE(char, atomic_char);
4951
TEST_ATOMIC_TYPE(signed char, atomic_schar);

0 commit comments

Comments
 (0)