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>
2525class base_uint
2626{
2727protected:
28- enum { WIDTH= BITS/ 32 } ;
28+ static constexpr int WIDTH = BITS / 32 ;
2929 uint32_t pn[WIDTH];
3030public:
3131
Original file line number Diff line number Diff line change @@ -304,7 +304,7 @@ class CBlockIndex
304304 return (int64_t )nTimeMax;
305305 }
306306
307- enum { nMedianTimeSpan= 11 } ;
307+ static constexpr int nMedianTimeSpan = 11 ;
308308
309309 int64_t GetMedianTimePast () const
310310 {
Original file line number Diff line number Diff line change @@ -24,12 +24,9 @@ static const unsigned int MAX_TX_EXTRA_PAYLOAD = 10000;
2424static const int COINBASE_MATURITY = 100 ;
2525
2626/** 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 );
3431
3532#endif // BITCOIN_CONSENSUS_CONSENSUS_H
Original file line number Diff line number Diff line change 2727class CMessageHeader
2828{
2929public:
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;
4037 typedef unsigned char MessageStartChars[MESSAGE_START_SIZE];
4138
4239 explicit CMessageHeader (const MessageStartChars& pchMessageStartIn);
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ template<unsigned int BITS>
2020class base_blob
2121{
2222protected:
23- enum { WIDTH= BITS/ 8 } ;
23+ static constexpr int WIDTH = BITS / 8 ;
2424 uint8_t data[WIDTH];
2525public:
2626 base_blob ()
You can’t perform that action at this time.
0 commit comments