From: malc <av1474@comtv.ru>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 1/5] CODING_STYLE: add preprocessor rules
Date: Thu, 12 Aug 2010 22:47:14 +0400 (MSD) [thread overview]
Message-ID: <alpine.LNX.2.00.1008122245420.1975@linmac> (raw)
In-Reply-To: <AANLkTikqSLRUw9WYVQoA9tbaaa9tgNjYmrRV-EEv7DbW@mail.gmail.com>
On Thu, 12 Aug 2010, Blue Swirl wrote:
> Add preprocessor rules from libvirt HACKING.
>
> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
> ---
> CODING_STYLE | 13 +++++++++++++
> 1 files changed, 13 insertions(+), 0 deletions(-)
>
> diff --git a/CODING_STYLE b/CODING_STYLE
> index 92036f3..c4c09ab 100644
> --- a/CODING_STYLE
> +++ b/CODING_STYLE
> @@ -79,3 +79,16 @@ and clarity it comes on a line by itself:
> Rationale: a consistent (except for functions...) bracing style reduces
> ambiguity and avoids needless churn when lines are added or removed.
> Furthermore, it is the QEMU coding style.
> +
> +5. Preprocessor
> +
> +For variadic macros, stick with C99 syntax:
> +
> +#define vshPrint(_ctl, ...) fprintf(stdout, __VA_ARGS__)
_ctl is not used inside the macro expansion, furthermore i'd avoid
using leading underscore even for macro arguments.
> +
> +Use parenthesis when checking if a macro is defined, and use
> +indentation to track nesting:
> +
> +#if defined(HAVE_POSIX_FALLOCATE) && !defined(HAVE_FALLOCATE)
> +# define fallocate(a,ignored,b,c) posix_fallocate(a,b,c)
> +#endif
>
--
mailto:av1474@comtv.ru
next prev parent reply other threads:[~2010-08-12 18:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-12 17:49 [Qemu-devel] [PATCH 1/5] CODING_STYLE: add preprocessor rules Blue Swirl
2010-08-12 18:47 ` malc [this message]
2010-08-13 16:56 ` Blue Swirl
2010-08-14 14:27 ` Andreas Färber
2010-08-15 7:46 ` Blue Swirl
2010-08-15 7:59 ` Andreas Färber
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=alpine.LNX.2.00.1008122245420.1975@linmac \
--to=av1474@comtv.ru \
--cc=blauwirbel@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).