[patch] rename macro parameter list in cpufunc.h

Pietro Cerutti gahr at gahr.ch
Wed Dec 29 08:09:24 UTC 2010


On 2010-Dec-28, 19:20, Marius Strobl wrote:
> On Tue, Dec 28, 2010 at 01:10:50PM -0500, John Baldwin wrote:
> > On Tuesday, December 28, 2010 12:35:29 pm Marius Strobl wrote:
> > > On Tue, Dec 28, 2010 at 02:27:04PM +0100, Pietro Cerutti wrote:
> > > > Dear all,
> > > > 
> > > > sys/sparc64/include/cpufunc.h defines macro having a parameter named
> > > > 'xor'. This is a reserved keyword in C++. For this reason, it is
> > > > impossible to use this header in C++ (e.g., by including
> > > > machine/atomic.h).
> > > > 
> > > > This patch [1] renames these parameters to _xor. Please review and/or
> > > > approve (I need an explicit approval in order to commit to src).
> > > > 
> > > > Thanks!
> > > > 
> > > > Best Regards,
> > > > 
> > > > [1] http://people.freebsd.org/~gahr/cpufunc.h.diff
> > > 
> > > Hrm, I really don't like the inconsistency only renaming "xor"
> > > introduces, rototilling the whole file also seems excessive though
> > > (also that would get it closer to style(9)). Would wrapping it in
> > > __BEGIN_DECLS or something like that work as an alternate solution?
> > 
> > Not for a reserved word like 'class'.  Maybe you could rename 'xor' to 
> > something else like 'mask' instead?
> > 
> 
> The description of the assembly syntax uses "xor" so I'd prefer to keep
> the name of the parameter close to that, I'd be okay with using f.e.
> "xorval" though.

Well, I guess the choice of the name is up to you, and xorval kind of
makes sense to me. Would you like to commit it or I do?

-- 
Pietro Cerutti
The FreeBSD Project
gahr at FreeBSD.org

PGP Public Key:
http://gahr.ch/pgp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-sparc64/attachments/20101229/b999c924/attachment.pgp


More information about the freebsd-sparc64 mailing list