From 50ad68763dd701fa1346c597c6f697707af4f75b Mon Sep 17 00:00:00 2001 From: bde Date: Sun, 20 Apr 1997 16:05:33 +0000 Subject: [PATCH] Fixed the type of timeout functions and removed casts that hid the type mismatches. Not taking an arg in scrn_timer() broke `cc -mrtd'. --- sys/dev/syscons/syscons.c | 22 ++++++++++++---------- sys/i386/isa/syscons.c | 22 ++++++++++++---------- sys/isa/syscons.c | 22 ++++++++++++---------- 3 files changed, 36 insertions(+), 30 deletions(-) diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index c4f1cd96b961..35110c6bfc2a 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: syscons.c,v 1.208 1997/04/03 21:42:42 brian Exp $ + * $Id: syscons.c,v 1.209 1997/04/10 12:26:50 yokota Exp $ */ #include "sc.h" @@ -183,7 +183,7 @@ static scr_stat *get_scr_stat(dev_t dev); static scr_stat *alloc_scp(void); static void init_scp(scr_stat *scp); static int get_scr_num(void); -static void scrn_timer(void); +static timeout_t scrn_timer; static void clear_screen(scr_stat *scp); static int switch_scr(scr_stat *scp, u_int next_scr); static void exchange_scr(void); @@ -213,7 +213,7 @@ static void draw_cutmarking(scr_stat *scp); static void remove_cutmarking(scr_stat *scp); static void save_palette(void); static void do_bell(scr_stat *scp, int pitch, int duration); -static void blink_screen(scr_stat *scp); +static timeout_t blink_screen; #ifdef SC_SPLASH_SCREEN static void toggle_splash_screen(scr_stat *scp); #endif @@ -485,7 +485,7 @@ scattach(struct isa_device *dev) } /* get screen update going */ - scrn_timer(); + scrn_timer(NULL); update_leds(scp->status); @@ -1524,7 +1524,7 @@ get_scr_num() } static void -scrn_timer() +scrn_timer(void *arg) { scr_stat *scp = cur_console; int s = spltty(); @@ -1554,7 +1554,7 @@ scrn_timer() /* should we just return ? */ if ((scp->status&UNKNOWN_MODE) || blink_in_progress || switch_in_progress) { - timeout((timeout_func_t)scrn_timer, 0, hz/10); + timeout(scrn_timer, NULL, hz / 10); splx(s); return; } @@ -1622,7 +1622,7 @@ scrn_timer() } if (scrn_blank_time && (time.tv_sec > scrn_time_stamp+scrn_blank_time)) (*current_saver)(TRUE); - timeout((timeout_func_t)scrn_timer, 0, hz/25); + timeout(scrn_timer, NULL, hz / 25); splx(s); } @@ -3768,7 +3768,7 @@ do_bell(scr_stat *scp, int pitch, int duration) if (scp != cur_console) blink_in_progress += 2; blink_screen(cur_console); - timeout((timeout_func_t)blink_screen, cur_console, hz/10); + timeout(blink_screen, cur_console, hz / 10); } else { if (scp != cur_console) pitch *= 2; @@ -3777,8 +3777,10 @@ do_bell(scr_stat *scp, int pitch, int duration) } static void -blink_screen(scr_stat *scp) +blink_screen(void *arg) { + scr_stat *scp = arg; + if (blink_in_progress > 1) { if (blink_in_progress & 1) fillw(kernel_default.std_color | scr_map[0x20], @@ -3787,7 +3789,7 @@ blink_screen(scr_stat *scp) fillw(kernel_default.rev_color | scr_map[0x20], Crtat, scp->xsize * scp->ysize); blink_in_progress--; - timeout((timeout_func_t)blink_screen, scp, hz/10); + timeout(blink_screen, scp, hz / 10); } else { blink_in_progress = FALSE; diff --git a/sys/i386/isa/syscons.c b/sys/i386/isa/syscons.c index c4f1cd96b961..35110c6bfc2a 100644 --- a/sys/i386/isa/syscons.c +++ b/sys/i386/isa/syscons.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: syscons.c,v 1.208 1997/04/03 21:42:42 brian Exp $ + * $Id: syscons.c,v 1.209 1997/04/10 12:26:50 yokota Exp $ */ #include "sc.h" @@ -183,7 +183,7 @@ static scr_stat *get_scr_stat(dev_t dev); static scr_stat *alloc_scp(void); static void init_scp(scr_stat *scp); static int get_scr_num(void); -static void scrn_timer(void); +static timeout_t scrn_timer; static void clear_screen(scr_stat *scp); static int switch_scr(scr_stat *scp, u_int next_scr); static void exchange_scr(void); @@ -213,7 +213,7 @@ static void draw_cutmarking(scr_stat *scp); static void remove_cutmarking(scr_stat *scp); static void save_palette(void); static void do_bell(scr_stat *scp, int pitch, int duration); -static void blink_screen(scr_stat *scp); +static timeout_t blink_screen; #ifdef SC_SPLASH_SCREEN static void toggle_splash_screen(scr_stat *scp); #endif @@ -485,7 +485,7 @@ scattach(struct isa_device *dev) } /* get screen update going */ - scrn_timer(); + scrn_timer(NULL); update_leds(scp->status); @@ -1524,7 +1524,7 @@ get_scr_num() } static void -scrn_timer() +scrn_timer(void *arg) { scr_stat *scp = cur_console; int s = spltty(); @@ -1554,7 +1554,7 @@ scrn_timer() /* should we just return ? */ if ((scp->status&UNKNOWN_MODE) || blink_in_progress || switch_in_progress) { - timeout((timeout_func_t)scrn_timer, 0, hz/10); + timeout(scrn_timer, NULL, hz / 10); splx(s); return; } @@ -1622,7 +1622,7 @@ scrn_timer() } if (scrn_blank_time && (time.tv_sec > scrn_time_stamp+scrn_blank_time)) (*current_saver)(TRUE); - timeout((timeout_func_t)scrn_timer, 0, hz/25); + timeout(scrn_timer, NULL, hz / 25); splx(s); } @@ -3768,7 +3768,7 @@ do_bell(scr_stat *scp, int pitch, int duration) if (scp != cur_console) blink_in_progress += 2; blink_screen(cur_console); - timeout((timeout_func_t)blink_screen, cur_console, hz/10); + timeout(blink_screen, cur_console, hz / 10); } else { if (scp != cur_console) pitch *= 2; @@ -3777,8 +3777,10 @@ do_bell(scr_stat *scp, int pitch, int duration) } static void -blink_screen(scr_stat *scp) +blink_screen(void *arg) { + scr_stat *scp = arg; + if (blink_in_progress > 1) { if (blink_in_progress & 1) fillw(kernel_default.std_color | scr_map[0x20], @@ -3787,7 +3789,7 @@ blink_screen(scr_stat *scp) fillw(kernel_default.rev_color | scr_map[0x20], Crtat, scp->xsize * scp->ysize); blink_in_progress--; - timeout((timeout_func_t)blink_screen, scp, hz/10); + timeout(blink_screen, scp, hz / 10); } else { blink_in_progress = FALSE; diff --git a/sys/isa/syscons.c b/sys/isa/syscons.c index c4f1cd96b961..35110c6bfc2a 100644 --- a/sys/isa/syscons.c +++ b/sys/isa/syscons.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: syscons.c,v 1.208 1997/04/03 21:42:42 brian Exp $ + * $Id: syscons.c,v 1.209 1997/04/10 12:26:50 yokota Exp $ */ #include "sc.h" @@ -183,7 +183,7 @@ static scr_stat *get_scr_stat(dev_t dev); static scr_stat *alloc_scp(void); static void init_scp(scr_stat *scp); static int get_scr_num(void); -static void scrn_timer(void); +static timeout_t scrn_timer; static void clear_screen(scr_stat *scp); static int switch_scr(scr_stat *scp, u_int next_scr); static void exchange_scr(void); @@ -213,7 +213,7 @@ static void draw_cutmarking(scr_stat *scp); static void remove_cutmarking(scr_stat *scp); static void save_palette(void); static void do_bell(scr_stat *scp, int pitch, int duration); -static void blink_screen(scr_stat *scp); +static timeout_t blink_screen; #ifdef SC_SPLASH_SCREEN static void toggle_splash_screen(scr_stat *scp); #endif @@ -485,7 +485,7 @@ scattach(struct isa_device *dev) } /* get screen update going */ - scrn_timer(); + scrn_timer(NULL); update_leds(scp->status); @@ -1524,7 +1524,7 @@ get_scr_num() } static void -scrn_timer() +scrn_timer(void *arg) { scr_stat *scp = cur_console; int s = spltty(); @@ -1554,7 +1554,7 @@ scrn_timer() /* should we just return ? */ if ((scp->status&UNKNOWN_MODE) || blink_in_progress || switch_in_progress) { - timeout((timeout_func_t)scrn_timer, 0, hz/10); + timeout(scrn_timer, NULL, hz / 10); splx(s); return; } @@ -1622,7 +1622,7 @@ scrn_timer() } if (scrn_blank_time && (time.tv_sec > scrn_time_stamp+scrn_blank_time)) (*current_saver)(TRUE); - timeout((timeout_func_t)scrn_timer, 0, hz/25); + timeout(scrn_timer, NULL, hz / 25); splx(s); } @@ -3768,7 +3768,7 @@ do_bell(scr_stat *scp, int pitch, int duration) if (scp != cur_console) blink_in_progress += 2; blink_screen(cur_console); - timeout((timeout_func_t)blink_screen, cur_console, hz/10); + timeout(blink_screen, cur_console, hz / 10); } else { if (scp != cur_console) pitch *= 2; @@ -3777,8 +3777,10 @@ do_bell(scr_stat *scp, int pitch, int duration) } static void -blink_screen(scr_stat *scp) +blink_screen(void *arg) { + scr_stat *scp = arg; + if (blink_in_progress > 1) { if (blink_in_progress & 1) fillw(kernel_default.std_color | scr_map[0x20], @@ -3787,7 +3789,7 @@ blink_screen(scr_stat *scp) fillw(kernel_default.rev_color | scr_map[0x20], Crtat, scp->xsize * scp->ysize); blink_in_progress--; - timeout((timeout_func_t)blink_screen, scp, hz/10); + timeout(blink_screen, scp, hz / 10); } else { blink_in_progress = FALSE;