bug-hurd
[Top][All Lists]
Advanced

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

[PATCH] convert K&R into ansi


From: Guy-Fleury Iteriteka
Subject: [PATCH] convert K&R into ansi
Date: Thu, 26 May 2022 18:07:41 +0200

---
 i386/i386/ast_check.c      |  6 ++----
 i386/i386/fpu.c            | 10 ++++------
 i386/i386/kttd_interface.c |  3 +--
 i386/i386/pcb.c            |  9 ++++-----
 i386/i386/trap.c           |  3 +--
 i386/i386/user_ldt.c       | 12 ++++++------
 i386/i386at/kd_event.c     |  8 ++------
 i386/i386at/kd_mouse.c     |  5 +----
 i386/i386at/kd_queue.c     | 10 +++-------
 i386/i386at/model_dep.c    |  5 +----
 i386/intel/pmap.c          | 28 ++++++++++------------------
 kern/machine.c             |  7 ++-----
 kern/profile.c             | 15 +++++----------
 13 files changed, 42 insertions(+), 79 deletions(-)

diff --git a/i386/i386/ast_check.c b/i386/i386/ast_check.c
index f3e1c35..36c665b 100644
--- a/i386/i386/ast_check.c
+++ b/i386/i386/ast_check.c
@@ -37,16 +37,14 @@
 /*
  * Initialize for remote invocation of ast_check.
  */
-void init_ast_check(processor)
-       const processor_t processor;
+void init_ast_check(const processor_t processor)
 {
 }
 
 /*
  * Cause remote invocation of ast_check.  Caller is at splsched().
  */
-void cause_ast_check(processor)
-       const processor_t processor;
+void cause_ast_check(const processor_t processor)
 {
 }
 
diff --git a/i386/i386/fpu.c b/i386/i386/fpu.c
index b47bd33..e57227d 100644
--- a/i386/i386/fpu.c
+++ b/i386/i386/fpu.c
@@ -380,9 +380,8 @@ twd_fxsr_to_i387 (struct i386_xfp_save *fxsave)
  * concurrent fpu_set_state or fpu_get_state.
  */
 kern_return_t
