From 44d581458a1d2a0ea58a46cf00a3df5aa0f59bc7 Mon Sep 17 00:00:00 2001 From: Chris Peterson Date: Sun, 8 Nov 2015 22:46:00 -0800 Subject: [PATCH] Bug 1223258 - Fix -Wunreachable-code warnings in widget. r=masayuki widget/tests/TestAppShellSteadyState.cpp:397:5: warning: code will never be executed [-Wunreachable-code] widget\widgetutils.cpp(95) : warning C4702: unreachable code widget\mouseevents.h(97) : warning C4702: unreachable code widget\textevents.h(492) : warning C4702: unreachable code --- widget/MouseEvents.h | 1 - widget/TextEvents.h | 1 - widget/WidgetUtils.cpp | 1 - widget/tests/TestAppShellSteadyState.cpp | 4 ++-- 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/widget/MouseEvents.h b/widget/MouseEvents.h index c913af299510..f4056c67010b 100644 --- a/widget/MouseEvents.h +++ b/widget/MouseEvents.h @@ -94,7 +94,6 @@ public: virtual WidgetEvent* Duplicate() const override { MOZ_CRASH("WidgetMouseEventBase must not be most-subclass"); - return nullptr; } /// The possible related target diff --git a/widget/TextEvents.h b/widget/TextEvents.h index 53a4fe1bd5ce..15f112ac3d15 100644 --- a/widget/TextEvents.h +++ b/widget/TextEvents.h @@ -489,7 +489,6 @@ public: NS_ASSERTION(!IsAllowedToDispatchDOMEvent(), "WidgetQueryContentEvent needs to support Duplicate()"); MOZ_CRASH("WidgetQueryContentEvent doesn't support Duplicate()"); - return nullptr; } void InitForQueryTextContent(uint32_t aOffset, uint32_t aLength, diff --git a/widget/WidgetUtils.cpp b/widget/WidgetUtils.cpp index fe15181d0210..95bbb8475f43 100644 --- a/widget/WidgetUtils.cpp +++ b/widget/WidgetUtils.cpp @@ -92,7 +92,6 @@ nsIntRect RotateRect(nsIntRect aRect, aRect.height, aRect.width); default: MOZ_CRASH("Unknown rotation"); - return aRect; } } diff --git a/widget/tests/TestAppShellSteadyState.cpp b/widget/tests/TestAppShellSteadyState.cpp index 8156335c97a9..b7e05a976c00 100644 --- a/widget/tests/TestAppShellSteadyState.cpp +++ b/widget/tests/TestAppShellSteadyState.cpp @@ -391,8 +391,7 @@ Test4Internal(nsIAppShell* aAppShell) #ifndef XP_WIN // Not sure how to test on other platforms. return false; -#endif - +#else nsCOMPtr appService = do_GetService(NS_APPSHELLSERVICE_CONTRACTID); if (!appService) { @@ -437,6 +436,7 @@ Test4Internal(nsIAppShell* aAppShell) } return true; +#endif } void