Skip to content

Commit 04e988c

Browse files
committed
Merge pull request #5145
484e350 Update comments in client version to be doxygen compatible (Michael Ford) 6395ba3 Update comments in version to be doxygen compatible (Michael Ford)
2 parents 7cd85f4 + 484e350 commit 04e988c

File tree

3 files changed

+65
-52
lines changed

3 files changed

+65
-52
lines changed

src/clientversion.cpp

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Copyright (c) 2012 The Bitcoin developers
2-
// Distributed under the MIT/X11 software license, see the accompanying
1+
// Copyright (c) 2012-2014 The Bitcoin developers
2+
// Distributed under the MIT software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

55
#include "clientversion.h"
@@ -8,35 +8,41 @@
88

99
#include <string>
1010

11-
// Name of client reported in the 'version' message. Report the same name
12-
// for both bitcoind and bitcoin-qt, to make it harder for attackers to
13-
// target servers or GUI users specifically.
11+
/**
12+
* Name of client reported in the 'version' message. Report the same name
13+
* for both bitcoind and bitcoin-core, to make it harder for attackers to
14+
* target servers or GUI users specifically.
15+
*/
1416
const std::string CLIENT_NAME("Satoshi");
1517

16-
// Client version number
18+
/**
19+
* Client version number
20+
*/
1721
#define CLIENT_VERSION_SUFFIX ""
1822

1923

20-
// The following part of the code determines the CLIENT_BUILD variable.
21-
// Several mechanisms are used for this:
22-
// * first, if HAVE_BUILD_INFO is defined, include build.h, a file that is
23-
// generated by the build environment, possibly containing the output
24-
// of git-describe in a macro called BUILD_DESC
25-
// * secondly, if this is an exported version of the code, GIT_ARCHIVE will
26-
// be defined (automatically using the export-subst git attribute), and
27-
// GIT_COMMIT will contain the commit id.
28-
// * then, three options exist for determining CLIENT_BUILD:
29-
// * if BUILD_DESC is defined, use that literally (output of git-describe)
30-
// * if not, but GIT_COMMIT is defined, use v[maj].[min].[rev].[build]-g[commit]
31-
// * otherwise, use v[maj].[min].[rev].[build]-unk
32-
// finally CLIENT_VERSION_SUFFIX is added
33-
34-
// First, include build.h if requested
24+
/**
25+
* The following part of the code determines the CLIENT_BUILD variable.
26+
* Several mechanisms are used for this:
27+
* * first, if HAVE_BUILD_INFO is defined, include build.h, a file that is
28+
* generated by the build environment, possibly containing the output
29+
* of git-describe in a macro called BUILD_DESC
30+
* * secondly, if this is an exported version of the code, GIT_ARCHIVE will
31+
* be defined (automatically using the export-subst git attribute), and
32+
* GIT_COMMIT will contain the commit id.
33+
* * then, three options exist for determining CLIENT_BUILD:
34+
* * if BUILD_DESC is defined, use that literally (output of git-describe)
35+
* * if not, but GIT_COMMIT is defined, use v[maj].[min].[rev].[build]-g[commit]
36+
* * otherwise, use v[maj].[min].[rev].[build]-unk
37+
* finally CLIENT_VERSION_SUFFIX is added
38+
*/
39+
40+
//! First, include build.h if requested
3541
#ifdef HAVE_BUILD_INFO
3642
#include "build.h"
3743
#endif
3844

39-
// git will put "#define GIT_ARCHIVE 1" on the next line inside archives. $Format:%n#define GIT_ARCHIVE 1$
45+
//! git will put "#define GIT_ARCHIVE 1" on the next line inside archives. $Format:%n#define GIT_ARCHIVE 1$
4046
#ifdef GIT_ARCHIVE
4147
#define GIT_COMMIT_ID "$Format:%h$"
4248
#define GIT_COMMIT_DATE "$Format:%cD$"
@@ -85,7 +91,9 @@ std::string FormatFullVersion()
8591
return CLIENT_BUILD;
8692
}
8793

