Bug 755048 - Fix warnings for uninitiliazed variables and unhandled case. r=dbolter

This commit is contained in:
Hub Figuière 2012-06-18 13:14:01 -07:00
parent 8e2d02b805
commit cc4cba5587
3 changed files with 33 additions and 2 deletions

View File

@ -47,7 +47,7 @@ StyleInfo::TextIndent(nsAString& aValue)
const nsStyleCoord& styleCoord =
mStyleContext->GetStyleText()->mTextIndent;
nscoord coordVal;
nscoord coordVal = 0;
switch (styleCoord.GetUnit()) {
case eStyleUnit_Coord:
coordVal = styleCoord.GetCoordValue();
@ -62,6 +62,20 @@ StyleInfo::TextIndent(nsAString& aValue)
styleCoord.GetPercentValue());
break;
}
case eStyleUnit_Null:
case eStyleUnit_Normal:
case eStyleUnit_Auto:
case eStyleUnit_None:
case eStyleUnit_Factor:
case eStyleUnit_Degree:
case eStyleUnit_Grad:
case eStyleUnit_Radian:
case eStyleUnit_Turn:
case eStyleUnit_Integer:
case eStyleUnit_Enumerated:
case eStyleUnit_Calc:
break;
}
aValue.AppendFloat(nsPresContext::AppUnitsToFloatCSSPixels(coordVal));

View File

@ -707,6 +707,9 @@ TextAttrsMgr::TextPosTextAttr::
nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::textPosition,
NS_LITERAL_STRING("super"));
break;
case eTextPosNone:
break;
}
}
@ -754,6 +757,19 @@ TextAttrsMgr::TextPosTextAttr::
eTextPosSuper :
(coordValue < 0 ? eTextPosSub : eTextPosBaseline);
}
case eStyleUnit_Null:
case eStyleUnit_Normal:
case eStyleUnit_Auto:
case eStyleUnit_None:
case eStyleUnit_Factor:
case eStyleUnit_Degree:
case eStyleUnit_Grad:
case eStyleUnit_Radian:
case eStyleUnit_Turn:
case eStyleUnit_Integer:
case eStyleUnit_Calc:
break;
}
const nsIContent* content = aFrame->GetContent();

View File

@ -1401,7 +1401,8 @@ HTMLTableAccessible::IsProbablyLayoutTable()
// Check for styled background color across rows (alternating background
// color is a common feature for data tables).
PRUint32 childCount = ChildCount();
nscolor rowColor, prevRowColor;
nscolor rowColor = 0;
nscolor prevRowColor;
for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) {
Accessible* child = GetChildAt(childIdx);
if (child->Role() == roles::ROW) {