From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51810) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avZQL-0003nI-UN for qemu-devel@nongnu.org; Wed, 27 Apr 2016 20:03:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1avZQH-0005eO-NG for qemu-devel@nongnu.org; Wed, 27 Apr 2016 20:03:17 -0400 Date: Thu, 28 Apr 2016 09:49:39 +1000 From: David Gibson Message-ID: <20160427234939.GH18476@voom.redhat.com> References: <1461119601-4936-1-git-send-email-david@gibson.dropbear.id.au> <1461119601-4936-2-git-send-email-david@gibson.dropbear.id.au> <571F4A36.7060106@redhat.com> <20160427060252.GB18476@voom.redhat.com> <87bn4v362f.fsf@dusky.pond.sub.org> <572064DF.6030802@redhat.com> <87potbzf0m.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6lCXDTVICvIQMz0h" Content-Disposition: inline In-Reply-To: <87potbzf0m.fsf@dusky.pond.sub.org> Subject: Re: [Qemu-devel] [RFC for-2.7 01/11] qdt: IEEE1275-style device tree utility code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Thomas Huth , aik@ozlabs.ru, agraf@suse.de, qemu-ppc@nongnu.org, qemu-devel@nongnu.org, crosthwaite.peter@gmail.com --6lCXDTVICvIQMz0h Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 27, 2016 at 09:28:57AM +0200, Markus Armbruster wrote: > Thomas Huth writes: >=20 > > On 27.04.2016 08:43, Markus Armbruster wrote: > >> David Gibson writes: > >>=20 > >>> On Tue, Apr 26, 2016 at 01:00:06PM +0200, Thomas Huth wrote: > >>>> On 20.04.2016 04:33, David Gibson wrote: > > [...] > >>>>> +/* > >>>>> + * Property functions > >>>>> + */ > >>>>> + > >>>>> +QDTProperty *qdt_new_property(const gchar *name, gconstpointer val= , gsize len) > >>>>> +{ > >>>>> + QDTProperty *prop =3D g_malloc0(sizeof(*prop) + len); > >>>>> + > >>>>> + prop->name =3D g_strdup(name); > >>>>> + prop->len =3D len; > >>>>> + memcpy(prop->val, val, len); > >>>>> + return prop; > >>>>> +} > >>>>> + > >>>>> +static QDTProperty *getprop_(const QDTNode *node, const gchar *nam= e) > >>>> > >>>> Underscore at the end looks somewhat strange ... can't you simply dr= op that? > >>> > >>> Well.. the idea was that the _ versions are the "internal" ones, > >>> whereas external users will generally use the non-underscore version > >>=20 > >> I've seen that convention used before. It's fine with me. > > > > Can't remember to have seen that convention before ... I know that some > > people use the underscore at the beginning to mark an internal function, > > but at the end? > > So if you really want to use the underscore, what about putting it at > > the beginning instead? >=20 > C99 7.1.3 Reserved identifiers: >=20 > -- All identifiers that begin with an underscore are > always reserved for use as identifiers with file scope > in both the ordinary and tag name spaces. Right. The kernel uses the _ prefix convention, but it can kind of get away with it, because it doesn't use the standard library. For things in userspace, _ prefixed identifiers are reserved, hence using the _ suffix instead. --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --6lCXDTVICvIQMz0h Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXIVATAAoJEGw4ysog2bOS+lAP/0XrsE+6tx72wPgXCc0ux998 mlUP+sI9u8oWUX/TV/v7XJJVTRTM3YJ+z6u9F/pXBSmPCsRPrzyBfkKXVJsgXwp3 APwHcb87mSeZIdbRsBRGOMLBQMPS/mHOIMZ/OL759hsZGAEVmOmN11Y41824FKoT C8rhUQFa7baaBylQctCPk7/JNh9k9m0TDNkSbdygpr1sHjxwKMgwSUeNNaxZa10f QASTX4yKjI+s3F94pMiVFFWSzy7z4McOuAAsjqyobajR8yU4I8B21f7jKarSLeN1 6anaJwJ6zxmz5vGYtPjS1aOj2t2POhoQAfMnE1lrbTpxA4GmlLNP2MXA/hgfaR1g umg3bsz6n8NojeWoz1121m+JOYig6sBLA5dqwV9Y0Ey2LLTqgiLN+630lpchTsre Sol6Ls+1z60sUybAJwa4+kDP2sfU6+0Rp93tFAsWjpDC2UKHIhribfcOVgUuiCbe rnGoPm7Y3yJ0vG6JdxSyrO0Ip4KRN+aREjg/uU85zEdYa+h3fthmKuaBsyhOxy4r jr0op3+snfKQeaCxts61rYmCkQ9xiLsTYPxr1wlc+5KNO6UZSlggYEqtsqu0iufs GpCiCw8vmB176RMC8xRPxFUDZU9QYNjjc0CM3xGpmxHBpq2AQSVpKhPVdh5PThax rPVCwjfuVROHVcuoh4TI =pxBV -----END PGP SIGNATURE----- --6lCXDTVICvIQMz0h--