From patchwork Sat Feb 18 10:10:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Blue Swirl X-Patchwork-Id: 142034 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4B820B6FA2 for ; Sat, 18 Feb 2012 21:11:05 +1100 (EST) Received: from localhost ([::1]:41326 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RyhFv-0008A7-1L for incoming@patchwork.ozlabs.org; Sat, 18 Feb 2012 05:11:03 -0500 Received: from eggs.gnu.org ([140.186.70.92]:52748) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RyhFo-0008A2-Tq for qemu-devel@nongnu.org; Sat, 18 Feb 2012 05:10:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RyhFm-0007x9-Qk for qemu-devel@nongnu.org; Sat, 18 Feb 2012 05:10:56 -0500 Received: from mail-tul01m020-f173.google.com ([209.85.214.173]:36540) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RyhFm-0007x2-L8 for qemu-devel@nongnu.org; Sat, 18 Feb 2012 05:10:54 -0500 Received: by obbup16 with SMTP id up16so6111186obb.4 for ; Sat, 18 Feb 2012 02:10:54 -0800 (PST) Received-SPF: pass (google.com: domain of blauwirbel@gmail.com designates 10.60.8.162 as permitted sender) client-ip=10.60.8.162; Authentication-Results: mr.google.com; spf=pass (google.com: domain of blauwirbel@gmail.com designates 10.60.8.162 as permitted sender) smtp.mail=blauwirbel@gmail.com; dkim=pass header.i=blauwirbel@gmail.com Received: from mr.google.com ([10.60.8.162]) by 10.60.8.162 with SMTP id s2mr4932646oea.28.1329559854077 (num_hops = 1); Sat, 18 Feb 2012 02:10:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=xr/yVl6wXA+1SvuZmcGIaoLKGqpQc9bH9dMbyYAzvRc=; b=dbGycHOOuNdOxVYNyCpk3APgeNC3ef3qL4PGovtuK1RkS635nUNFk98DWi2b5WYxgV Ed5xsEwZuaqXgGr6uv8ZZ6wIR1A6u8/4IGwypjhxpZozmpMKR7Mp7hAxTyjTdAF/3b0V pkA3NasT1r1sqAbIp68eV7mD2v0nHX2pQisMA= Received: by 10.60.8.162 with SMTP id s2mr4192317oea.28.1329559854031; Sat, 18 Feb 2012 02:10:54 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.74.169 with HTTP; Sat, 18 Feb 2012 02:10:33 -0800 (PST) In-Reply-To: <1329556054-3601-1-git-send-email-sw@weilnetz.de> References: <1329556054-3601-1-git-send-email-sw@weilnetz.de> From: Blue Swirl Date: Sat, 18 Feb 2012 10:10:33 +0000 Message-ID: To: Stefan Weil X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.214.173 Cc: qemu-devel@nongnu.org Subject: Re: [Qemu-devel] [PATCH] astyle: Formatting rules for QEMU X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org On Sat, Feb 18, 2012 at 09:07, Stefan Weil wrote: > These AStyle rules try to implement the QEMU coding style. > > AStyle can also fix only certain aspects of the coding style, > for example indentation. > > Signed-off-by: Stefan Weil > --- > > Hi Blue, > > maybe this AStyle rules work better. I tried them with target-sparc, > and the result does look quite good. There are still indentation problems when expressions continue to next line, also this does not look OK: Overall astyle seems to be a better tool than GNU indent. I also tried to use Emacs to perform the indenting with the attached scripts, but the result is not that great either, especially some macros and helper.h confuse indentation. > Regards, > Stefan > >  scripts/astylerc |   19 +++++++++++++++++++ >  1 files changed, 19 insertions(+), 0 deletions(-) >  create mode 100644 scripts/astylerc > > diff --git a/scripts/astylerc b/scripts/astylerc > new file mode 100644 > index 0000000..dfbfd41 > --- /dev/null > +++ b/scripts/astylerc > @@ -0,0 +1,19 @@ > +# Artistic Style (astyle) options for qemu source code. > + > +# Usage: > +# astyle --options=scripts/astylerc {source files} > + > +# For best results, use latest astyle from http://astyle.sourceforge.net/. > + > +add-brackets > +align-pointer=name > +convert-tabs > +max-code-length=80 This is only supported by the SVN HEAD, not even the download tarball offered. > +style=otbs > +brackets=linux > +indent=spaces=4 > +max-code-length=80 > +max-instatement-indent=60 > +pad-oper > +pad-header > +unpad-paren > -- > 1.7.9 > --- a/target-sparc/translate.c +++ b/target-sparc/translate.c @@ -36,7 +36,7 @@ #define DYNAMIC_PC 1 /* dynamic pc value */ #define JUMP_PC 2 /* dynamic pc value which takes only two values - according to jump_pc[T2] */ +according to jump_pc[T2] */ Moving the brace to same line as switch case should not be necessary.