From 7b3f94145da0fbb25f8ca982b7d3129960452054 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 21 Jun 2015 17:05:02 +0900 Subject: [PATCH] Make constexpr macros in DHTConstant.h --- src/DHTConstants.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/DHTConstants.h b/src/DHTConstants.h index 8d84046c..526d0a1a 100644 --- a/src/DHTConstants.h +++ b/src/DHTConstants.h @@ -39,17 +39,15 @@ #include "TimerA2.h" #include "a2functional.h" +namespace aria2 { + // Increment this if major improvements or bug fixes are made in DHT // code. This is 2 bytes unsigned integer. -#define DHT_VERSION 3U +constexpr uint16_t DHT_VERSION = 3U; -#define DHT_ID_LENGTH 20 +constexpr size_t DHT_ID_LENGTH = 20; -#define DHT_TRANSACTION_ID_LENGTH 2 - -#define DHT_TOKEN_LENGTH 4 - -namespace aria2 { +constexpr size_t DHT_TRANSACTION_ID_LENGTH = 2; // See --dht-message-timeout option. constexpr auto DHT_MESSAGE_TIMEOUT = 10_s;