[Development] Qt 5.2 header diff: QtGui
Hausmann Simon
Simon.Hausmann at digia.com
Tue Nov 5 15:24:13 CET 2013
Thankfully we don't bother with platforms where sizeof(int)! = 4. But out of curiosity, which platforms nowadays use for example smaller sizes? Some 16-bit micro controllers?
Simon
Fra: Giuseppe D'Angelo
Sendt: 02:32 tirsdag 5. november 2013
Til: development at qt-project.org
Emne: Re: [Development] Qt 5.2 header diff: QtGui
Il 05/11/2013 11:22, Marc Mutz ha scritto:
> On Tuesday, November 05, 2013 01:07:32 Thiago Macieira wrote:
>> @@ -206,7 +212,8 @@ protected:
>> int qt4D;
>> Qt::Orientation qt4O;
>> Qt::MouseButtons mouseState;
>> - int reserved;
>> + uint ph : 2;
>> + int reserved : 30;
>> };
>> #endif
>
> is sizeof(int) == 4 everywhere?
Not everywhere but on all platforms supported by Qt.
>> --- a/src/gui/text/qtextoption.h
>> +++ b/src/gui/text/qtextoption.h
>>
>> @@ -134,7 +134,8 @@ private:
>> uint wordWrap : 4;
>> uint design : 1;
>> uint direction : 2;
>>
>> - uint unused : 18;
>> + uint unused : 17;
>> + uint unused2; // ### Qt 6: remove unnecessary, extra 32 bits
>>
>> uint f;
>> qreal tab;
>> QTextOptionPrivate *d;
>
> Overflown bit field? And the same question as above...
Yes, that was the issue. 8+4+2+1+18 = 33 bits, i.e. the compiler will
allocate 2x32bit ints to store them, instead of the needed one...
--
Join us at Qt Developer Days 2013! - https://devdays.kdab.com
Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Software Engineer
KDAB (UK) Ltd., a KDAB Group company
Tel. UK +44-1738-450410, Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-independent software solutions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20131105/85c7278c/attachment.html>
More information about the Development
mailing list