From fa48ec17dc96a4059e3c7700fdcaa00242960172 Mon Sep 17 00:00:00 2001 From: Chris Peterson Date: Wed, 3 Jun 2015 23:13:42 -0700 Subject: [PATCH] Bug 1194954 - Fix -Wunreachable-code warnings in gfx/layers and gfx/thebes. r=BenWa --- gfx/layers/LayerTreeInvalidation.cpp | 8 ++++++-- gfx/thebes/gfxPlatform.cpp | 9 +-------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/gfx/layers/LayerTreeInvalidation.cpp b/gfx/layers/LayerTreeInvalidation.cpp index 531f04ebc611..b0d5cc6d593f 100644 --- a/gfx/layers/LayerTreeInvalidation.cpp +++ b/gfx/layers/LayerTreeInvalidation.cpp @@ -483,11 +483,15 @@ CloneLayerTreePropertiesInternal(Layer* aRoot, bool aIsMask /* = false */) return MakeUnique(static_cast(aRoot)); case Layer::TYPE_IMAGE: return MakeUnique(static_cast(aRoot), aIsMask); - default: + case Layer::TYPE_CANVAS: + case Layer::TYPE_READBACK: + case Layer::TYPE_SHADOW: + case Layer::TYPE_PAINTED: return MakeUnique(aRoot); } - return UniquePtr(nullptr); + MOZ_ASSERT_UNREACHABLE("Unexpected root layer type"); + return MakeUnique(aRoot); } /* static */ UniquePtr diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp index dc5824606ef1..bef8e712846f 100644 --- a/gfx/thebes/gfxPlatform.cpp +++ b/gfx/thebes/gfxPlatform.cpp @@ -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; }