From owner-svn-src-all@FreeBSD.ORG Tue Dec 21 16:53:03 2010 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 42E691065674; Tue, 21 Dec 2010 16:53:03 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from fep17.mx.upcmail.net (fep17.mx.upcmail.net [62.179.121.37]) by mx1.freebsd.org (Postfix) with ESMTP id 1CA998FC18; Tue, 21 Dec 2010 16:53:01 +0000 (UTC) Received: from edge05.upcmail.net ([192.168.13.212]) by viefep17-int.chello.at (InterMail vM.8.01.02.02 201-2260-120-106-20100312) with ESMTP id <20101221165259.ZFIZ3300.viefep17-int.chello.at@edge05.upcmail.net>; Tue, 21 Dec 2010 17:52:59 +0100 Received: from mole.fafoe.narf.at ([213.47.85.26]) by edge05.upcmail.net with edge id lssx1f03N0a5KZh05ssyXP; Tue, 21 Dec 2010 17:52:59 +0100 X-SourceIP: 213.47.85.26 Received: by mole.fafoe.narf.at (Postfix, from userid 1001) id C5CDD6D428; Tue, 21 Dec 2010 17:52:57 +0100 (CET) Date: Tue, 21 Dec 2010 17:52:57 +0100 From: Stefan Farfeleder To: Matthew D Fleming Message-ID: <20101221165257.GG2614@mole.fafoe.narf.at> References: <201012211629.oBLGTwh4069669@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201012211629.oBLGTwh4069669@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Cloudmark-Analysis: v=1.1 cv=HQ3F56nxkum+cgCiDL7AXQpbvw7DWrWCBJRnYYnM0Zc= c=1 sm=0 a=fh0AGG1pjp4A:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=r6Jn6C-gXupKb1yhIoEA:9 a=R6IgdZz3F1oBRIVxVVm4zr7KQS8A:4 a=CjuIK1q_8ugA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216616 - in head/sys: kern 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: Tue, 21 Dec 2010 16:53:03 -0000 On Tue, Dec 21, 2010 at 04:29:58PM +0000, Matthew D Fleming wrote: > Author: mdf > Date: Tue Dec 21 16:29:58 2010 > New Revision: 216616 > URL: http://svn.freebsd.org/changeset/base/216616 > > Log: > Move the fail_point_entry definition from fail.h to kern_fail.c, which > allows putting the enumeration constants of fail point types with the > text string that matches them. [snip] > +enum fail_point_t { > + FAIL_POINT_OFF, /**< don't fail */ > + FAIL_POINT_PANIC, /**< panic */ > + FAIL_POINT_RETURN, /**< return an errorcode */ > + FAIL_POINT_BREAK, /**< break into the debugger */ > + FAIL_POINT_PRINT, /**< print a message */ > + FAIL_POINT_SLEEP, /**< sleep for some msecs */ > + FAIL_POINT_INVALID, /**< placeholder */ > +}; > + > +static const char *fail_type_strings[] = { > + "off", > + "panic", > + "return", > + "break", > + "print", > + "sleep", > +}; FWIW, you can also do this in C99: static const char *fail_type_strings[] = { [FAIL_POINT_OFF] = "off", }; Cheers, Stefan