Use ndn::Buffer::data() instead of buf()
The latter is considered deprecated.
Change-Id: If92406ccedca391e3551b456491ebb47737f1bc1
diff --git a/src/diff-state-container.hpp b/src/diff-state-container.hpp
index f03caf1..dbd4a11 100644
--- a/src/diff-state-container.hpp
+++ b/src/diff-state-container.hpp
@@ -46,7 +46,7 @@
{
BOOST_ASSERT(digest->size() > sizeof(std::size_t));
- return *reinterpret_cast<const std::size_t*>(digest->buf());
+ return *reinterpret_cast<const std::size_t*>(digest->data());
}
};
diff --git a/src/leaf-container.hpp b/src/leaf-container.hpp
index f08f8f9..95ddc75 100644
--- a/src/leaf-container.hpp
+++ b/src/leaf-container.hpp
@@ -49,7 +49,7 @@
BOOST_ASSERT(buffer->size() > sizeof(std::size_t));
- return *reinterpret_cast<const std::size_t*>(buffer->buf());
+ return *reinterpret_cast<const std::size_t*>(buffer->data());
}
};
diff --git a/src/logic.cpp b/src/logic.cpp
index 44115eb..ca1f6e2 100644
--- a/src/logic.cpp
+++ b/src/logic.cpp
@@ -252,7 +252,7 @@
_LOG_DEBUG_ID("updateSeqNo: not in Reset ");
ConstBufferPtr previousRoot = m_state.getRootDigest();
{
- std::string hash = ndn::toHex(previousRoot->buf(), previousRoot->size(), false);
+ std::string hash = ndn::toHex(previousRoot->data(), previousRoot->size(), false);
_LOG_DEBUG_ID("Hash: " << hash);
}
@@ -691,7 +691,7 @@
void
Logic::printDigest(ConstBufferPtr digest)
{
- std::string hash = ndn::toHex(digest->buf(), digest->size(), false);
+ std::string hash = ndn::toHex(digest->data(), digest->size(), false);
_LOG_DEBUG_ID("Hash: " << hash);
}
diff --git a/src/state.cpp b/src/state.cpp
index b89509b..c6b3ead 100644
--- a/src/state.cpp
+++ b/src/state.cpp
@@ -26,9 +26,7 @@
namespace chronosync {
-State::~State()
-{
-}
+State::~State() = default;
/**
* @brief Add or update leaf to the sync tree
@@ -68,7 +66,7 @@
BOOST_FOREACH (ConstLeafPtr leaf, m_leaves.get<ordered>())
{
BOOST_ASSERT(leaf != 0);
- m_digest.update(leaf->getDigest()->buf(), leaf->getDigest()->size());
+ m_digest.update(leaf->getDigest()->data(), leaf->getDigest()->size());
}
return m_digest.computeDigest();
diff --git a/tests/unit-tests/test-leaf.cpp b/tests/unit-tests/test-leaf.cpp
index 1588514..94ee50c 100644
--- a/tests/unit-tests/test-leaf.cpp
+++ b/tests/unit-tests/test-leaf.cpp
@@ -56,7 +56,7 @@
BOOST_CHECK_NO_THROW(leaf.getDigest());
ndn::ConstBufferPtr digest = leaf.getDigest();
- BOOST_CHECK_EQUAL(result, ndn::toHex(digest->buf(), digest->size(), false));
+ BOOST_CHECK_EQUAL(result, ndn::toHex(digest->data(), digest->size(), false));
}
BOOST_AUTO_TEST_CASE(Container)