bug-hurd
[Top][All Lists]
Advanced

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

[PATCH gnumach 03/16] Cast function timeout() argument to fix a warning


From: Guillem Jover
Subject: [PATCH gnumach 03/16] Cast function timeout() argument to fix a warning
Date: Tue, 30 Aug 2011 03:09:29 +0200

* kern/mach_clock.h (timer_func_t): New function type.
(struct timer_elt): Change fcn type to timer_func_t.
* i386/i386at/com.c (comstart): Cast `ttrstrt' to `timer_funct_t *' in
`timeout' call.
* i386/i386at/lpr.c (lprstart): Likewise,
---
 i386/i386at/com.c |    2 +-
 i386/i386at/lpr.c |    2 +-
 kern/mach_clock.h |    8 +++++---
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/i386/i386at/com.c b/i386/i386at/com.c
index 90cfbb6..54df78d 100644
--- a/i386/i386at/com.c
+++ b/i386/i386at/com.c
@@ -661,7 +661,7 @@ comst_4++;
 #else
        nch = getc(&tp->t_outq);
        if ((nch & 0200) && ((tp->t_flags & LITOUT) == 0)) {
-           timeout(ttrstrt, (char *)tp, (nch & 0x7f) + 6);
+           timeout((timer_func_t *)ttrstrt, (char *)tp, (nch & 0x7f) + 6);
            tp->t_state |= TS_TIMEOUT;
 comst_4++;
            return;
diff --git a/i386/i386at/lpr.c b/i386/i386at/lpr.c
index 57f6f85..8d077d5 100644
--- a/i386/i386at/lpr.c
+++ b/i386/i386at/lpr.c
@@ -338,7 +338,7 @@ struct tty *tp;
 #ifdef MACH_KERNEL
        nch = getc(&tp->t_outq);
        if ((tp->t_flags & LITOUT) == 0 && (nch & 0200)) {
-               timeout(ttrstrt, (char *)tp, (nch & 0x7f) + 6);
+               timeout((timer_func_t *)ttrstrt, (char *)tp, (nch & 0x7f) + 6);
                tp->t_state |= TS_TIMEOUT;
                return;
        }
diff --git a/kern/mach_clock.h b/kern/mach_clock.h
index 2009c70..8131019 100644
--- a/kern/mach_clock.h
+++ b/kern/mach_clock.h
@@ -37,10 +37,12 @@ extern int          hz;             /* number of ticks per 
second */
 extern int             tick;           /* number of usec per tick */
 
 
+typedef void timer_func_t(void *);
+
 /* Time-out element.  */
 struct timer_elt {
        queue_chain_t   chain;          /* chain in order of expiration */
-       void            (*fcn)();       /* function to call */
+       timer_func_t    *fcn;           /* function to call */
        void *          param;          /* with this parameter */
        unsigned long   ticks;          /* expiration time, in ticks */
        int             set;            /* unset | set | allocated */
@@ -99,7 +101,7 @@ extern kern_return_t host_adjust_time(
 extern void mapable_time_init (void);
 
 /* For public timer elements.  */
-extern void timeout(void (*fcn)(void *), void *param, int interval);
-extern boolean_t untimeout(void (*fcn)(void *), void *param);
+extern void timeout(timer_func_t *fcn, void *param, int interval);
+extern boolean_t untimeout(timer_func_t *fcn, void *param);
 
 #endif /* _KERN_MACH_CLOCK_H_ */
-- 
1.7.5.4




reply via email to

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