Rename RB_STATIC_* to RB_*_STATIC to match up with FreeBSD.
authorSimon Schubert <corecode@dragonflybsd.org>
Mon, 7 Jan 2008 01:22:30 +0000 (01:22 +0000)
committerSimon Schubert <corecode@dragonflybsd.org>
Mon, 7 Jan 2008 01:22:30 +0000 (01:22 +0000)
lib/libc/uuid/uuid_name_lookup.c
sys/sys/tree.h

index eb26e2c..a57f4d5 100644 (file)
@@ -31,7 +31,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * 
- * $DragonFly: src/lib/libc/uuid/uuid_name_lookup.c,v 1.5 2007/11/25 01:28:23 swildner Exp $
+ * $DragonFly: src/lib/libc/uuid/uuid_name_lookup.c,v 1.6 2008/01/07 01:22:30 corecode Exp $
  */
 /*
  * Implement UUID-to-NAME and NAME-to-UUID functions
@@ -60,11 +60,11 @@ static void uuid_loadcache(const char *path);
 static int uuid_name_loaded;
 
 RB_HEAD(uuid_urbtree, uuid_rbnode);
-RB_STATIC_PROTOTYPE(uuid_urbtree, uuid_rbnode, unode, uuid_urbcmp);
+RB_PROTOTYPE_STATIC(uuid_urbtree, uuid_rbnode, unode, uuid_urbcmp);
 static struct uuid_urbtree uuid_urbroot = RB_INITIALIZER(uuid_urbroot);
 
 RB_HEAD(uuid_nrbtree, uuid_rbnode);
-RB_STATIC_PROTOTYPE(uuid_nrbtree, uuid_rbnode, nnode, uuid_nrbcmp);
+RB_PROTOTYPE_STATIC(uuid_nrbtree, uuid_rbnode, nnode, uuid_nrbcmp);
 static struct uuid_nrbtree uuid_nrbroot = RB_INITIALIZER(uuid_nrbroot);
 
 static int
@@ -91,11 +91,11 @@ uuid_rbuuidcmp(const struct uuid *uuid, struct uuid_rbnode *node)
        return(uuid_compare(uuid, &node->uuid, NULL));
 }
 
-RB_STATIC_GENERATE(uuid_urbtree, uuid_rbnode, unode, uuid_urbcmp)
-RB_STATIC_GENERATE(uuid_nrbtree, uuid_rbnode, nnode, uuid_nrbcmp)
-RB_STATIC_GENERATE_XLOOKUP(uuid_urbtree, UUID, uuid_rbnode, unode,
+RB_GENERATE_STATIC(uuid_urbtree, uuid_rbnode, unode, uuid_urbcmp)
+RB_GENERATE_STATIC(uuid_nrbtree, uuid_rbnode, nnode, uuid_nrbcmp)
+RB_GENERATE_XLOOKUP_STATIC(uuid_urbtree, UUID, uuid_rbnode, unode,
                           uuid_rbuuidcmp, const struct uuid *)
-RB_STATIC_GENERATE_XLOOKUP(uuid_nrbtree, NAME, uuid_rbnode, nnode,
+RB_GENERATE_XLOOKUP_STATIC(uuid_nrbtree, NAME, uuid_rbnode, nnode,
                           uuid_rbnamecmp, const char *)
                
 
index f4cc8e2..fdf7c54 100644 (file)
@@ -1,6 +1,6 @@
 /*     $NetBSD: tree.h,v 1.8 2004/03/28 19:38:30 provos Exp $  */
 /*     $OpenBSD: tree.h,v 1.7 2002/10/17 21:51:54 art Exp $    */
-/*     $DragonFly: src/sys/sys/tree.h,v 1.10 2007/11/20 22:52:23 dillon Exp $ */
+/*     $DragonFly: src/sys/sys/tree.h,v 1.11 2008/01/07 01:22:30 corecode Exp $ */
 /*
  * Copyright 2002 Niels Provos <provos@citi.umich.edu>
  * All rights reserved.
@@ -386,11 +386,11 @@ struct {                                                          \
 
 /* Generates prototypes and inline functions */
 #define RB_PROTOTYPE(name, type, field, cmp)                           \
-       _RB_PROTOTYPE(, name, type, field, cmp)
-#define RB_STATIC_PROTOTYPE(name, type, field, cmp)                    \
-       _RB_PROTOTYPE(static, name, type, field, cmp)
+       _RB_PROTOTYPE(name, type, field, cmp,)
+#define RB_PROTOTYPE_STATIC(name, type, field, cmp)                    \
+       _RB_PROTOTYPE(name, type, field, cmp, __unused static)
 
-#define _RB_PROTOTYPE(STORQUAL, name, type, field, cmp)                        \
+#define _RB_PROTOTYPE(name, type, field, cmp, STORQUAL)                        \
 STORQUAL struct type *name##_RB_REMOVE(struct name *, struct type *);  \
 STORQUAL struct type *name##_RB_INSERT(struct name *, struct type *);  \
 STORQUAL struct type *name##_RB_FIND(struct name *, struct type *);    \
@@ -430,12 +430,12 @@ struct type *name##_RB_LOOKUP_##ext (struct name *, datatype)             \
  * Moves node close to the key of elm to top
  */
 #define RB_GENERATE(name, type, field, cmp)                            \
-       _RB_GENERATE(, name, type, field, cmp)
+       _RB_GENERATE(name, type, field, cmp,)
 
-#define RB_STATIC_GENERATE(name, type, field, cmp)                     \
-       _RB_GENERATE(static, name, type, field, cmp)
+#define RB_GENERATE_STATIC(name, type, field, cmp)                     \
+       _RB_GENERATE(name, type, field, cmp, __unused static)
 
-#define _RB_GENERATE(STORQUAL, name, type, field, cmp)                 \
+#define _RB_GENERATE(name, type, field, cmp, STORQUAL)                 \
 static void                                                            \
 name##_RB_INSERT_COLOR(struct name *head, struct type *elm)            \
 {                                                                      \
@@ -914,11 +914,11 @@ name##_RB_RLOOKUP(struct name *head, datatype value)                      \
  */
 
 #define RB_GENERATE_XLOOKUP(name, ext, type, field, xcmp, datatype)       \
-       _RB_GENERATE_XLOOKUP(,name, ext, type, field, xcmp, datatype)
-#define RB_STATIC_GENERATE_XLOOKUP(name, ext, type, field, xcmp, datatype) \
-       _RB_GENERATE_XLOOKUP(static, name, ext, type, field, xcmp, datatype)
+       _RB_GENERATE_XLOOKUP(name, ext, type, field, xcmp, datatype,)
+#define RB_GENERATE_XLOOKUP_STATIC(name, ext, type, field, xcmp, datatype) \
+       _RB_GENERATE_XLOOKUP(name, ext, type, field, xcmp, datatype, __unused static)
 
-#define _RB_GENERATE_XLOOKUP(STORQUAL, name, ext, type, field, xcmp, datatype)\
+#define _RB_GENERATE_XLOOKUP(name, ext, type, field, xcmp, datatype, STORQUAL)\
                                                                        \
 STORQUAL struct type *                                                 \
 name##_RB_LOOKUP_##ext (struct name *head, datatype value)             \