All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH v2 4/8] qnum: qnum_value_is_equal() function
Date: Fri, 20 Nov 2020 07:52:31 +0100	[thread overview]
Message-ID: <871rgo8qq8.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20201119182403.GY1509407@habkost.net> (Eduardo Habkost's message of "Thu, 19 Nov 2020 13:24:03 -0500")

Eduardo Habkost <ehabkost@redhat.com> writes:

> On Thu, Nov 19, 2020 at 11:27:40AM +0100, Markus Armbruster wrote:
> [...]
>> > +bool qnum_is_equal(const QObject *x, const QObject *y)
>> > +{
>> > +    const QNum *qnum_x = qobject_to(QNum, x);
>> > +    const QNum *qnum_y = qobject_to(QNum, y);
>> 
>> Humor me: blank line between declarations and statements, please.
>
> I can do it.  But why do you prefer it that way?

Habit borne out of C lacking other visual cues to distinguish
declarations and statements.

Declaration or statement?  Tell me quick, don't analyze!

    mumble(*mutter)();

This "obviously" declares @mutter as pointer to function returning
mumble.

Except when @mumble isn't a typedef name, but a function taking one
argument and returning a function that takes no argument.  Then it
passes *mutter to mumble(), and calls its return value.

The whole point of coding style is to help readers along.  Two stylistic
conventions that can help here:

1. In a function call, no space between the expression denoting the
   called function and the (parenthesized) argument list.  Elsewhere,
   space.

   So, when the example above is indeed a declaration, write it as

        mumble (*mutter)();

   If it's function calls, write it as

        mumble(*mutter)();

2. Separate declarations from statements with a blank line.  Do not mix
   them.

[...]



  reply	other threads:[~2020-11-20  6:54 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-16 22:41 [PATCH v2 0/8] qom: Use qlit to represent property defaults Eduardo Habkost
2020-11-16 22:41 ` [PATCH v2 1/8] qobject: Include API docs in docs/devel/qobject.html Eduardo Habkost
2020-11-17  8:23   ` Marc-André Lureau
2020-11-19  9:37   ` Markus Armbruster
2020-11-19 18:03     ` Eduardo Habkost
2020-11-16 22:41 ` [PATCH v2 2/8] qnum: Make qnum_get_double() get const pointer Eduardo Habkost
2020-11-17  8:26   ` Marc-André Lureau
2020-11-16 22:41 ` [PATCH v2 3/8] qnum: QNumValue type for QNum value literals Eduardo Habkost
2020-11-17  8:37   ` Marc-André Lureau
2020-11-17 14:42     ` Eduardo Habkost
2020-11-17 14:58       ` Marc-André Lureau
2020-11-19 10:24         ` Markus Armbruster
2020-11-19 18:21           ` Eduardo Habkost
2020-11-19 20:55             ` Eduardo Habkost
2020-11-20  9:05               ` Markus Armbruster
2020-11-20  5:29             ` Markus Armbruster
2020-11-20 18:27               ` Eduardo Habkost
2020-11-23  7:51                 ` Markus Armbruster
2020-11-23 18:33                   ` Eduardo Habkost
2020-11-24  8:49                     ` Markus Armbruster
2020-11-24 14:41                       ` Eduardo Habkost
2020-11-24 15:20                         ` Markus Armbruster
2020-11-24 15:29                           ` Eduardo Habkost
2020-11-25  6:40                             ` Markus Armbruster
2020-11-25 15:01                               ` Eduardo Habkost
2020-11-16 22:41 ` [PATCH v2 4/8] qnum: qnum_value_is_equal() function Eduardo Habkost
2020-11-17  8:42   ` Marc-André Lureau
2020-11-17 15:49     ` Eduardo Habkost
2020-11-17 16:53       ` Marc-André Lureau
2020-11-17 17:21         ` Eduardo Habkost
2020-11-19 10:27   ` Markus Armbruster
2020-11-19 18:24     ` Eduardo Habkost
2020-11-20  6:52       ` Markus Armbruster [this message]
2020-11-20 18:22         ` Eduardo Habkost
2020-11-23  8:17           ` Markus Armbruster
2020-11-16 22:41 ` [PATCH v2 5/8] qlit: Support all types of QNums Eduardo Habkost
2020-11-17  8:52   ` Marc-André Lureau
2020-11-19 10:39     ` Markus Armbruster
2020-11-19 18:56       ` Eduardo Habkost
2020-11-20  6:55         ` Markus Armbruster
2020-11-16 22:41 ` [PATCH v2 6/8] qlit: qlit_type() function Eduardo Habkost
2020-11-17  8:53   ` Marc-André Lureau
2020-11-19 10:41   ` Markus Armbruster
2020-11-19 17:56     ` Eduardo Habkost
2020-11-16 22:41 ` [PATCH v2 7/8] qom: Make object_property_set_default() public Eduardo Habkost
2020-11-17  8:56   ` Marc-André Lureau
2020-11-16 22:41 ` [PATCH v2 8/8] qom: Use qlit to represent property defaults Eduardo Habkost
2020-11-17  9:02   ` Marc-André Lureau
2020-11-19 12:39 ` [PATCH v2 0/8] " Markus Armbruster
2020-11-19 17:13   ` Eduardo Habkost
2020-11-19 17:23     ` Paolo Bonzini
2020-11-19 17:55       ` Eduardo Habkost
2020-11-19 18:25         ` Paolo Bonzini
2020-11-19 19:05           ` Eduardo Habkost

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871rgo8qq8.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.