Clean up various C source and headers to appease -Wstrict-prototypes

In C, func() is a function taking an unspecified number of arguments,
vs func(void) a function taking no arguments. In C++ both forms indicate
"no arguments."

Update these headers to use the (void) form, which is correct in both
languages and avoids complaints when -Wstrict-prototypes is specified.
This commit is contained in:
Brian Swetland
2021-02-07 14:04:25 -08:00
committed by graham sanderson
parent 93c600736e
commit a362925eda
34 changed files with 105 additions and 104 deletions

View File

@ -87,13 +87,13 @@ void runtime_init(void) {
// Start and end points of the constructor list,
// defined by the linker script.
extern void (*__preinit_array_start)();
extern void (*__preinit_array_end)();
extern void (*__preinit_array_start)(void);
extern void (*__preinit_array_end)(void);
// Call each function in the list.
// We have to take the address of the symbols, as __preinit_array_start *is*
// the first function pointer, not the address of it.
for (void (**p)() = &__preinit_array_start; p < &__preinit_array_end; ++p) {
for (void (**p)(void) = &__preinit_array_start; p < &__preinit_array_end; ++p) {
(*p)();
}
@ -144,13 +144,13 @@ void runtime_init(void) {
// Start and end points of the constructor list,
// defined by the linker script.
extern void (*__init_array_start)();
extern void (*__init_array_end)();
extern void (*__init_array_start)(void);
extern void (*__init_array_end)(void);
// Call each function in the list.
// We have to take the address of the symbols, as __init_array_start *is*
// the first function pointer, not the address of it.
for (void (**p)() = &__init_array_start; p < &__init_array_end; ++p) {
for (void (**p)(void) = &__init_array_start; p < &__init_array_end; ++p) {
(*p)();
}