[Spirit2X] renaming the uint placeholder?

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[Spirit2X] renaming the uint placeholder?

Francois Barel
The unsigned int Spirit placeholder is named "uint" which, although
not a standard C++ type, is a fairly common name. The Karma
int_numerics test is failing for me on Linux gcc-4.1 because the
standard header sys/types.h contains a "typedef unsigned int uint;"
(and even without that header, I like having the same typedef in my
own projects).

This is annoying to work around since such typedefs are in global
scope. I know Spirit has a "uint_" alias that can be used instead of
"uint" -- but is it really a good thing? Since "uint" can work on some
environments but will fail on others... that means portable code
(including tests and examples) has to use "uint_" anyway (or
explicitely namespace-qualify each use of "uint").

What would you think about changing from "uint" placeholder + "uint_"
alias to just "uint_" placeholder? (and similarly renaming
"ushort"/"ulong" placeholders to "ushort_"/"ulong_" as they are also
defined in sys/types.h?)

Thanks,
François

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Spirit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-devel
Reply | Threaded
Open this post in threaded view
|

Re: [Spirit2X] renaming the uint placeholder?

Hartmut Kaiser
> The unsigned int Spirit placeholder is named "uint" which, although
> not a standard C++ type, is a fairly common name. The Karma
> int_numerics test is failing for me on Linux gcc-4.1 because the
> standard header sys/types.h contains a "typedef unsigned int uint;"
> (and even without that header, I like having the same typedef in my
> own projects).
>
> This is annoying to work around since such typedefs are in global
> scope. I know Spirit has a "uint_" alias that can be used instead of
> "uint" -- but is it really a good thing? Since "uint" can work on some
> environments but will fail on others... that means portable code
> (including tests and examples) has to use "uint_" anyway (or
> explicitely namespace-qualify each use of "uint").
>
> What would you think about changing from "uint" placeholder + "uint_"
> alias to just "uint_" placeholder? (and similarly renaming
> "ushort"/"ulong" placeholders to "ushort_"/"ulong_" as they are also
> defined in sys/types.h?)

I was thinking about this already. The only reason why I didn't go for this
was that our convention is to append the underscore for keywords only. But
OTOH, since Linux is defining uint, ushort, ulong, etc. these are equivalent
to keywords, essentially.

So I'd say, let's remove uint, et.al.

Regards Hartmut




------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Spirit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-devel
Reply | Threaded
Open this post in threaded view
|

Re: [Spirit2X] renaming the uint placeholder?

Francois Barel
Hartmut Kaiser wrote:

>> What would you think about changing from "uint" placeholder + "uint_"
>> alias to just "uint_" placeholder? (and similarly renaming
>> "ushort"/"ulong" placeholders to "ushort_"/"ulong_" as they are also
>> defined in sys/types.h?)
>
> I was thinking about this already. The only reason why I didn't go for this
> was that our convention is to append the underscore for keywords only. But
> OTOH, since Linux is defining uint, ushort, ulong, etc. these are equivalent
> to keywords, essentially.
>
> So I'd say, let's remove uint, et.al.

Done as r1148. I also did the same for placeholder "byte" (renamed to
"byte_") since it suffers from the same problem on Windows (defined in
standard header RpcNdr.h).

Regards,
François

------------------------------------------------------------------------------
_______________________________________________
Spirit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-devel
Reply | Threaded
Open this post in threaded view
|

Re: [Spirit2X] renaming the uint placeholder?

Joel de Guzman-2
Francois Barel wrote:

> Hartmut Kaiser wrote:
>>> What would you think about changing from "uint" placeholder + "uint_"
>>> alias to just "uint_" placeholder? (and similarly renaming
>>> "ushort"/"ulong" placeholders to "ushort_"/"ulong_" as they are also
>>> defined in sys/types.h?)
>> I was thinking about this already. The only reason why I didn't go for this
>> was that our convention is to append the underscore for keywords only. But
>> OTOH, since Linux is defining uint, ushort, ulong, etc. these are equivalent
>> to keywords, essentially.
>>
>> So I'd say, let's remove uint, et.al.
>
> Done as r1148. I also did the same for placeholder "byte" (renamed to
> "byte_") since it suffers from the same problem on Windows (defined in
> standard header RpcNdr.h).

I'm ok with the changes, but can we please have a 'what's changed
document' somewhere in the repo? I think it's about time. We can
start with this item and we can add more.

