From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37246) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGDBC-0005Zi-9w for qemu-devel@nongnu.org; Mon, 24 Sep 2012 14:14:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TGDBA-00009l-V1 for qemu-devel@nongnu.org; Mon, 24 Sep 2012 14:14:50 -0400 Received: from mail-ob0-f173.google.com ([209.85.214.173]:36801) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGDBA-00009h-PK for qemu-devel@nongnu.org; Mon, 24 Sep 2012 14:14:48 -0400 Received: by obbta14 with SMTP id ta14so5332808obb.4 for ; Mon, 24 Sep 2012 11:14:48 -0700 (PDT) Sender: fluxion Date: Mon, 24 Sep 2012 13:14:42 -0500 From: Michael Roth Message-ID: <20120924181442.GV16157@illuin> References: <1348236465-23124-1-git-send-email-mdroth@linux.vnet.ibm.com> <505C8E76.1030104@redhat.com> <20120921162428.GS16157@illuin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v2] Add infrastructure for QIDL-based device serialization List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: Paolo Bonzini , aliguori@us.ibm.com, eblake@redhat.com, qemu-devel@nongnu.org, peter.maydell@linaro.org On Sat, Sep 22, 2012 at 02:33:52PM +0000, Blue Swirl wrote: > On Fri, Sep 21, 2012 at 4:24 PM, Michael Roth wrote: > > On Fri, Sep 21, 2012 at 05:57:42PM +0200, Paolo Bonzini wrote: > >> Il 21/09/2012 16:07, Michael Roth ha scritto: > >> > > >> > QIDL_DECLARE(SerialDevice) { > >> > SysBusDevice parent; > >> > > >> > uint8_t thr; /* transmit holding register */ > >> > uint8_t lsr; /* line status register */ > >> > uint8_t ier; /* interrupt enable register */ > >> > > >> > int int_pending qDerived; /* whether we have a pending queued interrupt */ > >> > CharDriverState *chr qImmutable; /* backend */ > >> > }; > >> > >> I thought we agreed on QIDL(derived), QIDL(immutable) etc. These > >> prefixes just do not scale... > > > > qImmutable gets defined as QIDL(immutable) via qidl.h, and underneath > > the covers it's all QIDL(). So we can change them easily if need be, and > > still have the optional of using QIDL() for any current or new > > annotations that get introduced. But QIDL() just ends up being > > really noisey in practice, especially when a field has multiple > > annotations, so I'd like to make that kind of usage the exceptional > > case rather than the common one. > > > > I went with qUppercase because it avoids all the previous issues with > > using leading underscores, and it's reserved in terms of QEMU coding > > guidelines as far as I can tell (we generally require leading capital > > for typedefs and lowercase for variable names, and can work around > > exceptions on a case by case basis by using QIDL() or some other name). > > I also had it as q_* for a bit but that didn't seem much better on the > > eyes we looking at converted structures. > > It looks like Hungarian notation and very much unlike other QEMU code. > I'd use q_ or qidl_ prefix instead, or rather QIDL(). > I wanted some way to distinguish from other qemu code to avoid conflicts, but i think q_* seems reasonable if we reserve the prefix via CODING_STYLE. Then for conflicts outside our control we can either use a different name for the annotations or use the long-form QIDL() style depending on the circumstances. > > > >> > >> Paolo > >> >