[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: Usage of INT_MAX, etc.
From:       Simon Hausmann <hausmann () kde ! org>
Date:       2006-10-25 6:00:47
Message-ID: 200610250800.48068.hausmann () kde ! org
[Download RAW message or body]


On Wednesday 25. October 2006 00:28, Thiago Macieira wrote:
> Jaroslaw Staniek wrote:
> >What I now propose is to make docs and function signatures shorter by
> > defining things like
> >
> >   #define INT32_MAX numeric_limit<int32_t>::max()
>
> Only in docs.
>
> Don't define that in C++ code, since that requires int32_t, which isn't
> always present. It also requires #include <limits> and "using namespace
> std;"
>
> Also note that you don't need to define INT32_MAX to a call to
> numeric_limit::max. For 32 bits exactly, MAX is (2^31)-1 and MIN
> is -(2^31).
>
> So I feel this #define is unnecessary.

I agree with Thiago. I don't see what problem it actually solves, since int is 
32 bit on all platforms we support.

Simon

[Attachment #3 (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic