bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Remove existing old style definitions and use -Wold-style-defini


From: Flavio Cruz
Subject: [PATCH] Remove existing old style definitions and use -Wold-style-definition.
Date: Thu, 19 Jan 2023 14:22:31 -0500

---
 Makefile.am              |  2 +-
 ddb/db_cond.c            |  3 +--
 ddb/db_expr.c            |  5 +----
 device/cons.c            |  3 +--
 device/dev_lookup.c      |  3 +--
 device/dev_name.c        |  7 +++----
 device/net_io.c          | 32 ++++++++++++++------------------
 i386/i386/pcb.c          |  3 +--
 i386/i386at/kd.c         | 22 ++++++----------------
 ipc/ipc_port.c           |  3 +--
 kern/debug.c             |  6 ++----
 kern/ipc_kobject.c       | 13 ++++---------
 kern/ipc_mig.c           |  7 +++----
 kern/syscall_emulation.c |  3 +--
 vm/memory_object.c       |  3 +--
 vm/vm_external.c         |  5 ++---
 vm/vm_map.c              |  3 +--
 vm/vm_resident.c         |  3 +--
 18 files changed, 45 insertions(+), 81 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 54fcf685..c52241e9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -61,7 +61,7 @@ AM_CCASFLAGS += \
 # Yes, this makes the eyes hurt.  But perhaps someone will finally take care of
 # all that scruffy Mach code...  Also see <http://savannah.gnu.org/task/?5726>.
 AM_CFLAGS += \
-       -Wall -Wstrict-prototypes
+       -Wall -Wstrict-prototypes -Wold-style-definition
 
 # We need the GNU-style inline
 AM_CFLAGS += \
diff --git a/ddb/db_cond.c b/ddb/db_cond.c
index 28b414e7..d45d9b8a 100644
--- a/ddb/db_cond.c
+++ b/ddb/db_cond.c
@@ -102,8 +102,7 @@ db_cond_check(db_thread_breakpoint_t bkpt)
 }
 
 void
-db_cond_print(bkpt)
-       const db_thread_breakpoint_t bkpt;
+db_cond_print(const db_thread_breakpoint_t bkpt)
 {
        char *p, *ep;
        struct db_cond *cp;
diff --git a/ddb/db_expr.c b/ddb/db_expr.c
index 9e20a840..90edb6fb 100644
--- a/ddb/db_expr.c
+++ b/ddb/db_expr.c
@@ -92,10 +92,7 @@ db_term(db_expr_t *valuep)
 }
 
 int
-db_size_option(modif, u_option, t_option)
-       const char *modif;
-       boolean_t *u_option;
-       boolean_t *t_option;
+db_size_option(const char *modif, boolean_t *u_option, boolean_t *t_option)
 {
        const char      *p;
        int             size = sizeof(int);
diff --git a/device/cons.c b/device/cons.c
index b04621ae..3f7cb9d1 100644
--- a/device/cons.c
+++ b/device/cons.c
@@ -140,8 +140,7 @@ cnmaygetc(void)
 }
 
 void
