Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/xen/include/xen3-public/io Make this use offsetof a...



details:   https://anonhg.NetBSD.org/src/rev/f1ac13af093a
branches:  trunk
changeset: 767694:f1ac13af093a
user:      matt <matt%NetBSD.org@localhost>
date:      Wed Jul 27 23:10:40 2011 +0000

description:
Make this use offsetof and __typeof__ to appease gcc4.5

diffstat:

 sys/arch/xen/include/xen3-public/io/ring.h |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r cc93d23ff69a -r f1ac13af093a sys/arch/xen/include/xen3-public/io/ring.h
--- a/sys/arch/xen/include/xen3-public/io/ring.h        Wed Jul 27 22:04:23 2011 +0000
+++ b/sys/arch/xen/include/xen3-public/io/ring.h        Wed Jul 27 23:10:40 2011 +0000
@@ -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.



Home | Main Index | Thread Index | Old Index