From ed9a366c06f316bee4e7531e1127d422f44fa43b Mon Sep 17 00:00:00 2001 From: Daniel Holbert Date: Mon, 5 Aug 2013 12:45:50 -0400 Subject: [PATCH] Bug 901529: Declare bitmask as uint16_t, rather than implicitly as a signed short function-arg, to fix "truncation of constant value" build warning. r=jlebar --- content/base/src/nsTextFragmentSSE2.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/content/base/src/nsTextFragmentSSE2.cpp b/content/base/src/nsTextFragmentSSE2.cpp index df0aa37d2aad..efdf567c72c9 100644 --- a/content/base/src/nsTextFragmentSSE2.cpp +++ b/content/base/src/nsTextFragmentSSE2.cpp @@ -42,7 +42,8 @@ FirstNon8Bit(const PRUnichar *str, const PRUnichar *end) // Check one XMM register (16 bytes) at a time. const int32_t vectWalkEnd = ((len - i) / numUnicharsPerVector) * numUnicharsPerVector; - __m128i vectmask = _mm_set1_epi16(0xff00); + const uint16_t shortMask = 0xff00; + __m128i vectmask = _mm_set1_epi16(static_cast(shortMask)); for(; i < vectWalkEnd; i += numUnicharsPerVector) { const __m128i vect = *reinterpret_cast(str + i); if (!is_zero(_mm_and_si128(vect, vectmask)))