Module Name: src Committed By: matt Date: Wed Jul 27 23:10:41 UTC 2011
Modified Files: src/sys/arch/xen/include/xen3-public/io: ring.h Log Message: Make this use offsetof and __typeof__ to appease gcc4.5 To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/arch/xen/include/xen3-public/io/ring.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/arch/xen/include/xen3-public/io/ring.h diff -u src/sys/arch/xen/include/xen3-public/io/ring.h:1.11 src/sys/arch/xen/include/xen3-public/io/ring.h:1.12 --- src/sys/arch/xen/include/xen3-public/io/ring.h:1.11 Fri Aug 22 15:28:11 2008 +++ src/sys/arch/xen/include/xen3-public/io/ring.h Wed Jul 27 23:10:40 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: ring.h,v 1.11 2008/08/22 15:28:11 cegger Exp $ */ +/* $NetBSD: ring.h,v 1.12 2011/07/27 23:10:40 matt Exp $ */ /****************************************************************************** * ring.h * @@ -60,7 +60,7 @@ * power of two (so we can mask with (size-1) to loop around). */ #define __RING_SIZE(_s, _sz) \ - (__RD32(((_sz) - (long)(_s)->ring + (long)(_s)) / sizeof((_s)->ring[0]))) + (__RD32(((_sz) - offsetof(__typeof__(*(_s)), ring)) / sizeof((_s)->ring[0]))) /* * Macros to make the correct C datatypes for a new kind of ring.