summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2009-10-20 21:46:20 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2009-10-20 21:57:40 +0200
commitea2b5b8f72c56bde682593e783552eb13b7412ad (patch)
tree587ff9c60c12bf3fec26de39fb018afbd1d498fb
parenta6f1c3969da8040f1f7306308d0154858276cc51 (diff)
Fix warnings
* device/chario.c (ttypush): Set parameter type to void * instead of struct tty *, and implicitly cast the former into the latter instead. * i386/i386at/com.c: Include <kern/mach_clock.h>. (timeout, ttrstrt): Remove declarations. (comtimer): Add unused void * parameter. (comopen): Pass NULL to comtimer function. * i386/i386at/kd.h (kd_belloff): Add unused void * parameter. * i386/i386at/kd.c (timeout): Remove declaration. (kd_belloff): Add unused void * parameter. (feep, kdsetbell): Pass NULL to kd_belloff function. * i386/i386at/lpr.c: Include <mach_clock.h>. (timeout, ttrstrt): Remove declarations. * kern/mach_clock.c (softclock, timeout, untimeout): Set parameter type of fcn function pointer to void * instead of char *. Set type of param to void * instead of char *. * kern/mach_clock.h (timer_elt): Set parameter type of fcn member to void * instead of char *. Set time of param member to void * instead of char *. (timeout): Set parameter type of fcn function pointer parameter to void * instead of char *. (untimeout): Likewise, set type of param parameter to void * instead of char *. * kern/sched_prim.c (sched_init): Remove cast of recompute_priorities. Replace (char *)0 with NULL. (thread_timeout): Set parameter type to void * instead of thread_t, and implicitly cast the former into the latter instead. (thread_timeout_setup): Remove cast of thread_timeout, cast thread_depress_timeout into (void (*) (void*)). Remove cast of thread. (thread_recompute_priorities): Add unused void * parameter.
-rw-r--r--device/chario.c3
-rw-r--r--i386/i386at/com.c7
-rw-r--r--i386/i386at/kd.c8
-rw-r--r--i386/i386at/kd.h2
-rw-r--r--i386/i386at/lpr.c3
-rw-r--r--kern/mach_clock.c10
-rw-r--r--kern/mach_clock.h8
-rw-r--r--kern/sched_prim.c17
8 files changed, 28 insertions, 30 deletions
diff --git a/device/chario.c b/device/chario.c
index 9e2dbad..d7c092e 100644
--- a/device/chario.c
+++ b/device/chario.c
@@ -895,8 +895,9 @@ void tty_output(
* Send any buffered recvd chars up to user
*/
void ttypush(
- register struct tty *tp)
+ void * _tp)
{
+ register struct tty *tp = _tp;
spl_t s = spltty();
register int state;
diff --git a/i386/i386at/com.c b/i386/i386at/com.c
index 51f3ff1..bd5b989 100644
--- a/i386/i386at/com.c
+++ b/i386/i386at/com.c
@@ -29,6 +29,7 @@
#include <mach/std_types.h>
#include <sys/types.h>
#include <kern/printf.h>
+#include <kern/mach_clock.h>
#include <sys/time.h>
#include <device/conf.h>
#include <device/errno.h>
@@ -45,8 +46,6 @@
#include <device/cons.h>
-extern void timeout(), ttrstrt();
-
int comprobe(), comstart(), commctl();
void comstop(), comattach(), comintr();
static void comparam();
@@ -383,7 +382,7 @@ io_return_t comopen(
if (!comtimer_active) {
comtimer_active = TRUE;
- comtimer();
+ comtimer(NULL);
}
s = spltty();
@@ -664,7 +663,7 @@ comst_4++;
int comtimer_interval = 5;
void
-comtimer()
+comtimer(void * param)
{
spl_t s = spltty();
struct tty *tp = com_tty;
diff --git a/i386/i386at/kd.c b/i386/i386at/kd.c
index a0a36b7..6209031 100644
--- a/i386/i386at/kd.c
+++ b/i386/i386at/kd.c
@@ -102,8 +102,6 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
void kd_enqsc(); /* enqueues a scancode */
-void timeout();
-
#if 0
#define BROKEN_KEYBOARD_RESET
#endif
@@ -380,7 +378,7 @@ feep()
kd_bellon();
for (i = 0; i < 50000; ++i)
;
- kd_belloff();
+ kd_belloff(NULL);
}
void
@@ -671,7 +669,7 @@ int flags; /* flags set for console */
if (val == KD_BELLON)
kd_bellon();
else if (val == KD_BELLOFF)
- kd_belloff();
+ kd_belloff(NULL);
else
err = D_INVALID_OPERATION;
@@ -1232,7 +1230,7 @@ kdinit()
static unsigned int kd_bellstate = 0;
void
-kd_belloff()
+kd_belloff(void * param)
{
unsigned char status;
diff --git a/i386/i386at/kd.h b/i386/i386at/kd.h
index e12f039..a6036d7 100644
--- a/i386/i386at/kd.h
+++ b/i386/i386at/kd.h
@@ -720,7 +720,7 @@ extern void kd_delln (int);
extern void kd_delch (int);
extern void kd_erase (int);
extern void kd_bellon (void);
-extern void kd_belloff (void);
+extern void kd_belloff (void *param);
extern void kdinit (void);
extern int kdsetkbent (struct kbentry *, int);
extern int kdgetkbent (struct kbentry *);
diff --git a/i386/i386at/lpr.c b/i386/i386at/lpr.c
index 07e8414..d4f82b1 100644
--- a/i386/i386at/lpr.c
+++ b/i386/i386at/lpr.c
@@ -34,6 +34,7 @@
#include <mach/std_types.h>
#include <sys/types.h>
#include <kern/printf.h>
+#include <kern/mach_clock.h>
#include <sys/time.h>
#include <device/conf.h>
#include <device/errno.h>
@@ -58,8 +59,6 @@
#include <i386at/autoconf.h>
#include <i386at/lprreg.h>
-extern void timeout();
-extern void ttrstrt();
/*
* Driver information for auto-configuration stuff.
diff --git a/kern/mach_clock.c b/kern/mach_clock.c
index 2c7969e..04a3115 100644
--- a/kern/mach_clock.c
+++ b/kern/mach_clock.c
@@ -278,8 +278,8 @@ void softclock()
*/
spl_t s;
register timer_elt_t telt;
- register int (*fcn)();
- register char *param;
+ register void (*fcn)( void * param );
+ register void *param;
while (TRUE) {
s = splsched();
@@ -528,7 +528,7 @@ timer_elt_data_t timeout_timers[NTIMERS];
* interval: timeout interval, in hz.
*/
void timeout(fcn, param, interval)
- int (*fcn)( void * param );
+ void (*fcn)( void * param );
void * param;
int interval;
{
@@ -556,8 +556,8 @@ void timeout(fcn, param, interval)
* and removed.
*/
boolean_t untimeout(fcn, param)
- register int (*fcn)();
- register char * param;
+ register void (*fcn)( void * param );
+ register void * param;
{
spl_t s;
register timer_elt_t elt;
diff --git a/kern/mach_clock.h b/kern/mach_clock.h
index 4e8b83e..2009c70 100644
--- a/kern/mach_clock.h
+++ b/kern/mach_clock.h
@@ -40,8 +40,8 @@ extern int tick; /* number of usec per tick */
/* Time-out element. */
struct timer_elt {
queue_chain_t chain; /* chain in order of expiration */
- int (*fcn)(); /* function to call */
- char * param; /* with this parameter */
+ void (*fcn)(); /* function to call */
+ void * param; /* with this parameter */
unsigned long ticks; /* expiration time, in ticks */
int set; /* unset | set | allocated */
};
@@ -99,7 +99,7 @@ extern kern_return_t host_adjust_time(
extern void mapable_time_init (void);
/* For public timer elements. */
-extern void timeout(int (*fcn)(void *), void *param, int interval);
-extern boolean_t untimeout(int (*fcn)(), char *param);
+extern void timeout(void (*fcn)(void *), void *param, int interval);
+extern boolean_t untimeout(void (*fcn)(void *), void *param);
#endif /* _KERN_MACH_CLOCK_H_ */
diff --git a/kern/sched_prim.c b/kern/sched_prim.c
index a3bcbf8..ff942ae 100644
--- a/kern/sched_prim.c
+++ b/kern/sched_prim.c
@@ -160,8 +160,8 @@ void wait_queue_init(void)
void sched_init(void)
{
- recompute_priorities_timer.fcn = (int (*)())recompute_priorities;
- recompute_priorities_timer.param = (char *)0;
+ recompute_priorities_timer.fcn = recompute_priorities;
+ recompute_priorities_timer.param = NULL;
min_quantum = hz / 10; /* context switch 10 times/second */
wait_queue_init();
@@ -180,8 +180,9 @@ void sched_init(void)
* Called at splsoftclock.
*/
void thread_timeout(
- thread_t thread)
+ void *_thread)
{
+ thread_t thread = _thread;
assert(thread->timer.set == TELT_UNSET);
clear_wait(thread, THREAD_TIMED_OUT, FALSE);
@@ -216,10 +217,10 @@ void thread_set_timeout(
void thread_timeout_setup(
register thread_t thread)
{
- thread->timer.fcn = (int (*)())thread_timeout;
- thread->timer.param = (char *)thread;
- thread->depress_timer.fcn = (int (*)())thread_depress_timeout;
- thread->depress_timer.param = (char *)thread;
+ thread->timer.fcn = thread_timeout;
+ thread->timer.param = thread;
+ thread->depress_timer.fcn = (void (*)(void*))thread_depress_timeout;
+ thread->depress_timer.param = thread;
}
/*
@@ -1094,7 +1095,7 @@ void compute_my_priority(
*
* Update the priorities of all threads periodically.
*/
-void recompute_priorities(void)
+void recompute_priorities(void *param)
{
#if SIMPLE_CLOCK
int new_usec;