gecko-dev/hal
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 1182996 - Fix and add missing namespace comments. rs=ehsan 2015-07-13 08:25:42 -07:00
fallback Bug 1299493 - Remove Navigator.get/hasFeature(); r=baku 2016-08-31 18:02:46 -04:00
gonk Bug 1299384 - Use MOZ_MUST_USE with NS_warn_if_impl(). r=erahm. 2016-09-02 17:12:24 +10:00
linux Bug 1299493 - Remove Navigator.get/hasFeature(); r=baku 2016-08-31 18:02:46 -04:00
sandbox Bug 1297276 - Rename mfbt/unused.h to mfbt/Unused.h for consistency. r=froydnj 2016-08-24 14:47:04 +08:00
tests
windows Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
Hal.cpp Bug 1299493 - Remove Navigator.get/hasFeature(); r=baku 2016-08-31 18:02:46 -04:00
Hal.h Bug 1299493 - Remove Navigator.get/hasFeature(); r=baku 2016-08-31 18:02:46 -04:00
HalImpl.h
HalInternal.h Bug 1273079 - Use MOZ_MUST_USE in hal. r=gsvelto 2016-05-16 17:24:03 +08:00
HalLog.h Bug 1219482: Replace PRLogModuleInfo with LazyLogModule in various files.r=benjamin 2016-01-28 10:35:00 -08:00
HalSandbox.h
HalScreenConfiguration.h
HalSensor.h Bug 1182996 - Fix and add missing namespace comments. rs=ehsan 2015-07-13 08:25:42 -07:00
HalTypes.h Bug 1157030 - Stop special-casing the homescreen in the process priority manager. r=khuey, r=dhylands 2015-04-30 13:12:21 +02:00
HalWakeLock.cpp Bug 1279451 - Remove a lot of unnecessary includes of nsAutoPtr.h. rs=sparky 2016-06-07 21:10:18 +01:00
HalWakeLock.h Bug 1182996 - Fix and add missing namespace comments. rs=ehsan 2015-07-13 08:25:42 -07:00
moz.build Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
WindowIdentifier.cpp Bug 1248339 - fix header sort order of hal. r=gsvelto 2016-02-15 07:33:00 +01:00
WindowIdentifier.h Bug 1248339 - fix header sort order of hal. r=gsvelto 2016-02-15 07:33:00 +01:00