Use `inline` on all namespace-scope constants defined in headers
Change-Id: Ic61f8d26f59fdc2895415ca47065c02d6eec28ed
diff --git a/daemon/face/face-common.hpp b/daemon/face/face-common.hpp
index 996d7b6..18ca03c 100644
--- a/daemon/face/face-common.hpp
+++ b/daemon/face/face-common.hpp
@@ -47,22 +47,22 @@
using FaceId = uint64_t;
/// Indicates an invalid FaceId
-constexpr FaceId INVALID_FACEID = ndn::nfd::INVALID_FACE_ID;
+inline constexpr FaceId INVALID_FACEID = ndn::nfd::INVALID_FACE_ID;
/// Identifies the InternalFace used in management
-constexpr FaceId FACEID_INTERNAL_FACE = 1;
+inline constexpr FaceId FACEID_INTERNAL_FACE = 1;
/// Identifies a packet comes from the ContentStore
-constexpr FaceId FACEID_CONTENT_STORE = 254;
+inline constexpr FaceId FACEID_CONTENT_STORE = 254;
/// Identifies the NullFace that drops every packet
-constexpr FaceId FACEID_NULL = 255;
+inline constexpr FaceId FACEID_NULL = 255;
/// Upper bound of reserved FaceIds
-constexpr FaceId FACEID_RESERVED_MAX = 255;
+inline constexpr FaceId FACEID_RESERVED_MAX = 255;
/**
* \brief Minimum MTU that may be set.
*
* This is done to ensure the NDNLPv2 fragmentation feature functions properly.
*/
-constexpr ssize_t MIN_MTU = 64;
+inline constexpr ssize_t MIN_MTU = 64;
/**
* \brief Identifies a remote endpoint on the link.
diff --git a/daemon/face/lp-fragmenter.cpp b/daemon/face/lp-fragmenter.cpp
index 0243a48..a9fcf17 100644
--- a/daemon/face/lp-fragmenter.cpp
+++ b/daemon/face/lp-fragmenter.cpp
@@ -41,7 +41,7 @@
/**
* \brief Maximum overhead on a single fragment, not counting other NDNLPv2 headers.
*/
-const size_t MAX_SINGLE_FRAG_OVERHEAD =
+constexpr size_t MAX_SINGLE_FRAG_OVERHEAD =
1 + 9 + // LpPacket TLV-TYPE and TLV-LENGTH
1 + 1 + 8 + // Sequence TLV
1 + 9; // Fragment TLV-TYPE and TLV-LENGTH
@@ -49,7 +49,7 @@
/**
* \brief Maximum overhead of adding fragmentation to payload, not counting other NDNLPv2 headers.
*/
-const size_t MAX_FRAG_OVERHEAD =
+constexpr size_t MAX_FRAG_OVERHEAD =
1 + 9 + // LpPacket TLV-TYPE and TLV-LENGTH
1 + 1 + 8 + // Sequence TLV
1 + 1 + 8 + // FragIndex TLV
diff --git a/daemon/face/transport.hpp b/daemon/face/transport.hpp
index 1c24c57..0350bf4 100644
--- a/daemon/face/transport.hpp
+++ b/daemon/face/transport.hpp
@@ -89,22 +89,22 @@
/**
* \brief Indicates that the transport has no limit on payload size
*/
-constexpr ssize_t MTU_UNLIMITED = -1;
+inline constexpr ssize_t MTU_UNLIMITED = -1;
/**
* \brief (for internal use) Indicates that the MTU field is unset
*/
-constexpr ssize_t MTU_INVALID = -2;
+inline constexpr ssize_t MTU_INVALID = -2;
/**
* \brief Indicates that the transport does not support reading the queue capacity/length
*/
-constexpr ssize_t QUEUE_UNSUPPORTED = -1;
+inline constexpr ssize_t QUEUE_UNSUPPORTED = -1;
/**
* \brief Indicates that the transport was unable to retrieve the queue capacity/length
*/
-constexpr ssize_t QUEUE_ERROR = -2;
+inline constexpr ssize_t QUEUE_ERROR = -2;
/**
* \brief The lower half of a Face.
diff --git a/daemon/mgmt/rib-manager.cpp b/daemon/mgmt/rib-manager.cpp
index 24d52b7..afeca1c 100644
--- a/daemon/mgmt/rib-manager.cpp
+++ b/daemon/mgmt/rib-manager.cpp
@@ -44,7 +44,7 @@
const std::string MGMT_MODULE_NAME = "rib";
const Name LOCALHOST_TOP_PREFIX = "/localhost/nfd";
-const time::seconds ACTIVE_FACE_FETCH_INTERVAL = 5_min;
+constexpr time::seconds ACTIVE_FACE_FETCH_INTERVAL = 5_min;
RibManager::RibManager(rib::Rib& rib, ndn::Face& face, ndn::KeyChain& keyChain,
ndn::nfd::Controller& nfdController, Dispatcher& dispatcher)
diff --git a/daemon/rib/route.cpp b/daemon/rib/route.cpp
index 78ccdad..43227f1 100644
--- a/daemon/rib/route.cpp
+++ b/daemon/rib/route.cpp
@@ -24,11 +24,12 @@
*/
#include "route.hpp"
+
#include <ndn-cxx/util/string-helper.hpp>
namespace nfd::rib {
-const uint64_t PA_ROUTE_COST = 2048; ///< cost of route created by prefix announcement
+constexpr uint64_t PA_ROUTE_COST = 2048; // cost of route created by prefix announcement
static time::steady_clock::time_point
computeExpiration(const ndn::PrefixAnnouncement& ann)
diff --git a/daemon/table/pit-face-record.cpp b/daemon/table/pit-face-record.cpp
index c0f43bc..4b96c40 100644
--- a/daemon/table/pit-face-record.cpp
+++ b/daemon/table/pit-face-record.cpp
@@ -28,7 +28,7 @@
namespace nfd::pit {
// Impose a maximum lifetime to prevent integer overflow when calculating m_expiry.
-const time::milliseconds MAX_LIFETIME = 10_days;
+constexpr time::milliseconds MAX_LIFETIME = 10_days;
void
FaceRecord::update(const Interest& interest)