summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>1999-11-20 18:52:01 +0000
committerMarc Espie <espie@cvs.openbsd.org>1999-11-20 18:52:01 +0000
commit5514cce54eeb6b5b2fc4bc8ec005b474e563c9e2 (patch)
tree5116bee8052fbccf26146a95d6ddcdae6ba752ff /sys/arch/i386
parent1c4a3676fce5aeb3e26ee82bb20b040dbda864d6 (diff)
ioctl arguments are u_long.
Replaces `undefined' code with `defined' behavior... gcc 2.96 performs switch cases range analysis, warns about unreachable cases, and weeds them out. In switch(i) { case VALUE: } VALUE is first coerced into the type of i. If i is signed, VALUE is unsigned and exceeds i range, you lose... the result of the conversion is undefined.
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/i386/pctr.c6
-rw-r--r--sys/arch/i386/isa/pcvt/pcvt_drv.c4
-rw-r--r--sys/arch/i386/isa/pcvt/pcvt_ext.c4
-rw-r--r--sys/arch/i386/isa/pcvt/pcvt_hdr.h10
-rw-r--r--sys/arch/i386/isa/pcvt/pcvt_kbd.c4
-rw-r--r--sys/arch/i386/isa/pcvt/pcvt_sup.c4
6 files changed, 16 insertions, 16 deletions
diff --git a/sys/arch/i386/i386/pctr.c b/sys/arch/i386/i386/pctr.c
index 2c444b2e5a7..15427a936fc 100644
--- a/sys/arch/i386/i386/pctr.c
+++ b/sys/arch/i386/i386/pctr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pctr.c,v 1.12 1998/06/04 04:56:42 downsj Exp $ */
+/* $OpenBSD: pctr.c,v 1.13 1999/11/20 18:51:59 espie Exp $ */
/*
* Pentium performance counter driver for OpenBSD.
@@ -39,7 +39,7 @@ int pctr_isintel;
void pctrattach __P((int));
int pctropen __P((dev_t, int, int, struct proc *));
int pctrclose __P((dev_t, int, int, struct proc *));
-int pctrioctl __P((dev_t, int, caddr_t, int, struct proc *));
+int pctrioctl __P((dev_t, u_long, caddr_t, int, struct proc *));
int p5ctrsel __P((int fflag, u_int cmd, u_int fn));
static __inline void p5ctrrd __P((struct pctrst *st));
int p6ctrsel __P((int fflag, u_int cmd, u_int fn));
@@ -189,7 +189,7 @@ p6ctrrd (st)
int
pctrioctl (dev, cmd, data, fflag, p)
dev_t dev;
- int cmd;
+ u_long cmd;
caddr_t data;
int fflag;
struct proc *p;
diff --git a/sys/arch/i386/isa/pcvt/pcvt_drv.c b/sys/arch/i386/isa/pcvt/pcvt_drv.c
index ead34c90411..dd2a0ba8fa4 100644
--- a/sys/arch/i386/isa/pcvt/pcvt_drv.c
+++ b/sys/arch/i386/isa/pcvt/pcvt_drv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcvt_drv.c,v 1.24 1999/09/08 12:56:41 aaron Exp $ */
+/* $OpenBSD: pcvt_drv.c,v 1.25 1999/11/20 18:52:00 espie Exp $ */
/*
* Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch.
@@ -401,7 +401,7 @@ pctty(Dev_t dev)
}
int
-pcioctl(Dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
+pcioctl(Dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
{
register int error;
register struct tty *tp;
diff --git a/sys/arch/i386/isa/pcvt/pcvt_ext.c b/sys/arch/i386/isa/pcvt/pcvt_ext.c
index 0937e85aa1f..adc4cdc4669 100644
--- a/sys/arch/i386/isa/pcvt/pcvt_ext.c
+++ b/sys/arch/i386/isa/pcvt/pcvt_ext.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcvt_ext.c,v 1.22 1999/09/29 22:29:10 aaron Exp $ */
+/* $OpenBSD: pcvt_ext.c,v 1.23 1999/11/20 18:52:00 espie Exp $ */
/*
* Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch.
@@ -2562,7 +2562,7 @@ vgapage(int new_screen)
* VT_USL ioctl handling
*---------------------------------------------------------------------------*/
int
-usl_vt_ioctl(Dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
+usl_vt_ioctl(Dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
{
int i, j, error, opri, mode;
struct vt_mode newmode;
diff --git a/sys/arch/i386/isa/pcvt/pcvt_hdr.h b/sys/arch/i386/isa/pcvt/pcvt_hdr.h
index 248c5f62db2..1d3ecfa2073 100644
--- a/sys/arch/i386/isa/pcvt/pcvt_hdr.h
+++ b/sys/arch/i386/isa/pcvt/pcvt_hdr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcvt_hdr.h,v 1.27 1999/10/20 19:15:51 deraadt Exp $ */
+/* $OpenBSD: pcvt_hdr.h,v 1.28 1999/11/20 18:52:00 espie Exp $ */
/*
* Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch.
@@ -1033,7 +1033,7 @@ int pcopen ( Dev_t dev, int flag, int mode, struct proc *p );
int pcclose ( Dev_t dev, int flag, int mode, struct proc *p );
int pcread ( Dev_t dev, struct uio *uio, int flag );
int pcwrite ( Dev_t dev, struct uio *uio, int flag );
-int pcioctl ( Dev_t dev, int cmd, caddr_t data, int flag, struct proc *p );
+int pcioctl ( Dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p );
int pcmmap ( Dev_t dev, int offset, int nprot );
struct tty *
@@ -1049,7 +1049,7 @@ void pcstart ( struct tty *tp );
void pcstop ( struct tty *tp, int flag );
void switch_screen ( int n, int oldgrafx, int newgrafx );
-int usl_vt_ioctl (Dev_t dev,int cmd,caddr_t data,int flag,struct proc *);
+int usl_vt_ioctl (Dev_t dev, u_long cmd,caddr_t data,int flag,struct proc *);
int vt_activate ( int newscreen );
int vgapage ( int n );
void get_usl_keymap( keymap_t *map );
@@ -1078,7 +1078,7 @@ int kbd_cmd ( int val );
void kbd_code_init ( void );
void kbd_code_init1 ( void );
void kbd_setmode(int mode);
-int kbdioctl ( Dev_t dev, int cmd, caddr_t data, int flag );
+int kbdioctl ( Dev_t dev, u_long cmd, caddr_t data, int flag );
void loadchar ( int fontset, int character, int char_scanlines,
u_char *char_table );
void mda2egaorvga ( void );
@@ -1114,7 +1114,7 @@ void vga_screen_off ( void );
void vga_screen_on ( void );
char *vga_string ( int number );
int vga_test ( void );
-int vgaioctl ( Dev_t dev, int cmd, caddr_t data, int flag );
+int vgaioctl ( Dev_t dev, u_long cmd, caddr_t data, int flag );
void vgapaletteio ( unsigned idx, struct rgb *val, int writeit );
void vt_aln ( struct video_state *svsp );
void vt_clearudk ( struct video_state *svsp );
diff --git a/sys/arch/i386/isa/pcvt/pcvt_kbd.c b/sys/arch/i386/isa/pcvt/pcvt_kbd.c
index 5add2e802c5..03d2ede8a0e 100644
--- a/sys/arch/i386/isa/pcvt/pcvt_kbd.c
+++ b/sys/arch/i386/isa/pcvt/pcvt_kbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcvt_kbd.c,v 1.27 1999/10/07 02:43:08 aaron Exp $ */
+/* $OpenBSD: pcvt_kbd.c,v 1.28 1999/11/20 18:52:00 espie Exp $ */
/*
* Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch.
@@ -1838,7 +1838,7 @@ setkeydef(Ovl_tbl *data)
* keyboard ioctl's entry
*---------------------------------------------------------------------------*/
int
-kbdioctl(Dev_t dev, int cmd, caddr_t data, int flag)
+kbdioctl(Dev_t dev, u_long cmd, caddr_t data, int flag)
{
int key;
diff --git a/sys/arch/i386/isa/pcvt/pcvt_sup.c b/sys/arch/i386/isa/pcvt/pcvt_sup.c
index 7c1594d89b5..ddaba8d60ae 100644
--- a/sys/arch/i386/isa/pcvt/pcvt_sup.c
+++ b/sys/arch/i386/isa/pcvt/pcvt_sup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcvt_sup.c,v 1.11 1999/10/16 18:56:36 aaron Exp $ */
+/* $OpenBSD: pcvt_sup.c,v 1.12 1999/11/20 18:52:00 espie Exp $ */
/*
* Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch.
@@ -109,7 +109,7 @@ static u_short getrand ( void );
* execute vga ioctls
*---------------------------------------------------------------------------*/
int
-vgaioctl(Dev_t dev, int cmd, caddr_t data, int flag)
+vgaioctl(Dev_t dev, u_long cmd, caddr_t data, int flag)
{
if(minor(dev) >= PCVT_NSCREENS)
return -1;