File tree Expand file tree Collapse file tree 5 files changed +14
-20
lines changed Expand file tree Collapse file tree 5 files changed +14
-20
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ template<unsigned int BITS>
25
25
class base_uint
26
26
{
27
27
protected:
28
- enum { WIDTH= BITS/ 32 } ;
28
+ static constexpr int WIDTH = BITS / 32 ;
29
29
uint32_t pn[WIDTH];
30
30
public:
31
31
Original file line number Diff line number Diff line change @@ -304,7 +304,7 @@ class CBlockIndex
304
304
return (int64_t )nTimeMax;
305
305
}
306
306
307
- enum { nMedianTimeSpan= 11 } ;
307
+ static constexpr int nMedianTimeSpan = 11 ;
308
308
309
309
int64_t GetMedianTimePast () const
310
310
{
Original file line number Diff line number Diff line change @@ -24,12 +24,9 @@ static const size_t MIN_TRANSACTION_WEIGHT = WITNESS_SCALE_FACTOR * 60; // 60 is
24
24
static const size_t MIN_SERIALIZABLE_TRANSACTION_WEIGHT = WITNESS_SCALE_FACTOR * 10 ; // 10 is the lower bound for the size of a serialized CTransaction
25
25
26
26
/** Flags for nSequence and nLockTime locks */
27
- enum {
28
- /* Interpret sequence numbers as relative lock-time constraints. */
29
- LOCKTIME_VERIFY_SEQUENCE = (1 << 0 ),
30
-
31
- /* Use GetMedianTimePast() instead of nTime for end point timestamp. */
32
- LOCKTIME_MEDIAN_TIME_PAST = (1 << 1 ),
33
- };
27
+ /** Interpret sequence numbers as relative lock-time constraints. */
28
+ static constexpr unsigned int LOCKTIME_VERIFY_SEQUENCE = (1 << 0 );
29
+ /** Use GetMedianTimePast() instead of nTime for end point timestamp. */
30
+ static constexpr unsigned int LOCKTIME_MEDIAN_TIME_PAST = (1 << 1 );
34
31
35
32
#endif // BITCOIN_CONSENSUS_CONSENSUS_H
Original file line number Diff line number Diff line change 27
27
class CMessageHeader
28
28
{
29
29
public:
30
- enum {
31
- MESSAGE_START_SIZE = 4 ,
32
- COMMAND_SIZE = 12 ,
33
- MESSAGE_SIZE_SIZE = 4 ,
34
- CHECKSUM_SIZE = 4 ,
35
-
36
- MESSAGE_SIZE_OFFSET = MESSAGE_START_SIZE + COMMAND_SIZE,
37
- CHECKSUM_OFFSET = MESSAGE_SIZE_OFFSET + MESSAGE_SIZE_SIZE,
38
- HEADER_SIZE = MESSAGE_START_SIZE + COMMAND_SIZE + MESSAGE_SIZE_SIZE + CHECKSUM_SIZE
39
- };
30
+ static constexpr size_t MESSAGE_START_SIZE = 4 ;
31
+ static constexpr size_t COMMAND_SIZE = 12 ;
32
+ static constexpr size_t MESSAGE_SIZE_SIZE = 4 ;
33
+ static constexpr size_t CHECKSUM_SIZE = 4 ;
34
+ static constexpr size_t MESSAGE_SIZE_OFFSET = MESSAGE_START_SIZE + COMMAND_SIZE;
35
+ static constexpr size_t CHECKSUM_OFFSET = MESSAGE_SIZE_OFFSET + MESSAGE_SIZE_SIZE;
36
+ static constexpr size_t HEADER_SIZE = MESSAGE_START_SIZE + COMMAND_SIZE + MESSAGE_SIZE_SIZE + CHECKSUM_SIZE;
40
37
typedef unsigned char MessageStartChars[MESSAGE_START_SIZE];
41
38
42
39
explicit CMessageHeader (const MessageStartChars& pchMessageStartIn);
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ template<unsigned int BITS>
19
19
class base_blob
20
20
{
21
21
protected:
22
- enum { WIDTH= BITS/ 8 } ;
22
+ static constexpr int WIDTH = BITS / 8 ;
23
23
uint8_t data[WIDTH];
24
24
public:
25
25
base_blob ()
You can’t perform that action at this time.
0 commit comments