Avoid warnings regarding bit-field signedness

Up to (including) C++11, integral bitfields of unspecified signedness have
implementation dependent signedness.

Detected by LGTM.com static analyzer.

Pick-to: 5.15
Change-Id: Ibaa0fdc6e443495a3cd40330c4573c9cc6ccdf5b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Dimitrios Apostolou 2020-07-04 05:28:39 +02:00
parent 273be0b9e6
commit 3da9cff845
4 changed files with 5 additions and 5 deletions

View File

@ -152,7 +152,7 @@ public:
uint id = 0;
ushort method_offset;
ushort method_relative;
int signal_index : 27; // In signal range (see QObjectPrivate::signalIndex())
signed int signal_index : 27; // In signal range (see QObjectPrivate::signalIndex())
ushort connectionType : 3; // 0 == auto, 1 == direct, 2 == queued, 4 == blocking
ushort isSlotObject : 1;
ushort ownArgumentTypes : 1;

View File

@ -349,8 +349,8 @@ struct QSpanData
ConicalGradient,
Texture
} type : 8;
int txop : 8;
int fast_matrix : 1;
signed int txop : 8;
uint fast_matrix : 1;
bool bilinear;
QImage *tempImage;
QRgba64 solidColor;

View File

@ -97,7 +97,7 @@ struct QFontDef
uint hintingPreference : 2;
uint ignorePitch : 1;
uint fixedPitchComputed : 1; // for Mac OS X only
int reserved : 14; // for future extensions
uint reserved : 14; // for future extensions
bool exactMatch(const QFontDef &other) const;
bool operator==(const QFontDef &other) const

View File

@ -113,7 +113,7 @@ public:
mutable QTextLayout *layout;
mutable QTextBlockUserData *userData;
mutable int userState;
mutable int revision : 31;
mutable signed int revision : 31;
mutable uint hidden : 1;
};