From owner-freebsd-arch Thu Jan 31 12:44:48 2002 Delivered-To: freebsd-arch@freebsd.org Received: from xerxes.courtesan.com (courtesan.com [206.168.103.86]) by hub.freebsd.org (Postfix) with ESMTP id 8D6BE37B405 for ; Thu, 31 Jan 2002 12:44:40 -0800 (PST) Received: from xerxes.courtesan.com (IDENT:millert@localhost.courtesan.com [127.0.0.1]) by xerxes.courtesan.com (8.12.2/8.12.1) with ESMTP id g0VKhrDx004889; Thu, 31 Jan 2002 13:43:54 -0700 (MST) Message-Id: <200201312043.g0VKhrDx004889@xerxes.courtesan.com> To: "Perry E. Metzger" Cc: "M. Warner Losh" , wes@softweyr.com, tlambert2@mindspring.com, asmodai@wxs.nl, mckusick@mckusick.com, arch@FreeBSD.ORG, peter@wemm.org, phk@critter.freebsd.dk, deatley@apple.com, jkh@winston.freebsd.org, deraadt@cvs.openbsd.org Subject: Re: __P macro question In-reply-to: Your message of "31 Jan 2002 11:43:41 EST." <87d6zq31z6.fsf@snark.piermont.com> References: <20020131072933.GQ22384@daemon.ninth-circle.org> <3C58F78E.3F66EA8E@mindspring.com> <3C58FBEC.746257BB@softweyr.com> <20020131.085938.18394797.imp@village.org> <87d6zq31z6.fsf@snark.piermont.com> Date: Thu, 31 Jan 2002 13:43:53 -0700 From: "Todd C. Miller" Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message <87d6zq31z6.fsf@snark.piermont.com> so spake "Perry E. Metzger" (perry): > If you do it by hand, we'll get source diffs by accident. If we build > a quick set of scripts to do it, since we'll all be using the same > scripts, we'll end up with fewer diffs. My inclination is to do the simple stuff programatically and do the more complicated things by hand. A simple, dumb, ed script such as the following is capable of changing the majority of things. It doesn't attempt to deal with multi-line prototypes nor does it try to convert prototypes that contain parens. These remaining things can then be converted by hand. Yes, you could hack up a perl script to try and do everything but would you really trust it? I wouldn't. My script can be called thusly: find bin -type f | xargs convert.ed #!/bin/sh for f in $@; do /bin/ed - $f <<'EOF' %s/[ ]*__P[ ]*((\([^()]*\)))/(\1)/g w q EOF done To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message