[Development] Changing qreal to a float
thiago.macieira at intel.com
Wed Feb 15 13:01:12 CET 2012
On quarta-feira, 15 de fevereiro de 2012 12.11.27, Olivier Goffart wrote:
> Then I tought about Qt has its own typedef for quintptr and quint64 and what
> not, so we could as well keep qreal.
> (But i'm far from being opposed, but then we can also deprecate all the
> other ones)
Those have other reasons for being.
qint64 exists because it's "long long" on most platforms and compilers, except
for MSVC. On that case, it's __int64. The standard type "long long" is
available only on C++11.
quintptr has no standard type to match. qptrdiff has one: ptrdiff_t. The closest
to quintptr is size_t. That one has a different problem though: it's not
exactly the same type as our quint64, since GCC defines it to "unsigned long",
not "unsigned long long", on 64-bit platforms. We have avoided using "long" in
Qt 4, so this type would suffer from even more template issues.
Also, both size_t and ptrdiff_t require an #include.
PS: $ gcc -fsyntax-only -xc++ - <<<'long long long x;'
<stdin>:1:1: error: ‘long long long’ is too long for GCC
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
Intel Sweden AB - Registration Number: 556189-6027
Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 190 bytes
Desc: This is a digitally signed message part.
More information about the Development