Bug 1194954 - Fix -Wunreachable-code warnings in gfx/layers and gfx/thebes. r=BenWa

This commit is contained in:
Chris Peterson 2015-06-03 23:13:42 -07:00
parent eeff0eb6dd
commit 4fb40eb48a
2 changed files with 7 additions and 10 deletions

View File

@ -483,11 +483,15 @@ CloneLayerTreePropertiesInternal(Layer* aRoot, bool aIsMask /* = false */)
return MakeUnique<ColorLayerProperties>(static_cast<ColorLayer*>(aRoot));
case Layer::TYPE_IMAGE:
return MakeUnique<ImageLayerProperties>(static_cast<ImageLayer*>(aRoot), aIsMask);
default:
case Layer::TYPE_CANVAS:
case Layer::TYPE_READBACK:
case Layer::TYPE_SHADOW:
case Layer::TYPE_PAINTED:
return MakeUnique<LayerPropertiesBase>(aRoot);
}
return UniquePtr<LayerPropertiesBase>(nullptr);
MOZ_ASSERT_UNREACHABLE("Unexpected root layer type");
return MakeUnique<LayerPropertiesBase>(aRoot);
}
/* static */ UniquePtr<LayerProperties>

View File

@ -2065,26 +2065,19 @@ gfxPlatform::GetLog(eGfxLog aWhichLog)
switch (aWhichLog) {
case eGfxLog_fontlist:
return sFontlistLog;
break;
case eGfxLog_fontinit:
return sFontInitLog;
break;
case eGfxLog_textrun:
return sTextrunLog;
break;
case eGfxLog_textrunui:
return sTextrunuiLog;
break;
case eGfxLog_cmapdata:
return sCmapDataLog;
break;
case eGfxLog_textperf:
return sTextPerfLog;
break;
default:
break;
}
MOZ_ASSERT_UNREACHABLE("Unexpected log type");
return nullptr;
}