All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Frediano Ziglio <freddy77@gmail.com>
Cc: Wei Liu <wei.liu2@citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH 1/6] tools/libxl: Introduce min and max macros
Date: Fri, 20 Feb 2015 11:08:14 +0000	[thread overview]
Message-ID: <54E7159E.8090201@citrix.com> (raw)
In-Reply-To: <CAHt6W4f7RxHwHX4Evzav5KLh5CQAMPdWKRWE49wHSYg8H1BszQ@mail.gmail.com>

On 20/02/15 10:42, Frediano Ziglio wrote:
> 2015-02-18 16:34 GMT+00:00 Andrew Cooper <andrew.cooper3@citrix.com>:
>> diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
>> index 934465a..a2b6fb7 100644
>> --- a/tools/libxl/libxl_internal.h
>> +++ b/tools/libxl/libxl_internal.h
>> @@ -108,6 +108,22 @@
>>
>>  #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
>>
>> +#define min(X, Y) ({                             \
>> +            const typeof (X) _x = (X);           \
>> +            const typeof (Y) _y = (Y);           \
>> +            (void) (&_x == &_y);                 \
>> +            (_x < _y) ? _x : _y; })
>> +#define max(X, Y) ({                             \
>> +            const typeof (X) _x = (X);           \
>> +            const typeof (Y) _y = (Y);           \
>> +            (void) (&_x == &_y);                 \
>> +            (_x > _y) ? _x : _y; })
>> +
>> +#define min_t(type,x,y) \
>> +        ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
>> +#define max_t(type,x,y) \
>> +        ({ type __x = (x); type __y = (y); __x > __y ? __x: __y; })
>> +
> Surely nobody will complain about these defines but according to
> standard (ie https://www.securecoding.cert.org/confluence/display/seccode/DCL37-C.+Do+not+declare+or+define+a+reserved+identifier)
> identifiers that start with double underscore are reserved. Here you
> used _x, _y and __x, __y as it's a single patch make at least
> coherent.

I will adjust in v2.  No point breaking the rules given that it is
trivial to fix.

~Andrew

  reply	other threads:[~2015-02-20 11:08 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-18 16:34 [PATCH 0/6] tools/libxl: Improvements to libxl__datacopier Andrew Cooper
2015-02-18 16:34 ` [PATCH 1/6] tools/libxl: Introduce min and max macros Andrew Cooper
2015-02-20 10:24   ` Ian Campbell
2015-02-20 10:42   ` Frediano Ziglio
2015-02-20 11:08     ` Andrew Cooper [this message]
2015-02-18 16:34 ` [PATCH 2/6] tools/libxl: Update datacopier to support sending data only Andrew Cooper
2015-02-20 10:27   ` Ian Campbell
2015-02-20 11:10     ` Andrew Cooper
2015-02-20 11:13       ` Ian Campbell
2015-02-18 16:34 ` [PATCH 3/6] tools/libxl: Allow adding larger amounts of prefixdata to datacopier Andrew Cooper
2015-02-20 10:32   ` Ian Campbell
2015-02-18 16:34 ` [PATCH 4/6] tools/libxl: Allow limiting amount copied by datacopier Andrew Cooper
2015-02-20 10:33   ` Ian Campbell
2015-02-18 16:34 ` [PATCH 5/6] tools/libxl: Extend datacopier to support reading into a buffer Andrew Cooper
2015-02-20 10:34   ` Ian Campbell
2015-02-18 16:34 ` [PATCH 6/6] tools/libxl: Fix datacopier POLLHUP handling to not always be fatal Andrew Cooper
2015-02-20 10:43   ` Ian Campbell
2015-02-20 13:55     ` Andrew Cooper
2015-02-20 14:05       ` Ian Campbell
2015-03-03 18:10         ` Ian Jackson
2015-03-03 18:38           ` Andrew Cooper

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=54E7159E.8090201@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=freddy77@gmail.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.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.