No description provided.
[trivial] Add end of namespace comments. Improve consistency. #9544
pull practicalswift wants to merge 1 commits into bitcoin:master from practicalswift:consistent-use-of-end-of-namespace-comments changing 20 files +37 −22-
practicalswift commented at 7:23 PM on January 13, 2017: contributor
- practicalswift renamed this:
Add end of namespace comments. Improve consistency for anonymous namespaces.
[trivial] Add end of namespace comments. Improve consistency.
on Jan 13, 2017 - fanquake added the label Docs and Output on Jan 13, 2017
- practicalswift force-pushed on Jan 31, 2017
-
practicalswift commented at 8:02 PM on January 31, 2017: contributor
Merge conflict resolved!
-
in src/base58.cpp:None in 7140b876d5 outdated
224 | @@ -225,7 +225,7 @@ class CBitcoinAddressVisitor : public boost::static_visitor<bool> 225 | bool operator()(const CNoDestination& no) const { return false; } 226 | }; 227 | 228 | -} // anon namespace 229 | +} // namespace
jtimon commented at 12:19 AM on February 1, 2017:why remove anon ?
practicalswift commented at 6:53 AM on February 1, 2017:@jtimon My reasoning behind that was to achieve consistency how anonymous namespaces are indicated. Consistency in order to improve readability and allow for automatic identification of missing/incorrect end of namespace comments.
// namespaceis the form preferred by the clang-tooling (clang-tidy, etc).// anonymous namespaceis also quite common. I haven't seen// anon namespacebefore, but let me know if the choice of// anon namespaceis intentional and I'll adjust this PR :-)
jtimon commented at 8:04 PM on February 2, 2017:Well, it just seems to me that the same consistency can be achieved leaving "anon namespace" for anonymous namespaces with less disruption. But if clang prefers
// namespaceor// anonymous namespaceI don't have a strong opinion.practicalswift commented at 10:19 PM on February 27, 2017: contributorAny changes needed before merge? :-)
paveljanik commented at 12:44 PM on February 28, 2017: contributorThe question should read: How can I attract you to the review? My answer is: sorry, I do not know.
I'm pro
// anonymous namespaceand having the end of namespace marks. But we do not have a recommendation for this in the developer notes, there is only "Block style example:" section there. With no end of namespace comment...practicalswift commented at 1:04 PM on February 28, 2017: contributor@paveljanik I see! If the consensus opinion is that end of namespace marks are optional then this PR is redundant and I'll close it :-)
laanwj commented at 1:32 PM on February 28, 2017: memberI think the point is that if end-of-namespace comments are to be required, they should be mentioned in
doc/developer-notes.mdalong with rationale. It should be clear to contributors what the "rules" are. If not, changes like this come out of the blue.paveljanik commented at 2:34 PM on February 28, 2017: contributor@practicalswift I do now know what the consensus is, but my opinion is the same as @laanwj 's.
practicalswift force-pushed on Feb 28, 2017practicalswift force-pushed on Feb 28, 2017practicalswift force-pushed on Feb 28, 2017practicalswift force-pushed on Feb 28, 2017practicalswift commented at 3:29 PM on February 28, 2017: contributor@laanwj Good point! I've added a note to
doc/developer-notes.mdin this PR.practicalswift force-pushed on Feb 28, 2017paveljanik commented at 5:24 PM on February 28, 2017: contributorI'd slightly prefer
// anonymous namespaceover// namespaceat the end of anonymous namespace, but this is minor.practicalswift commented at 8:22 AM on March 1, 2017: contributor@paveljanik It seems like
// namespaceis the dominant form currently used in the repo:$ git checkout master $ git grep -E '} *// namespace$' | wc -l 21 $ git grep -E '} *// anonymous namespace$' | wc -l 3// namespaceis also the form preferred by the clang-tooling (clang-tidy, etc).paveljanik commented at 8:25 AM on March 1, 2017: contributor@practicalswift yes. But it seems like the author forget to add the real name of the namespace after it ;-)
in src/univalue/lib/univalue.cpp:None in 11d487025f outdated
70 | @@ -71,7 +71,7 @@ bool ParseDouble(const std::string& str, double *out) 71 | if(out) *out = result; 72 | return text.eof() && !text.fail(); 73 | } 74 | -} 75 | +} // namespace
paveljanik commented at 8:27 AM on March 1, 2017:This is univalue -> please report upstream.
paveljanik commented at 8:28 AM on March 1, 2017: contributorConcept ACK.
Please remove univalue change. Then utACK
practicalswift force-pushed on Mar 1, 2017practicalswift commented at 8:44 AM on March 1, 2017: contributor@paveljanik Removed univalue change as requested :-)
paveljanik commented at 5:05 PM on March 1, 2017: contributorpracticalswift commented at 4:52 PM on March 28, 2017: contributor@paveljanik Thanks for reviewing! Let me know if any further tweaks are needed :-)
practicalswift force-pushed on Apr 27, 2017practicalswift closed this on Apr 27, 2017practicalswift force-pushed on Apr 27, 2017practicalswift reopened this on Apr 27, 2017practicalswift commented at 10:52 PM on April 27, 2017: contributorConflicts resolved!
jtimon commented at 11:53 PM on April 27, 2017: contributorFast re-review checked that still doesn't need testing ACK 486a5d7
in doc/developer-notes.md:414 in 486a5d731b outdated
407 | @@ -408,6 +408,21 @@ Source code organization 408 | 409 | - *Rationale*: Avoids symbol conflicts 410 | 411 | +- Terminate namespaces with a comment (`// namespace mynamespace`). The comment 412 | + should be placed on the same line as the brace closing the namespace, e.g. 413 | + 414 | + ```c++
jtimon commented at 4:55 PM on May 31, 2017:nit: extra spaces?
practicalswift commented at 6:56 PM on May 31, 2017:@jtimon Sorry I'm not sure I follow - where should the extra spaces be placed? :-)
jtimon commented at 8:10 PM on May 31, 2017:s/ ```/```/ ?
EDIT: not important
[trivial] Add end of namespace comments 5a9b508279practicalswift force-pushed on May 31, 2017practicalswift commented at 8:22 PM on May 31, 2017: contributor@jtimon Fixed! :-)
laanwj commented at 11:40 AM on June 26, 2017: memberutACK 5a9b508
laanwj merged this on Jun 26, 2017laanwj closed this on Jun 26, 2017laanwj referenced this in commit f3f1e2e7d3 on Jun 26, 2017PastaPastaPasta referenced this in commit 2ce5560815 on Jul 6, 2019PastaPastaPasta referenced this in commit 7f7733315f on Jul 6, 2019PastaPastaPasta referenced this in commit 3caaf832dd on Jul 8, 2019PastaPastaPasta referenced this in commit 28c7e5d515 on Jul 9, 2019PastaPastaPasta referenced this in commit f2a4776464 on Jul 11, 2019barrystyle referenced this in commit 573256d719 on Jan 22, 2020practicalswift deleted the branch on Apr 10, 2021DrahtBot locked this on Aug 18, 2022ContributorsLabels
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 18:15 UTC
More mirrored repositories can be found on mirror.b10c.me