diff options
author | Flavio Cruz <flaviocruz@gmail.com> | 2022-12-20 20:01:02 -0500 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-12-21 12:55:46 +0100 |
commit | 448889a4f0c32ba8ea61f870d4edcb0e0d58af85 (patch) | |
tree | cad56c7263667bb09096cc05c707130d3809544a /kern | |
parent | 28ac48ba2371ad6f76f263e56dcf0090fe0d6087 (diff) | |
download | gnumach-448889a4f0c32ba8ea61f870d4edcb0e0d58af85.tar.gz gnumach-448889a4f0c32ba8ea61f870d4edcb0e0d58af85.tar.bz2 gnumach-448889a4f0c32ba8ea61f870d4edcb0e0d58af85.zip |
Use -Wstrict-prototypes and fix warnings
Most of the changes include defining and using proper function type
declarations (with argument types declared) and avoiding using the
K&R style of function declarations.
Message-Id: <Y6Jazsuis1QA0lXI@mars>
Diffstat (limited to 'kern')
-rw-r--r-- | kern/exception.c | 5 | ||||
-rw-r--r-- | kern/ipc_mig.c | 5 | ||||
-rw-r--r-- | kern/syscall_sw.h | 8 |
3 files changed, 8 insertions, 10 deletions
diff --git a/kern/exception.c b/kern/exception.c index 2ff122f2..0d8191a7 100644 --- a/kern/exception.c +++ b/kern/exception.c @@ -449,9 +449,8 @@ exception_raise( receiver = ipc_thread_queue_first(&dest_mqueue->imq_threads); if ((receiver == ITH_NULL) || - !((receiver->swap_func == (void (*)()) mach_msg_continue) || - ((receiver->swap_func == - (void (*)()) mach_msg_receive_continue) && + !((receiver->swap_func == mach_msg_continue) || + ((receiver->swap_func == mach_msg_receive_continue) && (sizeof(struct mach_exception) <= receiver->ith_msize) && ((receiver->ith_option & MACH_RCV_NOTIFY) == 0))) || !thread_handoff(self, exception_raise_continue, receiver)) { diff --git a/kern/ipc_mig.c b/kern/ipc_mig.c index 7ed12faa..f353009e 100644 --- a/kern/ipc_mig.c +++ b/kern/ipc_mig.c @@ -285,10 +285,7 @@ mig_put_reply_port( * len - Length of destination buffer. */ vm_size_t -mig_strncpy(dest, src, len) - char *dest; - const char *src; - int len; +mig_strncpy(char *dest, const char *src, int len) { char *dest_ = dest; int i; diff --git a/kern/syscall_sw.h b/kern/syscall_sw.h index 80b1810b..34eaf90b 100644 --- a/kern/syscall_sw.h +++ b/kern/syscall_sw.h @@ -35,9 +35,11 @@ * Note: this is indexed manually by locore.S! */ +typedef void (*generic_trap_function)(void); + typedef struct { int mach_trap_arg_count; - int (*mach_trap_function)(); + generic_trap_function mach_trap_function; boolean_t mach_trap_stack; const char *mach_trap_name; } mach_trap_t; @@ -46,8 +48,8 @@ extern mach_trap_t mach_trap_table[]; extern int mach_trap_count; #define MACH_TRAP(name, arg_count) \ - { (arg_count), (int (*)()) (name), FALSE, #name } + { (arg_count), (generic_trap_function) (name), FALSE, #name } #define MACH_TRAP_STACK(name, arg_count) \ - { (arg_count), (int (*)()) (name), TRUE, #name } + { (arg_count), (generic_trap_function) (name), TRUE, #name } #endif /* _KERN_SYSCALL_SW_H_ */ |