From cd0337328da4e5286a2f78a294d73654e8c7125f Mon Sep 17 00:00:00 2001 From: imp Date: Wed, 11 Feb 2009 04:52:46 +0000 Subject: [PATCH] o Introduce KOBJMETHOD_END for the end of the kobj list. o Fix a minor indentation problem. o Put in the extra-strict KOBJMETHOD define, but commented out since the tree isn't yet ready. Reviewed by: (1) was posted to arch@ without objection (and 1 go for it) --- sys/sys/kobj.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sys/sys/kobj.h b/sys/sys/kobj.h index 9272e49ef037..385a2c3fc686 100644 --- a/sys/sys/kobj.h +++ b/sys/sys/kobj.h @@ -92,7 +92,17 @@ struct kobjop_desc { /* * Shorthand for constructing method tables. */ +#if 1 #define KOBJMETHOD(NAME, FUNC) { &NAME##_desc, (kobjop_t) FUNC } +#else /* notyet */ +#define KOBJMETHOD(NAME, FUNC) \ +{ &NAME##_desc, (kobjop_t) (FUNC != (NAME##_t *)NULL ? FUNC : NULL) } +#endif + +/* + * + */ +#define KOBJMETHOD_END { NULL, NULL } /* * Declare a class (which should be defined in another file. @@ -127,7 +137,7 @@ struct kobj_class classvar = { \ base1) \ \ static kobj_class_t name ## _baseclasses[] = \ - { &base1, NULL }; \ + { &base1, NULL }; \ struct kobj_class classvar = { \ #name, methods, size, name ## _baseclasses \ }