REgards,
--
Joel de Guzman
http://www.boostpro.com
http://spirit.sf.net


------------------------------------------------------------------------------
_______________________________________________
Spirit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-devel
Reply | Threaded
Open this post in threaded view
|

Re: [Spirit2X] renaming the uint placeholder?

Francois Barel
Joel de Guzman wrote:
> Francois Barel wrote:
>> Done as r1148. I also did the same for placeholder "byte" (renamed to
>> "byte_") since it suffers from the same problem on Windows (defined in
>> standard header RpcNdr.h).
>
> I'm ok with the changes, but can we please have a 'what's changed
> document' somewhere in the repo? I think it's about time. We can
> start with this item and we can add more.

Did you have in mind something like the attached file? I tried to only
put changes and additions to the existing API (i.e. commits which may
impact existing users/code), but not entirely new features (new
parsers/generators) or bugfixes, otherwise it would look dangerously
like the commit log :)

If you are OK with it, where should this be committed? How about
libs/spirit/ChangeLog?

Thanks,
François

------------------------------------------------------------------------------

_______________________________________________
Spirit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-devel

ChangeLog (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Spirit2X] renaming the uint placeholder?

Hartmut Kaiser
François,

> Joel de Guzman wrote:
> > Francois Barel wrote:
> >> Done as r1148. I also did the same for placeholder "byte" (renamed
> to
> >> "byte_") since it suffers from the same problem on Windows (defined
> >> in standard header RpcNdr.h).
> >
> > I'm ok with the changes, but can we please have a 'what's changed
> > document' somewhere in the repo? I think it's about time. We can
> start
> > with this item and we can add more.
>
> Did you have in mind something like the attached file? I tried to only
> put changes and additions to the existing API (i.e. commits which may
> impact existing users/code), but not entirely new features (new
> parsers/generators) or bugfixes, otherwise it would look dangerously
> like the commit log :)

That's perfect!

> If you are OK with it, where should this be committed? How about
> libs/spirit/ChangeLog?

It will end up in the what's new section of the documentation (ahem, ahem).
So, I'd say, just put it somewhere under the libs/spirit/doc folder for now.

Thank you very much!
Regards Hartmut




------------------------------------------------------------------------------
_______________________________________________
Spirit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-devel
Reply | Threaded
Open this post in threaded view
|

Re: [Spirit2X] renaming the uint placeholder?

Joel de Guzman-2
In reply to this post by Francois Barel
Francois Barel wrote:

> Joel de Guzman wrote:
>> Francois Barel wrote:
>>> Done as r1148. I also did the same for placeholder "byte" (renamed to
>>> "byte_") since it suffers from the same problem on Windows (defined in
>>> standard header RpcNdr.h).
>> I'm ok with the changes, but can we please have a 'what's changed
>> document' somewhere in the repo? I think it's about time. We can
>> start with this item and we can add more.
>
> Did you have in mind something like the attached file? I tried to only
> put changes and additions to the existing API (i.e. commits which may
> impact existing users/code), but not entirely new features (new
> parsers/generators) or bugfixes, otherwise it would look dangerously
> like the commit log :)
>
> If you are OK with it, where should this be committed? How about
> libs/spirit/ChangeLog?

Looks good! Thanks!

Regards,
--
Joel de Guzman
http://www.boostpro.com
http://spirit.sf.net


------------------------------------------------------------------------------
_______________________________________________
Spirit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-devel
Reply | Threaded
Open this post in threaded view
|

Re: [Spirit2X] renaming the uint placeholder?

Francois Barel
In reply to this post by Hartmut Kaiser
Hartmut Kaiser wrote:
> It will end up in the what's new section of the documentation (ahem, ahem).
> So, I'd say, just put it somewhere under the libs/spirit/doc folder for now.

Done in r1150, as libs/spirit/doc/Changes.

Regards,
François

------------------------------------------------------------------------------
_______________________________________________
Spirit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-devel
Reply | Threaded
Open this post in threaded view
|

Re: [Spirit2X] renaming the uint placeholder?

Hartmut Kaiser
> > It will end up in the what's new section of the documentation (ahem,
> ahem).
> > So, I'd say, just put it somewhere under the libs/spirit/doc folder
> for now.
>
> Done in r1150, as libs/spirit/doc/Changes.

Thanks!
Regards Hartmut


------------------------------------------------------------------------------
_______________________________________________
Spirit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-devel