Fix warnings building with --std=c++11 and gcc 8

Silence warnings about signed constants being shifted out of int range.

Change-Id: I5dc397de71f4de09e54ce3cbc0f8e3a1cf977b03
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Allan Sandfeld Jensen 2018-12-10 15:18:07 +01:00
parent e9c08f8287
commit a227ea5bd5
3 changed files with 5 additions and 5 deletions

View File

@ -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;
}
}

View File

@ -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);
}

View File

@ -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;
@ -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;
}
@ -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;
}