Bug 1153579 - Fix -Wpointer-bool-conversion warning by removing null check of an array address. r=mstange

This commit is contained in:
Chris Peterson 2015-04-11 01:03:44 -07:00
Родитель 1a785adc42
Коммит 27729b2112
1 изменённых файлов: 4 добавлений и 2 удалений

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

@ -486,7 +486,6 @@ static BOOL IsActive(nsIFrame* aFrame, BOOL aIsToolbarControl)
NS_IMPL_ISUPPORTS_INHERITED(nsNativeThemeCocoa, nsNativeTheme, nsITheme) NS_IMPL_ISUPPORTS_INHERITED(nsNativeThemeCocoa, nsNativeTheme, nsITheme)
nsNativeThemeCocoa::nsNativeThemeCocoa() nsNativeThemeCocoa::nsNativeThemeCocoa()
{ {
NS_OBJC_BEGIN_TRY_ABORT_BLOCK; NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
@ -836,6 +835,8 @@ static void DrawCellWithSnapping(NSCell *cell,
// Snap to the smaller control size. // Snap to the smaller control size.
controlSize = smallerControlSize; controlSize = smallerControlSize;
sizeIndex = smallerControlSizeIndex; sizeIndex = smallerControlSizeIndex;
MOZ_ASSERT(sizeIndex < ArrayLength(settings.naturalSizes));
// Resize and center the drawRect. // Resize and center the drawRect.
if (sizes[sizeIndex].width) { if (sizes[sizeIndex].width) {
drawRect.origin.x += ceil((destRect.size.width - sizes[sizeIndex].width) / 2); drawRect.origin.x += ceil((destRect.size.width - sizes[sizeIndex].width) / 2);
@ -854,7 +855,8 @@ static void DrawCellWithSnapping(NSCell *cell,
[cell setControlSize:controlSize]; [cell setControlSize:controlSize];
NSSize minimumSize = settings.minimumSizes ? settings.minimumSizes[sizeIndex] : NSZeroSize; MOZ_ASSERT(sizeIndex < ArrayLength(settings.minimumSizes));
const NSSize minimumSize = settings.minimumSizes[sizeIndex];
DrawCellWithScaling(cell, cgContext, drawRect, controlSize, sizes[sizeIndex], DrawCellWithScaling(cell, cgContext, drawRect, controlSize, sizes[sizeIndex],
minimumSize, settings.margins, view, mirrorHorizontal); minimumSize, settings.margins, view, mirrorHorizontal);