-fpu_set_state(thread, state)
-       const thread_t          thread;
-       struct i386_float_state *state;
+fpu_set_state(const thread_t thread,
+             struct i386_float_state *state)
 {
        pcb_t pcb = thread->pcb;
        struct i386_fpsave_state *ifps;
@@ -491,9 +490,8 @@ ASSERT_IPL(SPL0);
  * concurrent fpu_set_state or fpu_get_state.
  */
 kern_return_t
-fpu_get_state(thread, state)
-       const thread_t          thread;
-       struct i386_float_state *state;
+fpu_get_state(const thread_t thread,
+             struct i386_float_state *state)
 {
        pcb_t pcb = thread->pcb;
        struct i386_fpsave_state *ifps;
diff --git a/i386/i386/kttd_interface.c b/i386/i386/kttd_interface.c
index c6caa76..f48fe8e 100644
--- a/i386/i386/kttd_interface.c
+++ b/i386/i386/kttd_interface.c
@@ -499,8 +499,7 @@ struct int_regs {
 };
 
 void
-kttd_netentry(int_regs)
-       struct int_regs *int_regs;
+kttd_netentry(struct int_regs *int_regs)
 {
        struct i386_interrupt_state *is = int_regs->is;
        int     s;
diff --git a/i386/i386/pcb.c b/i386/i386/pcb.c
index 2358532..0324584 100644
--- a/i386/i386/pcb.c
+++ b/i386/i386/pcb.c
@@ -829,11 +829,10 @@ user_stack_low(vm_size_t stack_size)
  * Allocate argument area and set registers for first user thread.
  */
 vm_offset_t
-set_user_regs(stack_base, stack_size, exec_info, arg_size)
-       vm_offset_t     stack_base;     /* low address */
-       vm_offset_t     stack_size;
-       const struct exec_info *exec_info;
-       vm_size_t       arg_size;
+set_user_regs(vm_offset_t stack_base, /* low address */
+             vm_offset_t stack_size,
+             const struct exec_info *exec_info,
+             vm_size_t arg_size)
 {
        vm_offset_t     arg_addr;
        struct i386_saved_state *saved_state;
diff --git a/i386/i386/trap.c b/i386/i386/trap.c
index cbf4591..4f8612b 100644
--- a/i386/i386/trap.c
+++ b/i386/i386/trap.c
@@ -643,8 +643,7 @@ i386_exception(
  * return saved state for interrupted user thread
  */
 unsigned
-interrupted_pc(t)
-       const thread_t t;
+interrupted_pc(const thread_t t)
 {
        struct i386_saved_state *iss;
 
diff --git a/i386/i386/user_ldt.c b/i386/i386/user_ldt.c
index 09500b4..fdff518 100644
--- a/i386/i386/user_ldt.c
+++ b/i386/i386/user_ldt.c
@@ -253,12 +253,12 @@ i386_set_ldt(
 }
 
 kern_return_t
-i386_get_ldt(thread, first_selector, selector_count, desc_list, count)
-       const thread_t  thread;
-       int             first_selector;
-       int             selector_count;         /* number wanted */
-       struct real_descriptor **desc_list;     /* in/out */
-       unsigned int    *count;                 /* in/out */
+i386_get_ldt(const thread_t thread,
+            int first_selector,
+            int selector_count,                 /* number wanted */
+            struct real_descriptor **desc_list, /* in/out */
+            unsigned int *count                /* in/out */
+       )
 {
        struct user_ldt *user_ldt;
        pcb_t           pcb;
diff --git a/i386/i386at/kd_event.c b/i386/i386at/kd_event.c
index bed9240..518e485 100644
--- a/i386/i386at/kd_event.c
+++ b/i386/i386at/kd_event.c
@@ -110,10 +110,7 @@ kbdinit(void)
 
 /*ARGSUSED*/
 int
-kbdopen(dev, flags, ior)
-       dev_t dev;
-       int flags;
-       io_req_t ior;
+kbdopen(dev_t dev, int flags, io_req_t ior)
 {
        spl_t o_pri = spltty();
        kdinit();
@@ -308,8 +305,7 @@ u_int X_kdb_enter_str[512], X_kdb_exit_str[512];
 int   X_kdb_enter_len = 0,  X_kdb_exit_len = 0;
 
 void
-kdb_in_out(p)
-const u_int *p;
+kdb_in_out(const u_int *p)
 {
        int t = p[0];
 
diff --git a/i386/i386at/kd_mouse.c b/i386/i386at/kd_mouse.c
index 4b883ba..afef0e6 100644
--- a/i386/i386at/kd_mouse.c
+++ b/i386/i386at/kd_mouse.c
@@ -146,10 +146,7 @@ int track_man[10];
 
 /*ARGSUSED*/
 int
-mouseopen(dev, flags, ior)
-       dev_t dev;
-       int flags;
-       io_req_t ior;
+mouseopen(dev_t dev, int flags, io_req_t ior)
 {
        if (mouse_in_use)
                return (D_ALREADY_OPEN);
diff --git a/i386/i386at/kd_queue.c b/i386/i386at/kd_queue.c
index 57d6fbf..78035b1 100644
--- a/i386/i386at/kd_queue.c
+++ b/i386/i386at/kd_queue.c
@@ -71,23 +71,19 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #define q_next(index)  (((index)+1) % KDQSIZE)
 
 boolean_t
-kdq_empty(q)
-       const kd_event_queue *q;
+kdq_empty(const kd_event_queue *q)
 {
        return(q->firstfree == q->firstout);
 }
 
 boolean_t
-kdq_full(q)
-       const kd_event_queue *q;
+kdq_full(const kd_event_queue *q)
 {
        return(q_next(q->firstfree) == q->firstout);
 }
 
 void
-kdq_put(q, ev)
-       kd_event_queue *q;
-       kd_event *ev;
+kdq_put(kd_event_queue *q, kd_event *ev)
 {
        kd_event *qp = q->events + q->firstfree;
 
diff --git a/i386/i386at/model_dep.c b/i386/i386at/model_dep.c
index 21a36bf..e3a56db 100644
--- a/i386/i386at/model_dep.c
+++ b/i386/i386at/model_dep.c
@@ -677,10 +677,7 @@ void c_boot_entry(vm_offset_t bi)
 #include <mach/time_value.h>
 
 vm_offset_t
-timemmap(dev, off, prot)
-       dev_t dev;
-       vm_offset_t off;
-       vm_prot_t prot;
+timemmap(dev_t dev, vm_offset_t off, vm_prot_t prot)
 {
        extern time_value_t *mtime;
 
diff --git a/i386/intel/pmap.c b/i386/intel/pmap.c
index d57040c..5302b09 100644
--- a/i386/intel/pmap.c
+++ b/i386/intel/pmap.c
@@ -2347,12 +2347,12 @@ phys_addr_t pmap_extract(
  *     This routine is only advisory and need not do anything.
  */
 #if    0
-void pmap_copy(dst_pmap, src_pmap, dst_addr, len, src_addr)
-       pmap_t          dst_pmap;
-       pmap_t          src_pmap;
-       vm_offset_t     dst_addr;
-       vm_size_t       len;
-       vm_offset_t     src_addr;
+void pmap_copy(
+       pmap_t          dst_pmap,
+       pmap_t          src_pmap,
+       vm_offset_t     dst_addr,
+       vm_size_t       len,
+       vm_offset_t     src_addr)
 {
 }
 #endif /* 0 */
@@ -2500,10 +2500,7 @@ void pmap_collect(pmap_t p)
  *             processor, and returns a hardware map description.
  */
 #if    0
-void pmap_activate(my_pmap, th, my_cpu)
-       pmap_t  my_pmap;
-       thread_t        th;
-       int             my_cpu;
+void pmap_activate(pmap_t my_pmap, thread_t th, int my_cpu)
 {
        PMAP_ACTIVATE(my_pmap, th, my_cpu);
 }
@@ -2517,10 +2514,7 @@ void pmap_activate(my_pmap, th, my_cpu)
  *             in pmap.h)
  */
 #if    0
-void pmap_deactivate(pmap, th, which_cpu)
-       pmap_t          pmap;
-       thread_t        th;
-       int             which_cpu;
+void pmap_deactivate(pmap_t pmap, thread_t th, int which_cpu)
 {
        PMAP_DEACTIVATE(pmap, th, which_cpu);
 }
@@ -2543,8 +2537,7 @@ pmap_t pmap_kernel()
  *     See machine/phys.c or machine/phys.s for implementation.
  */
 #if    0
-pmap_zero_page(phys)
-       vm_offset_t     phys;
+pmap_zero_page(vm_offset_t phys)
 {
        int     i;
 
@@ -2562,8 +2555,7 @@ pmap_zero_page(phys)
  *     See machine/phys.c or machine/phys.s for implementation.
  */
 #if    0
-pmap_copy_page(src, dst)
-       vm_offset_t     src, dst;
+pmap_copy_page(vm_offset_t src, vm_offset_t dst)
 {
        int     i;
 
diff --git a/kern/machine.c b/kern/machine.c
index 2fe30ce..0e1781c 100644
--- a/kern/machine.c
+++ b/kern/machine.c
@@ -125,9 +125,7 @@ void cpu_down(int cpu)
 }
 
 kern_return_t
-host_reboot(host, options)
-       const host_t    host;
-       int             options;
+host_reboot(const host_t host, int options)
 {
        if (host == HOST_NULL)
                return (KERN_INVALID_HOST);
@@ -623,8 +621,7 @@ Restart_pset:
  *     running on the processor's shutdown stack.
  */
 
-void processor_doshutdown(processor)
-processor_t    processor;
+void processor_doshutdown(processor_t processor)
 {
        int             cpu = processor->slot_num;
 
diff --git a/kern/profile.c b/kern/profile.c
index b33d695..4fcd541 100644
--- a/kern/profile.c
+++ b/kern/profile.c
@@ -180,8 +180,7 @@ printf("profile_thread: mach_msg failed returned 
%x\n",(int)mr);
 #include <mach/message.h>
 
 void
-send_last_sample_buf(th)
-thread_t th;
+send_last_sample_buf(thread_t th)
 {
         spl_t s;
         buf_to_send_t buf_entry;
@@ -290,10 +289,9 @@ profile(pc) {
    MiG, even though it is not used in the function itself. */
 
 kern_return_t
-mach_sample_thread (task, reply, cur_thread)
-ipc_space_t    task;
-ipc_object_t   reply;
-thread_t       cur_thread;
+mach_sample_thread (ipc_space_t task,
+                   ipc_object_t reply,
+                   thread_t cur_thread)
 {
 /*
  * This routine is called every time that a new thread has made
@@ -349,10 +347,7 @@ printf("ERROR:mach_sample_thread:cannot set pbuf_nb\n");
 }
 
 kern_return_t
-mach_sample_task (task, reply, cur_task)
-ipc_space_t    task;
-ipc_object_t   reply;
-task_t         cur_task;
+mach_sample_task (ipc_space_t task, ipc_object_t reply, task_t cur_task)
 {
        prof_data_t     pbuf=cur_task->profil_buffer;
        vm_offset_t     vmpbuf;
-- 
2.30.2




reply via email to

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