Skip to content

Commit 5a9b508

Browse files
[trivial] Add end of namespace comments
1 parent 4c92401 commit 5a9b508

20 files changed

+37
-22
lines changed

doc/developer-notes.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class Class
4545
return true;
4646
}
4747
}
48-
}
48+
} // namespace foo
4949
```
5050
5151
Doxygen comments
@@ -408,6 +408,21 @@ Source code organization
408408
409409
- *Rationale*: Avoids symbol conflicts
410410
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++
415+
namespace mynamespace {
416+
...
417+
} // namespace mynamespace
418+
419+
namespace {
420+
...
421+
} // namespace
422+
```
423+
424+
- *Rationale*: Avoids confusion about the namespace context
425+
411426
GUI
412427
-----
413428

src/base58.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ class CBitcoinAddressVisitor : public boost::static_visitor<bool>
225225
bool operator()(const CNoDestination& no) const { return false; }
226226
};
227227

228-
} // anon namespace
228+
} // namespace
229229

230230
bool CBitcoinAddress::Set(const CKeyID& id)
231231
{

src/bench/checkblock.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace block_bench {
1313
#include "bench/data/block413567.raw.h"
14-
}
14+
} // namespace block_bench
1515

1616
// These are the two major time-sinks which happen after we have fully received
1717
// a block off the wire, but before we can relay the block on to peers using

src/compat/glibc_sanity.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ bool sanity_test_fdelt()
5656
}
5757
#endif
5858

59-
} // anon namespace
59+
} // namespace
6060

6161
bool glibc_sanity_test()
6262
{

src/compat/glibcxx_sanity.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ bool sanity_test_list(unsigned int size)
3838
return true;
3939
}
4040

41-
} // anon namespace
41+
} // namespace
4242

4343
// trigger: string::at(x) on an empty string to trigger __throw_out_of_range_fmt.
4444
// test: force std::string to throw an out_of_range exception. Verify that

src/dbwrapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,4 +209,4 @@ const std::vector<unsigned char>& GetObfuscateKey(const CDBWrapper &w)
209209
return w.obfuscate_key;
210210
}
211211

212-
};
212+
} // namespace dbwrapper_private

src/init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ int nUserMaxConnections;
809809
int nFD;
810810
ServiceFlags nLocalServices = NODE_NETWORK;
811811

812-
}
812+
} // namespace
813813

814814
[[noreturn]] static void new_handler_terminate()
815815
{

src/net_processing.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ namespace {
122122
MapRelay mapRelay;
123123
/** Expiration-time ordered list of (expire time, relay map entry) pairs, protected by cs_main). */
124124
std::deque<std::pair<int64_t, MapRelay::iterator>> vRelayExpiration;
125-
} // anon namespace
125+
} // namespace
126126

127127
//////////////////////////////////////////////////////////////////////////////
128128
//
@@ -555,7 +555,7 @@ void FindNextBlocksToDownload(NodeId nodeid, unsigned int count, std::vector<con
555555
}
556556
}
557557

558-
} // anon namespace
558+
} // namespace
559559

560560
bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats) {
561561
LOCK(cs_main);

src/protocol.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const char *SENDCMPCT="sendcmpct";
3939
const char *CMPCTBLOCK="cmpctblock";
4040
const char *GETBLOCKTXN="getblocktxn";
4141
const char *BLOCKTXN="blocktxn";
42-
};
42+
} // namespace NetMsgType
4343

4444
/** All known message types. Keep this in the same order as the list of
4545
* messages above and in protocol.h.

src/pubkey.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace
1111
{
1212
/* Global secp256k1_context object used for verification. */
1313
secp256k1_context* secp256k1_context_verify = NULL;
14-
}
14+
} // namespace
1515

1616
/** This function is taken from the libsecp256k1 distribution and implements
1717
* DER parsing for ECDSA signatures, while supporting an arbitrary subset of

0 commit comments

Comments
 (0)