gecko-dev/dom/gamepad
Nicholas Nethercote 34dcc7b852 Bug 1299384 - Use MOZ_MUST_USE with NS_warn_if_impl(). r=erahm.
This change avoids lots of false positives for Coverity's CHECKED_RETURN
warning, caused by NS_WARN_IF's current use in both statement-style and
expression-style.

In the case where the code within the NS_WARN_IF has side-effects, I made the
following change.

> NS_WARN_IF(NS_FAILED(FunctionWithSideEffects()));
> -->
> Unused << NS_WARN_IF(NS_FAILED(FunctionWithSideEffects()));

In the case where the code within the NS_WARN_IF lacks side-effects, I made the
following change.

> NS_WARN_IF(!condWithoutSideEffects);
> -->
> NS_WARNING_ASSERTION(condWithoutSideEffects, "msg");

This has two improvements.
- The condition is not evaluated in non-debug builds.
- The sense of the condition is inverted to the familiar "this condition should
  be true" sense used in assertions.

A common variation on the side-effect-free case is the following.

> nsresult rv = Fn();
> NS_WARN_IF_(NS_FAILED(rv));
> -->
> DebugOnly<nsresult rv> = Fn();
> NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "Fn failed");

--HG--
extra : rebase_source : 58788245021096efa8372a9dc1d597a611d45611
2016-09-02 17:12:24 +10:00
..
android Bug 1292323 - Update usage of UsesNativeCallProxy; r=snorp 2016-08-12 23:15:53 -04:00
cocoa Bug 1221730 - Postpone singleton release in GamepadPlatformService::MaybeShutdown. r=baku 2016-06-28 00:27:00 +02:00
fallback Bug 1152551, part 3 - Fix more mode lines in dom/. r=jst 2015-05-03 15:32:37 -04:00
ipc Bug 1299384 - Use MOZ_MUST_USE with NS_warn_if_impl(). r=erahm. 2016-09-02 17:12:24 +10:00
linux Bug 1221730 - Postpone singleton release in GamepadPlatformService::MaybeShutdown. r=baku 2016-06-28 00:27:00 +02:00
windows Bug 1291988 - Allow arbitrary number of axes/buttons in Windows Gamepad API; r=ted r=cleu 2016-08-08 15:58:05 -07:00
Gamepad.cpp Bug 1279451 - Remove a lot of unnecessary includes of nsAutoPtr.h. rs=sparky 2016-06-07 21:10:18 +01:00
Gamepad.h Bug 1278838 - Remove separate worker binding for Performance API, r=smaug 2016-06-09 19:04:42 +02:00
GamepadButton.cpp Bug 1152551, part 2 - Fix mode lines in dom/. r=jst 2015-05-03 15:32:37 -04:00
GamepadButton.h Bug 1152551, part 2 - Fix mode lines in dom/. r=jst 2015-05-03 15:32:37 -04:00
GamepadManager.cpp Bug 1297276 - Rename mfbt/unused.h to mfbt/Unused.h for consistency. r=froydnj 2016-08-24 14:47:04 +08:00
GamepadManager.h Bug 1221730 - Move gamepad API to PBackground. r=qdot, r=baku 2016-06-28 00:25:00 +02:00
GamepadMonitoring.cpp Bug 1221730 - Postpone singleton release in GamepadPlatformService::MaybeShutdown. r=baku 2016-06-28 00:27:00 +02:00
GamepadMonitoring.h Bug 1152551, part 3 - Fix more mode lines in dom/. r=jst 2015-05-03 15:32:37 -04:00
GamepadPlatformService.cpp Bug 1297276 - Rename mfbt/unused.h to mfbt/Unused.h for consistency. r=froydnj 2016-08-24 14:47:04 +08:00
GamepadPlatformService.h Bug 1221730 - Postpone singleton release in GamepadPlatformService::MaybeShutdown. r=baku 2016-06-28 00:27:00 +02:00
GamepadService.cpp Bug 1279451 - Remove a lot of unnecessary includes of nsAutoPtr.h. rs=sparky 2016-06-07 21:10:18 +01:00
GamepadService.h Bug 1279451 - Remove a lot of unnecessary includes of nsAutoPtr.h. rs=sparky 2016-06-07 21:10:18 +01:00
GamepadServiceTest.cpp Bug 1297276 - Rename mfbt/unused.h to mfbt/Unused.h for consistency. r=froydnj 2016-08-24 14:47:04 +08:00
GamepadServiceTest.h Bug 1221730 - Change GamepadServiceTest into webidl. r=qdot, r=baku 2016-06-28 00:26:00 +02:00
moz.build Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00