Source-Changes-HG archive

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

[src/trunk]: src/include u_long -> unsigned long in "offsetof" macro.



details:   https://anonhg.NetBSD.org/src/rev/b15029802eb7
branches:  trunk
changeset: 499067:b15029802eb7
user:      tshiozak <tshiozak%NetBSD.org@localhost>
date:      Fri Nov 10 06:35:45 2000 +0000

description:
u_long -> unsigned long in "offsetof" macro.
Using u_long causes <stddef.h> to undesirably depend on <sys/types.h> .
BTW: Why is the cast needed?

diffstat:

 include/stddef.h |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (17 lines):

diff -r c104eb0f6d11 -r b15029802eb7 include/stddef.h
--- a/include/stddef.h  Fri Nov 10 06:21:07 2000 +0000
+++ b/include/stddef.h  Fri Nov 10 06:35:45 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: stddef.h,v 1.8 2000/07/06 00:51:36 christos Exp $      */
+/*     $NetBSD: stddef.h,v 1.9 2000/11/10 06:35:45 tshiozak Exp $      */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -54,6 +54,6 @@
 
 #include <sys/null.h>
 
-#define        offsetof(type, member)  ((size_t)(u_long)(&((type *)0)->member))
+#define        offsetof(type, member)  ((size_t)(unsigned long)(&((type *)0)->member))
 
 #endif /* _STDDEF_H_ */



Home | Main Index | Thread Index | Old Index