From 4743ce02cd90c6b6286446976571aa645e943d35 Mon Sep 17 00:00:00 2001 From: Wei-Cheng Pan Date: Mon, 16 May 2016 17:24:03 +0800 Subject: [PATCH] Bug 1273079 - Use MOZ_MUST_USE in hal. r=gsvelto MozReview-Commit-ID: 7VLDpz34DRu --HG-- extra : transplant_source : O%9DK%DCOc%D8%CB%FD%EFf%04%C4%B4%DA%A2x%FF%88%99 --- dom/base/ScreenOrientation.cpp | 3 ++- hal/Hal.h | 8 ++++---- hal/HalInternal.h | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/dom/base/ScreenOrientation.cpp b/dom/base/ScreenOrientation.cpp index 4036399a09ad..0535324351e8 100644 --- a/dom/base/ScreenOrientation.cpp +++ b/dom/base/ScreenOrientation.cpp @@ -553,7 +553,8 @@ ScreenOrientation::UpdateActiveOrientationLock(ScreenOrientationInternal aOrient if (aOrientation == eScreenOrientation_None) { hal::UnlockScreenOrientation(); } else { - hal::LockScreenOrientation(aOrientation); + bool rv = hal::LockScreenOrientation(aOrientation); + NS_WARN_IF(!rv); } } diff --git a/hal/Hal.h b/hal/Hal.h index 88fd97ff0a56..61560766bb08 100644 --- a/hal/Hal.h +++ b/hal/Hal.h @@ -394,7 +394,7 @@ void NotifyScreenConfigurationChange(const hal::ScreenConfiguration& aScreenConf * Lock the screen orientation to the specific orientation. * @return Whether the lock has been accepted. */ -bool LockScreenOrientation(const dom::ScreenOrientationInternal& aOrientation); +MOZ_MUST_USE bool LockScreenOrientation(const dom::ScreenOrientationInternal& aOrientation); /** * Unlock the screen orientation. @@ -438,7 +438,7 @@ void NotifySwitchStateFromInputDevice(hal::SwitchDevice aDevice, * * Currently, there can only be 0 or 1 alarm observers. */ -bool RegisterTheOneAlarmObserver(hal::AlarmObserver* aObserver); +MOZ_MUST_USE bool RegisterTheOneAlarmObserver(hal::AlarmObserver* aObserver); /** * Unregister the alarm observer. Doing so will implicitly cancel any @@ -465,7 +465,7 @@ void NotifyAlarmFired(); * This API is currently only allowed to be used from non-sandboxed * contexts. */ -bool SetAlarm(int32_t aSeconds, int32_t aNanoseconds); +MOZ_MUST_USE bool SetAlarm(int32_t aSeconds, int32_t aNanoseconds); /** * Set the priority of the given process. @@ -585,7 +585,7 @@ hal::FMRadioSettings GetFMBandSettings(hal::FMRadioCountry aCountry); /** * Enable RDS data reception */ -bool EnableRDS(uint32_t aMask); +MOZ_MUST_USE bool EnableRDS(uint32_t aMask); /** * Disable RDS data reception diff --git a/hal/HalInternal.h b/hal/HalInternal.h index 50ea373363d7..d93023dd0da8 100644 --- a/hal/HalInternal.h +++ b/hal/HalInternal.h @@ -67,7 +67,7 @@ void DisableSwitchNotifications(hal::SwitchDevice aDevice); /** * Enable alarm notifications from the backend. */ -bool EnableAlarm(); +MOZ_MUST_USE bool EnableAlarm(); /** * Disable alarm notifications from the backend.