88-
// Format the subversion field according to BIP 14 spec (https://en.bitcoin.it/wiki/BIP_0014)
94+
/**
95+
* Format the subversion field according to BIP 14 spec (https://github.com/bitcoin/bips/blob/master/bip-0014.mediawiki)
96+
*/
8997
std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector<std::string>& comments)
9098
{
9199
std::ostringstream ss;

src/clientversion.h

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright (c) 2009-2014 The Bitcoin developers
2-
// Distributed under the MIT/X11 software license, see the accompanying
2+
// Distributed under the MIT software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

55
#ifndef CLIENTVERSION_H
@@ -8,38 +8,43 @@
88
#if defined(HAVE_CONFIG_H)
99
#include "config/bitcoin-config.h"
1010
#else
11-
//
12-
// client versioning and copyright year
13-
//
1411

15-
// These need to be macros, as version.cpp's and bitcoin*-res.rc's voodoo requires it
12+
/**
13+
* client versioning and copyright year
14+
*/
15+
16+
//! These need to be macros, as clientversion.cpp's and bitcoin*-res.rc's voodoo requires it
1617
#define CLIENT_VERSION_MAJOR 0
1718
#define CLIENT_VERSION_MINOR 9
1819
#define CLIENT_VERSION_REVISION 99
1920
#define CLIENT_VERSION_BUILD 0
2021

21-
// Set to true for release, false for prerelease or test build
22+
//! Set to true for release, false for prerelease or test build
2223
#define CLIENT_VERSION_IS_RELEASE false
2324

24-
// Copyright year (2009-this)
25-
// Todo: update this when changing our copyright comments in the source
25+
/**
26+
* Copyright year (2009-this)
27+
* Todo: update this when changing our copyright comments in the source
28+
*/
2629
#define COPYRIGHT_YEAR 2014
2730

2831
#endif //HAVE_CONFIG_H
2932

30-
// Converts the parameter X to a string after macro replacement on X has been performed.
31-
// Don't merge these into one macro!
33+
/**
34+
* Converts the parameter X to a string after macro replacement on X has been performed.
35+
* Don't merge these into one macro!
36+
*/
3237
#define STRINGIZE(X) DO_STRINGIZE(X)
3338
#define DO_STRINGIZE(X) #X
3439

35-
// Copyright string used in Windows .rc files
40+
//! Copyright string used in Windows .rc files
3641
#define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " The Bitcoin Core Developers"
3742

38-
/*
39-
bitcoind-res.rc includes this file, but it cannot cope with real c++ code.
40-
WINDRES_PREPROC is defined to indicate that its pre-processor is running.
41-
Anything other than a define should be guarded below.
42-
*/
43+
/**
44+
* bitcoind-res.rc includes this file, but it cannot cope with real c++ code.
45+
* WINDRES_PREPROC is defined to indicate that its pre-processor is running.
46+
* Anything other than a define should be guarded below.
47+
*/
4348

4449
#if !defined(WINDRES_PREPROC)
4550

src/version.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
1-
// Copyright (c) 2012 The Bitcoin developers
2-
// Distributed under the MIT/X11 software license, see the accompanying
1+
// Copyright (c) 2012-2014 The Bitcoin developers
2+
// Distributed under the MIT software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

55
#ifndef BITCOIN_VERSION_H
66
#define BITCOIN_VERSION_H
77

8-
//
9-
// network protocol versioning
10-
//
8+
/**
9+
* network protocol versioning
10+
*/
1111

1212
static const int PROTOCOL_VERSION = 70002;
1313

14-
// initial proto version, to be increased after version/verack negotiation
14+
//! initial proto version, to be increased after version/verack negotiation
1515
static const int INIT_PROTO_VERSION = 209;
1616

17-
// In this version, 'getheaders' was introduced.
17+
//! In this version, 'getheaders' was introduced.
1818
static const int GETHEADERS_VERSION = 31800;
1919

20-
// disconnect from peers older than this proto version
20+
//! disconnect from peers older than this proto version
2121
static const int MIN_PEER_PROTO_VERSION = GETHEADERS_VERSION;
2222

23-
// nTime field added to CAddress, starting with this version;
24-
// if possible, avoid requesting addresses nodes older than this
23+
//! nTime field added to CAddress, starting with this version;
24+
//! if possible, avoid requesting addresses nodes older than this
2525
static const int CADDR_TIME_VERSION = 31402;
2626

27-
// only request blocks from nodes outside this range of versions
27+
//! only request blocks from nodes outside this range of versions
2828
static const int NOBLKS_VERSION_START = 32000;
2929
static const int NOBLKS_VERSION_END = 32400;
3030

31-
// BIP 0031, pong message, is enabled for all versions AFTER this one
31+
//! BIP 0031, pong message, is enabled for all versions AFTER this one
3232
static const int BIP0031_VERSION = 60000;
3333

34-
// "mempool" command, enhanced "getdata" behavior starts with this version
34+
//! "mempool" command, enhanced "getdata" behavior starts with this version
3535
static const int MEMPOOL_GD_VERSION = 60002;
3636

3737
#endif // BITCOIN_VERSION_H

0 commit comments

Comments
 (0)