From 5514cce54eeb6b5b2fc4bc8ec005b474e563c9e2 Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Sat, 20 Nov 1999 18:52:01 +0000 Subject: 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. --- sys/compat/ossaudio/ossaudiovar.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/compat/ossaudio/ossaudiovar.h') 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)) -- cgit v1.2.3