Skip to content

Commit

Permalink
Fix warnings building with --std=c++11 and gcc 8
Browse files Browse the repository at this point in the history
Silence warnings about signed constants being shifted out of int range.

Change-Id: I5dc397de71f4de09e54ce3cbc0f8e3a1cf977b03
Reviewed-by: Thiago Macieira <[email protected]>
  • Loading branch information
Allan Sandfeld Jensen committed Dec 14, 2018
1 parent e9c08f8 commit a227ea5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/corelib/io/qdebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class Q_CORE_EXPORT QDebug
void setVerbosity(int v)
{
if (context.version > 1) {
flags &= ~(VerbosityMask << VerbosityShift);
flags &= ~(uint(VerbosityMask) << VerbosityShift);
flags |= (v & VerbosityMask) << VerbosityShift;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/opengl/qgl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class QGLDefaultOverlayFormat: public QGLFormat
public:
inline QGLDefaultOverlayFormat()
{
setOption(QGL::FormatOption(0xffff << 16)); // turn off all options
setOption(QGL::FormatOption(0xffffU << 16)); // turn off all options
setOption(QGL::DirectRendering);
setPlane(1);
}
Expand Down
6 changes: 3 additions & 3 deletions src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ static void convertRGBToARGB_helper(const uchar *src, uint *dst, int width, int
uchar green = src[x + 1];
uchar blue = src[x + 1 + offs];
LcdFilter::filterPixel(red, green, blue);
*dd++ = (0xFF << 24) | (red << 16) | (green << 8) | blue;
*dd++ = (0xFFU << 24) | (red << 16) | (green << 8) | blue;
}
dst += width;
src += src_pitch;
Expand All @@ -616,7 +616,7 @@ static void convertRGBToARGB_V_helper(const uchar *src, uint *dst, int width, in
uchar green = src[x + src_pitch];
uchar blue = src[x + src_pitch + offs];
LcdFilter::filterPixel(red, green, blue);
*dst++ = (0XFF << 24) | (red << 16) | (green << 8) | blue;
*dst++ = (0XFFU << 24) | (red << 16) | (green << 8) | blue;
}
src += 3*src_pitch;
}
Expand All @@ -637,7 +637,7 @@ static inline void convertGRAYToARGB(const uchar *src, uint *dst, int width, int
const uchar * const e = p + width;
while (p < e) {
uchar gray = *p++;
*dst++ = (0xFF << 24) | (gray << 16) | (gray << 8) | gray;
*dst++ = (0xFFU << 24) | (gray << 16) | (gray << 8) | gray;
}
src += src_pitch;
}
Expand Down

0 comments on commit a227ea5

Please sign in to comment.