From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mt3yp-0007R1-SH for qemu-devel@nongnu.org; Wed, 30 Sep 2009 14:32:48 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mt3yh-0007ED-Mh for qemu-devel@nongnu.org; Wed, 30 Sep 2009 14:32:43 -0400 Received: from [199.232.76.173] (port=56955 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mt3yg-0007Dr-Rg for qemu-devel@nongnu.org; Wed, 30 Sep 2009 14:32:38 -0400 Received: from mail-fx0-f214.google.com ([209.85.220.214]:50365) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mt3yg-0006t1-Fa for qemu-devel@nongnu.org; Wed, 30 Sep 2009 14:32:38 -0400 Received: by fxm10 with SMTP id 10so2069543fxm.8 for ; Wed, 30 Sep 2009 11:32:37 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4AC3A440.8010202@gnu.org> Date: Wed, 30 Sep 2009 20:32:32 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <20090923200635.GA21246@redhat.com> <20090924191121.GB29419@redhat.com> <20090929161115.GA13885@redhat.com> <20090930135142.GA20378@redhat.com> <4AC395F8.8030004@gnu.org> <20090930174821.GA1489@redhat.com> In-Reply-To: <20090930174821.GA1489@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: CODING_STYLE (was Re: [PATCHv2] qemu: target library, use it in msix) List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Blue Swirl , qemu-devel@nongnu.org On 09/30/2009 07:48 PM, Michael S. Tsirkin wrote: > On Wed, Sep 30, 2009 at 07:31:36PM +0200, Paolo Bonzini wrote: >> (indent requires knowledge of all the names of the types, so a >> mechanical pass through the sources is more easily said than done). > > How do you tell it the names of the types? You use the `-T' option. `-T' can be specified more than once, and all names specified are used. For example, if your program contains typedef unsigned long CODE_ADDR; typedef enum {red, blue, green} COLOR; you would use the options `-T CODE_ADDR -T COLOR'. Actually, you only need that for types that are used in arguments and declared in .h files (as opposed to the same .c file). Example: typedef struct color color; void f(color* p) works, but if you remove the typedef you get void f (color * p) Paolo