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 <ogoffart@woboq.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
This commit is contained in:
Thiago Macieira 2013-06-28 17:09:00 -07:00 committed by The Qt Project
parent d94961d08f
commit fc4d45d97d

View File

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