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

@ -116,7 +116,7 @@ extern "C" {
*
* All interrupts handlers should be of this type, and follow normal ARM EABI register saving conventions
*/
typedef void (*irq_handler_t)();
typedef void (*irq_handler_t)(void);
/*! \brief Set specified interrupts priority
* \ingroup hardware_irq
@ -255,7 +255,7 @@ void irq_set_pending(uint num);
*
* \note This is an internal method and user should generally not call it.
*/
void irq_init_priorities();
void irq_init_priorities(void);
#ifdef __cplusplus
}
#endif

View File

@ -12,10 +12,10 @@
#include "pico/mutex.h"
#include "pico/assert.h"
extern void __unhandled_user_irq();
extern uint __get_current_exception();
extern void __unhandled_user_irq(void);
extern uint __get_current_exception(void);
static inline irq_handler_t *get_vtable() {
static inline irq_handler_t *get_vtable(void) {
return (irq_handler_t *) scb_hw->vtor;
}
@ -69,8 +69,8 @@ void irq_set_pending(uint num) {
static_assert(PICO_MAX_SHARED_IRQ_HANDLERS >= 1 && PICO_MAX_SHARED_IRQ_HANDLERS < 0x7f, "");
// note these are not real functions, they are code fragments (i.e. don't call them)
extern void irq_handler_chain_first_slot();
extern void irq_handler_chain_remove_tail();
extern void irq_handler_chain_first_slot(void);
extern void irq_handler_chain_remove_tail(void);
extern struct irq_handler_chain_slot {
// first 3 half words are executable code (raw vtable handler points to one slot, and inst3 will jump to next