diff --git a/libtransmission/peer-msgs.cc b/libtransmission/peer-msgs.cc index bed9ad1db..8fa77e243 100644 --- a/libtransmission/peer-msgs.cc +++ b/libtransmission/peer-msgs.cc @@ -66,8 +66,6 @@ enum UT_PEX_ID = 1, UT_METADATA_ID = 3, /* */ - MAX_PEX_PEER_COUNT = 50, - /* */ MIN_CHOKE_PERIOD_SEC = 10, /* idle seconds before we send a keepalive */ KEEPALIVE_INTERVAL_SECS = 100, @@ -97,6 +95,13 @@ enum METADATA_MSG_TYPE_REJECT = 2 }; +namespace +{ + +constexpr int MAX_PEX_PEER_COUNT = 50; + +} // unnamed namespace + enum { AWAITING_BT_LENGTH, diff --git a/libtransmission/resume.cc b/libtransmission/resume.cc index 8d6c93a79..15f499c9c 100644 --- a/libtransmission/resume.cc +++ b/libtransmission/resume.cc @@ -23,10 +23,12 @@ #include "utils.h" /* tr_buildPath */ #include "variant.h" -enum +namespace { - MAX_REMEMBERED_PEERS = 200 -}; + +constexpr int MAX_REMEMBERED_PEERS = 200; + +} // unnamed namespace static char* getResumeFilename(tr_torrent const* tor, enum tr_metainfo_basename_format format) { diff --git a/libtransmission/torrent-magnet.h b/libtransmission/torrent-magnet.h index 0d63e5ed7..deb34de89 100644 --- a/libtransmission/torrent-magnet.h +++ b/libtransmission/torrent-magnet.h @@ -15,11 +15,8 @@ #include #include -enum -{ - /* defined by BEP #9 */ - METADATA_PIECE_SIZE = (1024 * 16) -}; +// defined by BEP #9 +inline constexpr int METADATA_PIECE_SIZE = 1024 * 16; void* tr_torrentGetMetadataPiece(tr_torrent* tor, int piece, size_t* len);