diff options
author | Marc Espie <espie@cvs.openbsd.org> | 1999-11-20 18:52:01 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 1999-11-20 18:52:01 +0000 |
commit | 5514cce54eeb6b5b2fc4bc8ec005b474e563c9e2 (patch) | |
tree | 5116bee8052fbccf26146a95d6ddcdae6ba752ff /sys/compat/ossaudio/ossaudiovar.h | |
parent | 1c4a3676fce5aeb3e26ee82bb20b040dbda864d6 (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/compat/ossaudio/ossaudiovar.h')
-rw-r--r-- | sys/compat/ossaudio/ossaudiovar.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/compat/ossaudio/ossaudiovar.h b/sys/compat/ossaudio/ossaudiovar.h index aa7424c730d..8f28215259c 100644 --- a/sys/compat/ossaudio/ossaudiovar.h +++ b/sys/compat/ossaudio/ossaudiovar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ossaudiovar.h,v 1.2 1998/04/26 22:15:45 provos Exp $ */ +/* $OpenBSD: ossaudiovar.h,v 1.3 1999/11/20 18:52:00 espie Exp $ */ /* $NetBSD: ossaudiovar.h,v 1.4 1997/10/16 16:49:40 augustss Exp $ */ /* @@ -45,7 +45,7 @@ struct oss_sys_ioctl_args { #define OSS_IOC_IN 0x40000000 /* copy in parameters */ #define OSS_IOC_OUT 0x80000000 /* copy out parameters */ #define OSS_IOC_INOUT (OSS_IOC_IN | OSS_IOC_OUT) -#define _OSS_IOCTL(w,x,y,z) ((int)((w)|(((z)&OSS_IOCPARM_MASK)<<16)|((x)<<8)|(y))) +#define _OSS_IOCTL(w,x,y,z) ((u_long)((w)|(((z)&OSS_IOCPARM_MASK)<<16)|((x)<<8)|(y))) #define _OSS_IO(x,y) _OSS_IOCTL(OSS_IOC_VOID, x, y, 0) #define _OSS_IOR(x,y,t) _OSS_IOCTL(OSS_IOC_OUT, x, y, sizeof(t)) #define _OSS_IOW(x,y,t) _OSS_IOCTL(OSS_IOC_IN, x, y, sizeof(t)) |