From owner-svn-src-all@FreeBSD.ORG Wed Dec 24 19:57:22 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7AFF1065675; Wed, 24 Dec 2008 19:57:22 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 94A978FC17; Wed, 24 Dec 2008 19:57:22 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBOJvMwi046448; Wed, 24 Dec 2008 19:57:22 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBOJvMO2046447; Wed, 24 Dec 2008 19:57:22 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <200812241957.mBOJvMO2046447@svn.freebsd.org> From: Bruce M Simpson Date: Wed, 24 Dec 2008 19:57:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186479 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Dec 2008 19:57:22 -0000 Author: bms Date: Wed Dec 24 19:57:22 2008 New Revision: 186479 URL: http://svn.freebsd.org/changeset/base/186479 Log: Add macro RB_FOREACH_SAFE(), which accepts an additional argument specifying a temporary tree node pointer. It may be used in a similar way to the *_SAFE() macros in . Modified: head/sys/sys/tree.h Modified: head/sys/sys/tree.h ============================================================================== --- head/sys/sys/tree.h Wed Dec 24 11:12:21 2008 (r186478) +++ head/sys/sys/tree.h Wed Dec 24 19:57:22 2008 (r186479) @@ -737,6 +737,11 @@ name##_RB_MINMAX(struct name *head, int (x) != NULL; \ (x) = name##_RB_NEXT(x)) +#define RB_FOREACH_SAFE(x, name, head, y) \ + for ((x) = RB_MIN(name, head); \ + (x) != NULL && ((y) = name##_RB_NEXT(x)); \ + (x) = (y)) + #define RB_FOREACH_REVERSE(x, name, head) \ for ((x) = RB_MAX(name, head); \ (x) != NULL; \