-cnputc(c)
-       char c;
+cnputc(char c)
 {
        if (c == 0)
                return;
diff --git a/device/dev_lookup.c b/device/dev_lookup.c
index febaebdd..fe6310ce 100644
--- a/device/dev_lookup.c
+++ b/device/dev_lookup.c
@@ -295,8 +295,7 @@ dev_port_lookup(ipc_port_t port)
  * Consumes a device reference; produces a naked send right.
  */
 ipc_port_t
-convert_device_to_port(device)
-       const device_t  device;
+convert_device_to_port(const device_t  device)
 {
        if (device == DEVICE_NULL)
            return IP_NULL;
diff --git a/device/dev_name.c b/device/dev_name.c
index 4595d31c..99c502db 100644
--- a/device/dev_name.c
+++ b/device/dev_name.c
@@ -103,10 +103,9 @@ nomap(dev_t dev, vm_offset_t off, int prot)
  *   next character of target is 0 (end of string).
  */
 boolean_t __attribute__ ((pure))
-name_equal(src, len, target)
-       const char      *src;
-       int             len;
-       const char      *target;
+name_equal(const char  *src,
+       int             len,
+       const char      *target)
 {
        while (--len >= 0)
            if (*src++ != *target++)
diff --git a/device/net_io.c b/device/net_io.c
index 4392f711..d1cd5a67 100644
--- a/device/net_io.c
+++ b/device/net_io.c
@@ -368,8 +368,7 @@ decl_simple_lock_data(,net_hash_header_lock)
  *     Returns TRUE for high-priority packets.
  */
 
-boolean_t ethernet_priority(kmsg)
-       const ipc_kmsg_t kmsg;
+boolean_t ethernet_priority(const ipc_kmsg_t kmsg)
 {
        unsigned char *addr =
                (unsigned char *) net_kmsg(kmsg)->header;
@@ -690,9 +689,8 @@ int net_filter_queue_reorder = 0; /* non-zero to enable 
reordering */
  * We are *not* called at interrupt level.
  */
 void
-net_filter(kmsg, send_list)
-       const ipc_kmsg_t        kmsg;
-       ipc_kmsg_queue_t        send_list;
+net_filter(const ipc_kmsg_t    kmsg,
+       ipc_kmsg_queue_t        send_list)
 {
        struct ifnet            *ifp;
        net_rcv_port_t          infp, nextfp;
@@ -871,11 +869,10 @@ net_filter(kmsg, send_list)
 }
 
 boolean_t
-net_do_filter(infp, data, data_count, header)
-       net_rcv_port_t  infp;
-       const char *    data;
-       unsigned int    data_count;
-       const char *    header;
+net_do_filter(net_rcv_port_t   infp,
+       const char *    data,
+       unsigned int    data_count,
+       const char *    header)
 {
        int             stack[NET_FILTER_STACK_DEPTH+1];
        int             *sp;
@@ -1983,9 +1980,8 @@ bpf_eq(
 }
 
 unsigned int
-bpf_hash (n, keys)
-       int n;
-       const unsigned int *keys;
+bpf_hash (int n,
+       const unsigned int *keys)
 {
        unsigned int hval = 0;
        
@@ -1997,11 +1993,11 @@ bpf_hash (n, keys)
 
 
 int
-bpf_match (hash, n_keys, keys, hash_headpp, entpp)
-       net_hash_header_t hash;
-       int n_keys;
-       const unsigned int *keys;
-       net_hash_entry_t **hash_headpp, *entpp;
+bpf_match (net_hash_header_t hash,
+       int n_keys,
+       const unsigned int *keys,
+       net_hash_entry_t        **hash_headpp,
+       net_hash_entry_t        *entpp)
 {
        net_hash_entry_t head, entp;
        int i;
diff --git a/i386/i386/pcb.c b/i386/i386/pcb.c
index ef300537..9ac55a1c 100644
--- a/i386/i386/pcb.c
+++ b/i386/i386/pcb.c
@@ -447,8 +447,7 @@ void pcb_terminate(thread_t thread)
  *     Attempt to free excess pcb memory.
  */
 
-void pcb_collect(thread)
-       const thread_t thread;
+void pcb_collect(__attribute__((unused)) const thread_t thread)
 {
 }
 
diff --git a/i386/i386at/kd.c b/i386/i386at/kd.c
index 70737479..9abc1dd0 100644
--- a/i386/i386at/kd.c
+++ b/i386/i386at/kd.c
@@ -480,9 +480,7 @@ kdopen(
  */
 /*ARGSUSED*/
 void
-kdclose(dev, flag)
-dev_t  dev;
-int    flag;
+kdclose(dev_t dev, int flag)
 {
        struct  tty     *tp;
 
@@ -512,9 +510,7 @@ int flag;
  */
 /*ARGSUSED*/
 int
-kdread(dev, uio)
-dev_t  dev;
-io_req_t uio;
+kdread(dev_t dev, io_req_t uio)
 {
        struct  tty     *tp;
 
@@ -537,9 +533,7 @@ io_req_t uio;
  */
 /*ARGSUSED*/
 int
-kdwrite(dev, uio)
-dev_t  dev;
-io_req_t uio;
+kdwrite(dev_t dev, io_req_t uio)
 {
        return((*linesw[kd_tty.t_line].l_write)(&kd_tty, uio));
 }
@@ -550,10 +544,7 @@ io_req_t uio;
 
 /*ARGSUSED*/
 vm_offset_t
-kdmmap(dev, off, prot)
-       dev_t dev;
-       vm_offset_t off;
-       vm_prot_t prot;
+kdmmap(dev_t dev, vm_offset_t off, vm_prot_t prot)
 {
        if (off >= (128*1024))
                return(-1);
@@ -1019,9 +1010,8 @@ kdcheckmagic(Scancode scancode)
  *     corresponds to the given state.
  */
 unsigned int
-kdstate2idx(state, extended)
-unsigned int   state;                  /* bit vector, not a state index */
-boolean_t      extended;
+kdstate2idx(unsigned int       state,                  /* bit vector, not a 
state index */
+       boolean_t       extended)
 {
        int state_idx = NORM_STATE;
 
diff --git a/ipc/ipc_port.c b/ipc/ipc_port.c
index f9ccc290..d71edfaf 100644
--- a/ipc/ipc_port.c
+++ b/ipc/ipc_port.c
@@ -1249,8 +1249,7 @@ ipc_port_dealloc_special(
  */
 
 void
-ipc_port_print(port)
-       const ipc_port_t port;
+ipc_port_print(const ipc_port_t port)
 {
        printf("port 0x%x\n", port);
 
diff --git a/kern/debug.c b/kern/debug.c
index 3b472ff2..44814925 100644
--- a/kern/debug.c
+++ b/kern/debug.c
@@ -66,8 +66,7 @@ Assert(const char *exp, const char *file, int line, const 
char *fun)
        Debugger("assertion failure");
 }
 
-void SoftDebugger(message)
-       const char *message;
+void SoftDebugger(const char *message)
 {
        printf("Debugger invoked: %s\n", message);
 
@@ -98,8 +97,7 @@ void SoftDebugger(message)
 #endif
 }
 
-void Debugger(message)
-       const char *message;
+void Debugger(const char *message)
 {
 #if    !MACH_KDB
        panic("Debugger invoked, but there isn't one!");
diff --git a/kern/ipc_kobject.c b/kern/ipc_kobject.c
index cb6fe592..a0feaf40 100644
--- a/kern/ipc_kobject.c
+++ b/kern/ipc_kobject.c
@@ -78,8 +78,7 @@
  */
 
 ipc_kmsg_t
-ipc_kobject_server(request)
-       ipc_kmsg_t request;
+ipc_kobject_server(ipc_kmsg_t request)
 {
        mach_msg_size_t reply_size = ikm_less_overhead(8192);
        ipc_kmsg_t reply;
@@ -286,10 +285,7 @@ ipc_kobject_server(request)
  */
 
 void
-ipc_kobject_set(port, kobject, type)
-       ipc_port_t port;
-       ipc_kobject_t kobject;
-       ipc_kobject_type_t type;
+ipc_kobject_set(ipc_port_t port, ipc_kobject_t kobject, ipc_kobject_type_t 
type)
 {
        ip_lock(port);
        assert(ip_active(port));
@@ -341,9 +337,8 @@ ipc_kobject_destroy(
  */
 
 boolean_t
-ipc_kobject_notify(request_header, reply_header)
-       mach_msg_header_t *request_header;
-       mach_msg_header_t *reply_header;
+ipc_kobject_notify(mach_msg_header_t *request_header,
+       mach_msg_header_t *reply_header)
 {
        ipc_port_t port = (ipc_port_t) request_header->msgh_remote_port;
 
diff --git a/kern/ipc_mig.c b/kern/ipc_mig.c
index ec121cf4..cb0b2c83 100644
--- a/kern/ipc_mig.c
+++ b/kern/ipc_mig.c
@@ -92,10 +92,9 @@ mach_msg_send_from_kernel(
 }
 
 mach_msg_return_t
-mach_msg_rpc_from_kernel(msg, send_size, reply_size)
-       const mach_msg_header_t *msg;
-       mach_msg_size_t send_size;
-       mach_msg_size_t reply_size;
+mach_msg_rpc_from_kernel(const mach_msg_header_t *msg,
+       mach_msg_size_t send_size,
+       mach_msg_size_t reply_size)
 {
        panic("mach_msg_rpc_from_kernel"); /*XXX*/
 }
diff --git a/kern/syscall_emulation.c b/kern/syscall_emulation.c
index 50db1949..620c2351 100644
--- a/kern/syscall_emulation.c
+++ b/kern/syscall_emulation.c
@@ -95,8 +95,7 @@ void eml_task_reference(
  *     Cleans up after the emulation code when a process exits.
  */
  
-void eml_task_deallocate(task)
-       const task_t task;
+void eml_task_deallocate(const task_t task)
 {
        eml_dispatch_t  eml;
 
diff --git a/vm/memory_object.c b/vm/memory_object.c
index 413795b7..41bbf49e 100644
--- a/vm/memory_object.c
+++ b/vm/memory_object.c
@@ -1060,8 +1060,7 @@ ipc_port_t        memory_manager_default_reference(void)
  *             know when it should keep memory wired.
  */
 
-boolean_t      memory_manager_default_port(port)
-       const ipc_port_t port;
+boolean_t      memory_manager_default_port(const ipc_port_t port)
 {
        ipc_port_t current;
        boolean_t result;
diff --git a/vm/vm_external.c b/vm/vm_external.c
index 3b1a2879..99f4b9c3 100644
--- a/vm/vm_external.c
+++ b/vm/vm_external.c
@@ -96,9 +96,8 @@ void          vm_external_destroy(vm_external_t e)
        kmem_cache_free(&vm_external_cache, (vm_offset_t) e);
 }
 
-vm_external_state_t _vm_external_state_get(e, offset)
-       const vm_external_t     e;
-       vm_offset_t             offset;
+vm_external_state_t _vm_external_state_get(const vm_external_t e,
+       vm_offset_t             offset)
 {
        unsigned
        int             bit, byte;
diff --git a/vm/vm_map.c b/vm/vm_map.c
index cabf47f8..bea84a4d 100644
--- a/vm/vm_map.c
+++ b/vm/vm_map.c
@@ -5000,8 +5000,7 @@ void vm_map_print(db_expr_t addr, boolean_t have_addr, 
db_expr_t count, const ch
  *             Pretty-print a copy object for ddb.
  */
 
-void vm_map_copy_print(copy)
-       const vm_map_copy_t copy;
+void vm_map_copy_print(const vm_map_copy_t copy)
 {
        int i, npages;
 
diff --git a/vm/vm_resident.c b/vm/vm_resident.c
index 13709a90..aefdb1f9 100644
--- a/vm/vm_resident.c
+++ b/vm/vm_resident.c
@@ -1074,8 +1074,7 @@ vm_page_info(
 /*
  *     Routine:        vm_page_print [exported]
  */
-void           vm_page_print(p)
-       const vm_page_t p;
+void           vm_page_print(const vm_page_t   p)
 {
        iprintf("Page 0x%X: object 0x%X,", (vm_offset_t) p, (vm_offset_t) 
p->object);
         printf(" offset 0x%X", p->offset);
-- 
2.39.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]