Use Boost.Endian instead of custom wrappers

This commit is contained in:
Nikolaos D. Bougalis
2018-05-07 21:24:22 -07:00
committed by Nik Bougalis
parent 11ab98cced
commit 3aaf6d7857
20 changed files with 61 additions and 502 deletions

View File

@@ -19,6 +19,7 @@
#include <ripple/protocol/digest.h>
#include <ripple/protocol/Indexes.h>
#include <boost/endian/conversion.hpp>
#include <cassert>
namespace ripple {
@@ -125,7 +126,7 @@ getQualityIndex (uint256 const& uBase, const std::uint64_t uNodeDir)
// TODO(tom): there must be a better way.
// VFALCO [base_uint] This assumes a certain storage format
((std::uint64_t*) uNode.end ())[-1] = htobe64 (uNodeDir);
((std::uint64_t*) uNode.end ())[-1] = boost::endian::native_to_big (uNodeDir);
return uNode;
}
@@ -142,7 +143,7 @@ std::uint64_t
getQuality (uint256 const& uBase)
{
// VFALCO [base_uint] This assumes a certain storage format
return be64toh (((std::uint64_t*) uBase.end ())[-1]);
return boost::endian::big_to_native (((std::uint64_t*) uBase.end ())[-1]);
}
uint256