Bug 793880 - Fix the assertion in nsCSSSelector::SetPseudoType to shut up the compiler warning; r=dholbert

--HG--
extra : rebase_source : 058dcc17c37915fa9937f7eafb1b3a93b78384f2
This commit is contained in:
Ehsan Akhgari 2012-10-02 15:50:50 -04:00
Родитель 144130a844
Коммит ec1aa47e36
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -183,7 +183,9 @@ public:
return static_cast<nsCSSPseudoElements::Type>(mPseudoType); return static_cast<nsCSSPseudoElements::Type>(mPseudoType);
} }
void SetPseudoType(nsCSSPseudoElements::Type aType) { void SetPseudoType(nsCSSPseudoElements::Type aType) {
NS_ASSERTION(aType > INT16_MIN && aType < INT16_MAX, "Out of bounds"); NS_ASSERTION(static_cast<int32_t>(aType) >= INT16_MIN &&
static_cast<int32_t>(aType) <= INT16_MAX,
"Out of bounds - this will overflow mPseudoType");
mPseudoType = static_cast<int16_t>(aType); mPseudoType = static_cast<int16_t>(aType);
} }