Re: Please use NS_WARN_IF instead of NS_ENSURE_SUCCESS

2014-01-15 Thread Zack Weinberg
On 2014-01-06 7:58 PM, Karl Tomlinson wrote: smaug sm...@welho.com writes: Why this deprecation? NS_ENSURE_ macros hid return paths. That was exactly why they were a Good Thing! Normal control flow was emphasized. zw ___ dev-platform mailing

Re: Please use NS_WARN_IF instead of NS_ENSURE_SUCCESS

2014-01-07 Thread Karl Tomlinson
Bobby Holley writes: Note that there in a explicit stylistic exception that NS_WARN_IF statements do not require braces. So it's: if (NS_WARN_IF(NS_FAILED(rv))) return rv; I don't see that on the current version of https://developer.mozilla.org/en-US/docs/Developer_Guide/Coding_Style I

Re: Please use NS_WARN_IF instead of NS_ENSURE_SUCCESS

2014-01-07 Thread smaug
On 01/07/2014 05:14 PM, smaug wrote: On 01/07/2014 08:46 AM, Bobby Holley wrote: On Mon, Jan 6, 2014 at 5:04 PM, smaug sm...@welho.com wrote: no, since it is always possible to expand those macros. However if (NS_WARN_IF(NS_FAILED(rv)) { return rv; } is super ugly. Note that there in a

Re: Please use NS_WARN_IF instead of NS_ENSURE_SUCCESS

2014-01-07 Thread smaug
On 01/07/2014 08:46 AM, Bobby Holley wrote: On Mon, Jan 6, 2014 at 5:04 PM, smaug sm...@welho.com wrote: no, since it is always possible to expand those macros. However if (NS_WARN_IF(NS_FAILED(rv)) { return rv; } is super ugly. Note that there in a explicit stylistic exception that

Re: Please use NS_WARN_IF instead of NS_ENSURE_SUCCESS

2014-01-07 Thread Andrew McCreight
I filed bug 957201 for NS_WARN_IF_FAILED. Andrew - Original Message - On 01/07/2014 02:58 AM, Karl Tomlinson wrote: smaug sm...@welho.com writes: Why this deprecation? NS_ENSURE_ macros hid return paths. Also many people didn't understand that they issued warnings, and so

Re: Please use NS_WARN_IF instead of NS_ENSURE_SUCCESS

2014-01-07 Thread Bobby Holley
Hm. It's pretty unfortunate that we now need 4 lines per fallible call, as opposed to 2 with NS_ENSURE_* macros. The stylistic exception made this 3, which was slightly more palatable. bholley On Tue, Jan 7, 2014 at 7:26 AM, smaug sm...@welho.com wrote: On 01/07/2014 05:14 PM, smaug wrote:

Re: Please use NS_WARN_IF instead of NS_ENSURE_SUCCESS

2014-01-07 Thread Benjamin Smedberg
On 1/6/2014 7:43 PM, smaug wrote: Why this deprecation? Karl is right, we are removing the macros that hide control flow (as well as warnings, in this case). I'm considering the NS_WARN_IF_FAILED(rv) proposal. It's obviously a less typing then NS_WARN_IF(NS_FAILED(rv)), but I'm not

Re: Please use NS_WARN_IF instead of NS_ENSURE_SUCCESS

2014-01-06 Thread smaug
On 11/22/2013 10:18 PM, Benjamin Smedberg wrote: With the landing of bug 672843, the NS_ENSURE_* macros are now considered deprecated. If you are writing code that wants to issue warnings when methods fail, please either use NS_WARNING directly or use the new NS_WARN_IF macro. if

Re: Please use NS_WARN_IF instead of NS_ENSURE_SUCCESS

2014-01-06 Thread Karl Tomlinson
smaug sm...@welho.com writes: Why this deprecation? NS_ENSURE_ macros hid return paths. Also many people didn't understand that they issued warnings, and so used the macros for expected return paths. Was there some useful functionality that is not provided by the replacements?

Re: Please use NS_WARN_IF instead of NS_ENSURE_SUCCESS

2014-01-06 Thread smaug
On 01/07/2014 02:58 AM, Karl Tomlinson wrote: smaug sm...@welho.com writes: Why this deprecation? NS_ENSURE_ macros hid return paths. Also many people didn't understand that they issued warnings, and so used the macros for expected return paths. Was there some useful functionality that is

Please use NS_WARN_IF instead of NS_ENSURE_SUCCESS

2013-11-22 Thread Benjamin Smedberg
With the landing of bug 672843, the NS_ENSURE_* macros are now considered deprecated. If you are writing code that wants to issue warnings when methods fail, please either use NS_WARNING directly or use the new NS_WARN_IF macro. if (NS_WARN_IF(somethingthatshouldbetrue)) return

Re: Please use NS_WARN_IF instead of NS_ENSURE_SUCCESS

2013-11-22 Thread Daniel Holbert
On 11/22/2013 12:18 PM, Benjamin Smedberg wrote: If you are writing code that wants to issue warnings when methods fail, please either use NS_WARNING directly or use the new NS_WARN_IF macro. if (NS_WARN_IF(somethingthatshouldbetrue)) return NS_ERROR_INVALID_ARG; if