Re: Proposal to remove `aFoo` prescription from the Mozilla style guide for C and C++

2015-07-12 Thread Thomas Zimmermann
Am 08.07.2015 um 16:36 schrieb smaug:
 Do you actually have any data how many % of Gecko devs would prefer
 not using aFoo?

I strongly prefer 'aFoo' over 'foo' for the extra context that it gives
to the variable. If we want to change anything we should rather
introduce a separate prefix for output parameters.

Best regards
Thomas
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Hash table iterators, and a call for help

2015-07-12 Thread Nicholas Nethercote
Hi,

Last week I landed patches that remove PL_DHashTableEnumerate() from
the tree (https://bugzilla.mozilla.org/show_bug.cgi?id=1180072). You
should now use PLDHashTable::Iterator if you want to iterate over a
PLDHashTable. The iterator is *so* much nicer -- there's none of that
bundle up an environment as a |void*| pointer and pass it in with a
function pointer annoyance.

I have also added Iterator classes to each of nsTHashtable and
nsBaseHashtable (https://bugzilla.mozilla.org/show_bug.cgi?id=1181445)
and I would like to also eventually remove the enumerate functions
from these classes. However, there are 500+ calls to those enumerate
functions so it's going to take a while.

For now, I've filed bugs to get rid of all the
nsTHashtable::EnumerateEntries() calls, which account for ~160 of
those 500+. They're all blocking
https://bugzilla.mozilla.org/show_bug.cgi?id=1181443. If you find
yourself in the mood for some not-too-taxing refactoring, please feel
free to take on one or more of the unassigned bugs. The number of
calls to replace in each bug ranges from one or two up to 21. If you
have any questions please ask. Thank you.

Nick
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Proposal to remove `aFoo` prescription from the Mozilla style guide for C and C++

2015-07-12 Thread Nicholas Nethercote
On Thu, Jul 9, 2015 at 7:01 PM, Jeff Gilbert jgilb...@mozilla.com wrote:

 Arguments have the same lifetimes as locals, and the only exceptions to
 this apply to both args and locals. (references and pointers)

Maybe I've misunderstood what you're saying here, but locals are
frequently block-scoped which gives them a different lifetime to args.

Nick
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform