Module Name: src Committed By: christos Date: Tue May 19 21:59:10 UTC 2009
Modified Files: src/sys/sys: ioccom.h Log Message: use symbolic constants and parenthesize the macro args everywhere. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/sys/ioccom.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/sys/ioccom.h diff -u src/sys/sys/ioccom.h:1.9 src/sys/sys/ioccom.h:1.10 --- src/sys/sys/ioccom.h:1.9 Tue May 29 17:32:30 2007 +++ src/sys/sys/ioccom.h Tue May 19 17:59:10 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: ioccom.h,v 1.9 2007/05/29 21:32:30 christos Exp $ */ +/* $NetBSD: ioccom.h,v 1.10 2009/05/19 21:59:10 christos Exp $ */ /*- * Copyright (c) 1982, 1986, 1990, 1993, 1994 @@ -58,8 +58,9 @@ /* mask for IN/OUT/VOID */ #define IOC_DIRMASK (unsigned long)0xe0000000 -#define _IOC(inout,group,num,len) \ - (inout | ((len & IOCPARM_MASK) << 16) | ((group) << 8) | (num)) +#define _IOC(inout, group, num, len) \ + ((inout) | (((len) & IOCPARM_MASK) << IOCPARM_SHIFT) | \ + ((group) << IOCGROUP_SHIFT) | (num)) #define _IO(g,n) _IOC(IOC_VOID, (g), (n), 0) #define _IOR(g,n,t) _IOC(IOC_OUT, (g), (n), sizeof(t)) #define _IOW(g,n,t) _IOC(IOC_IN, (g), (n), sizeof(t))