[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r34145 - in trunk: . subversion www

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Tue, 11 Nov 2008 19:57:32 +0000

On Tue, 2008-11-11 at 11:39 -0800, arfrever_at_tigris.org wrote:
> (Q_): Add parenthesis around definition for consistency with definitions
> of other macros.

> -#define Q_(x1, x2, n) (n == 1) ? x1 : x2
> +#define Q_(x1, x2, n) ((n == 1) ? x1 : x2)

You should parenthesize each argument as well as the whole expression:

  (((n) == 1) ? (x1) : (x2))

Otherwise invocations such as

  Q_(item[0].is_dir ? "file" : "directory",
     "items",
     number_of_items)

would go wrong.

Thanks.
- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-11-11 20:57:50 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.