Received: from eggs.gnu.org ([2001:4830:134:3::10]:36658) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGQHT-00077q-NS for qemu-devel@nongnu.org; Fri, 24 Jun 2016 08:32:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGQHQ-0001wh-Jn for qemu-devel@nongnu.org; Fri, 24 Jun 2016 08:32:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53236) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGQHQ-0001wO-EV for qemu-devel@nongnu.org; Fri, 24 Jun 2016 08:32:16 -0400 From: Markus Armbruster References: <1466698330-6021-1-git-send-email-armbru@redhat.com> <1466698330-6021-5-git-send-email-armbru@redhat.com> <87oa6rxax1.fsf@dusky.pond.sub.org> <213da4da-cc47-e0a2-c90d-dac2f8ca911f@redhat.com> Date: Fri, 24 Jun 2016 14:32:12 +0200 In-Reply-To: (Peter Maydell's message of "Fri, 24 Jun 2016 10:46:49 +0100") Message-ID: <8760sylqcz.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH RFC 4/5] include: Move typedef qemu_irq to qemu/typedefs.h List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Paolo Bonzini , "Michael S. Tsirkin" , QEMU Developers Peter Maydell writes: > On 24 June 2016 at 09:17, Paolo Bonzini wrote: >> >> >> On 24/06/2016 10:15, Peter Maydell wrote: >>>>>> >>> @@ -31,6 +31,7 @@ typedef struct FWCfgState FWCfgState; >>>>>> >>> typedef struct HCIInfo HCIInfo; >>>>>> >>> typedef struct I2CBus I2CBus; >>>>>> >>> typedef struct I2SCodec I2SCodec; >>>>>> >>> +typedef struct IRQState *qemu_irq; >>>>>> >>> typedef struct ISABus ISABus; >>>>>> >>> typedef struct ISADevice ISADevice; >>>>>> >>> typedef struct IsaDma IsaDma; >>>>> >> >>>>> >> Everything else in typedefs.h is a "typedef struct Thing Thing", >>>>> >> but qemu_irq is different... >>>> > >>>> > We want to keep our readers on their toes! >>> It would mean you now have to decide whether the file is orderd >>> by the types being defined or by the underlying implementation >>> type (previously both orders were the same)... >> >> Indeed, and renaming the struct is trivial because it's used in a >> handful of places only. > > It would still be different by being a pointer-to-Foo, not a Foo. Hiding pointer-ness behind a typedef is a bad idea more often than not. What do you want me to do, if anything?