Re: Always brace your ifs

2014-02-22 Thread Brian Smith
On Sat, Feb 22, 2014 at 5:06 PM, Neil wrote: > Joshua Cranmer wrote: >> Being serious here, early-return and RTTI (to handle the cleanup prior to >> exit) would have eliminated the need for gotos in the first place. > > I assume you mean RAII. Unfortunately that requires C++. (I was fooled too; >

Re: Always brace your ifs

2014-02-22 Thread L. David Baron
On Saturday 2014-02-22 15:57 -0800, Gregory Szorc wrote: > On Feb 22, 2014, at 8:18, Kyle Huey wrote: > > If you needed another reason to follow the style guide: > > https://www.imperialviolet.org/2014/02/22/applebug.html > > > > Code coverage would have caught this as well. > > The time invest

Re: Always brace your ifs

2014-02-22 Thread Neil
Joshua Cranmer wrote: Justin Dolske wrote: But really, the best way to fix this would be to use a macro: err = SSLHashSHA1.update(&hashCtx, &foo); SSL_ENSURE_SUCCESS(err, err); err = SSLHashSHA1.update(&hashCtx, &bar); SSL_ENSURE_SUCCESS(err, err); err = SSLHashSHA1.update(&hashCtx,

Re: Always brace your ifs

2014-02-22 Thread Kyle Huey
On Sat, Feb 22, 2014 at 4:38 PM, Joshua Cranmer 🐧 wrote: > On 2/22/2014 5:22 PM, Justin Dolske wrote: >> >> But really, the best way to fix this would be to use a macro: >> >> err = SSLHashSHA1.update(&hashCtx, &foo); >> SSL_ENSURE_SUCCESS(err, err); >> err = SSLHashSHA1.update(&hashCtx, &ba

Re: Always brace your ifs

2014-02-22 Thread Joshua Cranmer 🐧
On 2/22/2014 5:22 PM, Justin Dolske wrote: But really, the best way to fix this would be to use a macro: err = SSLHashSHA1.update(&hashCtx, &foo); SSL_ENSURE_SUCCESS(err, err); err = SSLHashSHA1.update(&hashCtx, &bar); SSL_ENSURE_SUCCESS(err, err); err = SSLHashSHA1.update(&hashCtx, &b

Re: Always brace your ifs

2014-02-22 Thread Joshua Cranmer 🐧
On 2/22/2014 5:57 PM, Gregory Szorc wrote: On Feb 22, 2014, at 8:18, Kyle Huey wrote: If you needed another reason to follow the style guide: https://www.imperialviolet.org/2014/02/22/applebug.html Code coverage would have caught this as well. Actually, it probably wouldn't. The code after

Re: Always brace your ifs

2014-02-22 Thread Kyle Huey
On Sat, Feb 22, 2014 at 3:57 PM, Gregory Szorc wrote: > On Feb 22, 2014, at 8:18, Kyle Huey wrote: > >> If you needed another reason to follow the style guide: >> https://www.imperialviolet.org/2014/02/22/applebug.html >> > > Code coverage would have caught this as well. > > The time investment i

Re: Always brace your ifs

2014-02-22 Thread Kyle Huey
On Sat, Feb 22, 2014 at 3:22 PM, Justin Dolske wrote: > On 2/22/14 7:18 AM, Kyle Huey wrote: >> >> If you needed another reason to follow the style guide: >> https://www.imperialviolet.org/2014/02/22/applebug.html > > > I don't really disagree with bracing being a good idea, but I'll be > contrari

Re: Always brace your ifs

2014-02-22 Thread Gregory Szorc
On Feb 22, 2014, at 8:18, Kyle Huey wrote: > If you needed another reason to follow the style guide: > https://www.imperialviolet.org/2014/02/22/applebug.html > Code coverage would have caught this as well. The time investment into 100% line and branch coverage is debatable. But you can't arg

Re: Always brace your ifs

2014-02-22 Thread Justin Dolske
On 2/22/14 7:18 AM, Kyle Huey wrote: If you needed another reason to follow the style guide: https://www.imperialviolet.org/2014/02/22/applebug.html I don't really disagree with bracing being a good idea, but I'll be contrarian here. Mandatory bracing probably wouldn't have helped; since you

Re: We live in a memory-constrained world

2014-02-22 Thread Nicholas Nethercote
On Sat, Feb 22, 2014 at 11:22 PM, Andreas Gal wrote: > >> So, I'm wondering how much effort we should put in reducing the number >> of ChromeWorkers. > > We should continue to use JS in Chrome where it makes sense. Its often easier > and faster to write some functionality in JS (and sometimes als

Re: Always brace your ifs

2014-02-22 Thread Hubert Figuière
On 22/02/14 02:53 PM, Mike Hoye wrote: > On 2/22/2014, 1:04 PM, Jet Villegas wrote: >> goto ftw; > I have to admit, I was very surprised to learn that: > > - Using both -Wall and -Wextra doesn't get you -Wunreachable-code. > - The Clang manual lists documenting any of that that as a "todo". Now w

Re: Always brace your ifs

2014-02-22 Thread Reuben Morais
On Feb 22, 2014, at 16:53, Mike Hoye wrote: On 2/22/2014, 1:04 PM, Jet Villegas wrote: >> goto ftw; > I have to admit, I was very surprised to learn that: > > - Using both -Wall and -Wextra doesn't get you -Wunreachable-code. > - The Clang manual lists documenting any of that that as a "todo". -

Re: Always brace your ifs

2014-02-22 Thread Mike Hoye
On 2/22/2014, 1:04 PM, Jet Villegas wrote: goto ftw; I have to admit, I was very surprised to learn that: - Using both -Wall and -Wextra doesn't get you -Wunreachable-code. - The Clang manual lists documenting any of that that as a "todo". - mhoye

Re: Always brace your ifs

2014-02-22 Thread Jet Villegas
goto ftw; --Jet - Original Message - From: "Kyle Huey" To: "dev-platform" Sent: Saturday, February 22, 2014 7:18:04 AM Subject: Always brace your ifs If you needed another reason to follow the style guide: https://www.imperialviolet.org/2014/02/22/applebug.html - Kyle

Always brace your ifs

2014-02-22 Thread Kyle Huey
If you needed another reason to follow the style guide: https://www.imperialviolet.org/2014/02/22/applebug.html - Kyle ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform

Re: We live in a memory-constrained world

2014-02-22 Thread Andreas Gal
On Feb 22, 2014, at 1:12 PM, David Rajchenbach-Teller wrote: > So, I'm wondering how much effort we should put in reducing the number > of ChromeWorkers. On Desktop, we have a PageThumbsWorker and a > SessionWorker, which are both useful but not strictly necessary. I seem > to remember that the

Re: We live in a memory-constrained world

2014-02-22 Thread David Rajchenbach-Teller
So, I'm wondering how much effort we should put in reducing the number of ChromeWorkers. On Desktop, we have a PageThumbsWorker and a SessionWorker, which are both useful but not strictly necessary. I seem to remember that they each take 1Mb+ of RAM. On all platforms, we have the OS.File ChromeWor