mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Use Boost.Endian instead of custom wrappers
This commit is contained in:
committed by
Nik Bougalis
parent
11ab98cced
commit
3aaf6d7857
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user