Bug 918176 - Silence uninitialized variable warning in nsRuleNode::ComputeContentData. r=dholbert

This commit is contained in:
Cameron McCormack 2013-09-20 11:24:04 +10:00
parent 96b42ba383
commit 464d030850
3 changed files with 9 additions and 2 deletions

View File

@ -1643,6 +1643,10 @@ nsCSSFrameConstructor::CreateGeneratedContent(nsFrameConstructorState& aState,
break; break;
} }
case eStyleContentType_Uninitialized:
NS_NOTREACHED("uninitialized content type");
return nullptr;
} // switch } // switch
return nullptr; return nullptr;

View File

@ -6994,10 +6994,12 @@ nsRuleNode::ComputeContentData(void* aStartStruct,
type = eStyleContentType_NoCloseQuote; break; type = eStyleContentType_NoCloseQuote; break;
default: default:
NS_ERROR("bad content value"); NS_ERROR("bad content value");
type = eStyleContentType_Uninitialized;
} }
break; break;
default: default:
NS_ERROR("bad content type"); NS_ERROR("bad content type");
type = eStyleContentType_Uninitialized;
} }
data.mType = type; data.mType = type;
if (type == eStyleContentType_Image) { if (type == eStyleContentType_Image) {

View File

@ -1887,7 +1887,8 @@ enum nsStyleContentType {
eStyleContentType_CloseQuote = 41, eStyleContentType_CloseQuote = 41,
eStyleContentType_NoOpenQuote = 42, eStyleContentType_NoOpenQuote = 42,
eStyleContentType_NoCloseQuote = 43, eStyleContentType_NoCloseQuote = 43,
eStyleContentType_AltContent = 50 eStyleContentType_AltContent = 50,
eStyleContentType_Uninitialized
}; };
struct nsStyleContentData { struct nsStyleContentData {
@ -1902,7 +1903,7 @@ struct nsStyleContentData {
#endif #endif
nsStyleContentData() nsStyleContentData()
: mType(nsStyleContentType(0)) : mType(eStyleContentType_Uninitialized)
#ifdef DEBUG #ifdef DEBUG
, mImageTracked(false) , mImageTracked(false)
#endif #endif