From fc4d45d97d7a971aa179f73d41455544b400e960 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 28 Jun 2013 17:09:00 -0700 Subject: [PATCH] Fix change-of-sign warning found by ICC qstring.cpp(3896): error #68: integer conversion resulted in a change of sign The line before also had 0x8000, but since there was no addition, 0x8000 was a literal converted to short. However, 0xff + 0x8000 is an int, and 0x80ff is positive, while short(0x80ff) is negative. Change-Id: I445ff401d817b643479e54320525890ce12bbfe5 Reviewed-by: Olivier Goffart Reviewed-by: Robin Burchell Reviewed-by: Frederik Gladhorn --- src/corelib/tools/qstring.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index de09e5bbe0..37d28b0904 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -3873,7 +3873,7 @@ static inline __m128i mergeQuestionMarks(__m128i chunk) // SSE has no compare instruction for unsigned comparison. // The variables must be shiffted + 0x8000 to be compared const __m128i signedBitOffset = _mm_set1_epi16(0x8000); - const __m128i thresholdMask = _mm_set1_epi16(0xff + 0x8000); + const __m128i thresholdMask = _mm_set1_epi16(short(0xff + 0x8000)); const __m128i signedChunk = _mm_add_epi16(chunk, signedBitOffset); const __m128i offLimitMask = _mm_cmpgt_epi16(signedChunk, thresholdMask);