svn commit: r204865 - head/sys/netinet/ipfw

Luigi Rizzo luigi at FreeBSD.org
Mon Mar 8 11:27:09 UTC 2010


Author: luigi
Date: Mon Mar  8 11:27:08 2010
New Revision: 204865
URL: http://svn.freebsd.org/changeset/base/204865

Log:
  don't use C++ keywords as variable names

Modified:
  head/sys/netinet/ipfw/dn_heap.c
  head/sys/netinet/ipfw/dn_heap.h

Modified: head/sys/netinet/ipfw/dn_heap.c
==============================================================================
--- head/sys/netinet/ipfw/dn_heap.c	Mon Mar  8 11:25:45 2010	(r204864)
+++ head/sys/netinet/ipfw/dn_heap.c	Mon Mar  8 11:27:08 2010	(r204865)
@@ -323,20 +323,20 @@ struct dn_ht {
         int ofs;	        /* offset of link field */
         uint32_t (*hash)(uintptr_t, int, void *arg);
         int (*match)(void *_el, uintptr_t key, int, void *);
-        void *(*new)(uintptr_t, int, void *);
+        void *(*newh)(uintptr_t, int, void *);
         void **ht;              /* bucket heads */
 };
 /*
  * Initialize, allocating bucket pointers inline.
  * Recycle previous record if possible.
- * If the 'new' function is not supplied, we assume that the
+ * If the 'newh' function is not supplied, we assume that the
  * key passed to ht_find is the same object to be stored in.
  */
 struct dn_ht *
 dn_ht_init(struct dn_ht *ht, int buckets, int ofs,
         uint32_t (*h)(uintptr_t, int, void *),
         int (*match)(void *, uintptr_t, int, void *),
-	void *(*new)(uintptr_t, int, void *))
+	void *(*newh)(uintptr_t, int, void *))
 {
 	int l;
 
@@ -410,7 +410,7 @@ dn_ht_init(struct dn_ht *ht, int buckets
 		ht->ofs = ofs;
 		ht->hash = h;
 		ht->match = match;
-		ht->new = new;
+		ht->newh = newh;
 	}
 	return ht;
 }
@@ -471,8 +471,8 @@ dn_ht_find(struct dn_ht *ht, uintptr_t k
 	} else if (flags & DNHT_INSERT) {
 		// printf("%s before calling new, bucket %d ofs %d\n",
 		//	__FUNCTION__, i, ht->ofs);
-		p = ht->new ? ht->new(key, flags, arg) : (void *)key;
-		// printf("%s new returns %p\n", __FUNCTION__, p);
+		p = ht->newh ? ht->newh(key, flags, arg) : (void *)key;
+		// printf("%s newh returns %p\n", __FUNCTION__, p);
 		if (p) {
 			ht->entries++;
 			*(void **)((char *)p + ht->ofs) = ht->ht[i];

Modified: head/sys/netinet/ipfw/dn_heap.h
==============================================================================
--- head/sys/netinet/ipfw/dn_heap.h	Mon Mar  8 11:25:45 2010	(r204864)
+++ head/sys/netinet/ipfw/dn_heap.h	Mon Mar  8 11:27:08 2010	(r204865)
@@ -119,7 +119,7 @@ int heap_scan(struct dn_heap *, int (*)(
  *	hash(key, flags, arg) called to return a bucket index.
  *	match(obj, key, flags, arg) called to determine if key
  *		matches the current 'obj' in the heap
- *	new(key, flags, arg) optional, used to allocate a new
+ *	newh(key, flags, arg) optional, used to allocate a new
  *		object during insertions.
  *
  * dn_ht_free() frees the heap or unlink elements.
@@ -167,7 +167,7 @@ struct dn_ht;	/* should be opaque */
 struct dn_ht *dn_ht_init(struct dn_ht *, int buckets, int ofs, 
         uint32_t (*hash)(uintptr_t, int, void *),
         int (*match)(void *, uintptr_t, int, void *),
-        void *(*new)(uintptr_t, int, void *));
+        void *(*newh)(uintptr_t, int, void *));
 void dn_ht_free(struct dn_ht *, int flags);
 
 void *dn_ht_find(struct dn_ht *, uintptr_t, int, void *);


More information about the svn-src-head mailing list