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

@ -59,6 +59,7 @@ target_compile_options(kitchen_sink_options INTERFACE
-Wfloat-equal
-Wmissing-format-attribute
-Wno-long-long
$<$<COMPILE_LANGUAGE:C>:-Wstrict-prototypes>
# todo not sure these are true, but investigate
#-Wpacked

View File

@ -39,7 +39,7 @@ uint32_t *foo = (uint32_t *) 200;
uint32_t dma_to = 0;
uint32_t dma_from = 0xaaaa5555;
void spiggle() {
void spiggle(void) {
dma_channel_config c = dma_channel_get_default_config(1);
channel_config_set_bswap(&c, true);
channel_config_set_transfer_data_size(&c, DMA_SIZE_16);
@ -48,7 +48,7 @@ void spiggle() {
dma_channel_transfer_from_buffer_now(1, foo, 23);
}
void __isr dma_handler_a() {
void __isr dma_handler_a(void) {
printf("HELLO A\n");
if (dma_hw->ints1 & 1) {
dma_hw->ints1 = 1;
@ -57,7 +57,7 @@ void __isr dma_handler_a() {
}
}
void __isr dma_handler_b() {
void __isr dma_handler_b(void) {
printf("HELLO B\n");
if (dma_hw->ints1 & 1) {
dma_hw->ints1 = 1;
@ -68,7 +68,7 @@ void __isr dma_handler_b() {
//#pragma GCC pop_options
int main() {
int main(void) {
spiggle();
stdio_init_all();