Commit Graph

5 Commits

Author SHA1 Message Date
Nicholas Nethercote
b5810a1eb4 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");
2016-09-02 17:12:24 +10:00
Justin D'Arcangelo
76d6ee2b4b Bug 1272101 - Changes in preparation for FlyWeb landing. Add JS implementation of nsDNSServiceDiscovery. r=hurley 2016-06-01 16:22:27 -04:00
Kannan Vijayan
66c4947fb0 Bug 1233813 - Fix mDNS bug in resolving services with no TXT records. r=schien 2015-12-22 16:24:56 -05:00
Kershaw Chang
6e6a00f2c2 Bug 1200132 - Part1: Get address info after service resolved, r=mcmanus 2015-10-21 02:51:00 +02:00
Liang-Heng Chen
584515ed5a Bug 1115480 - Part 1: Implement XPCOM module for mDNSProvider. r=mcmanus 2015-05-20 23:06:00 -04:00