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

@@ -20,7 +20,7 @@
#ifndef RIPPLE_OVERLAY_CONNECTATTEMPT_H_INCLUDED
#define RIPPLE_OVERLAY_CONNECTATTEMPT_H_INCLUDED
#include "ripple.pb.h"
#include <ripple/protocol/messages.h>
#include <ripple/overlay/impl/OverlayImpl.h>
#include <ripple/overlay/impl/Tuning.h>

View File

@@ -22,7 +22,6 @@
#include <ripple/app/consensus/RCLCxPeerPos.h>
#include <ripple/basics/Log.h>
#include <ripple/beast/core/ByteOrder.h>
#include <ripple/beast/utility/WrappedSink.h>
#include <ripple/basics/RangeSet.h>
#include <ripple/overlay/impl/ProtocolMessage.h>
@@ -32,6 +31,7 @@
#include <ripple/protocol/STValidation.h>
#include <ripple/resource/Fees.h>
#include <boost/endian/conversion.hpp>
#include <cstdint>
#include <deque>
#include <queue>
@@ -519,8 +519,8 @@ PeerImp::sendEndpoints (FwdIt first, FwdIt last)
protocol::TMEndpoint& tme (*tm.add_endpoints());
if (ep.address.is_v4())
tme.mutable_ipv4()->set_ipv4(
beast::toNetworkByteOrder<std::uint32_t> (
ep.address.to_v4().to_ulong()));
boost::endian::native_to_big(
static_cast<std::uint32_t>(ep.address.to_v4().to_ulong())));
else
tme.mutable_ipv4()->set_ipv4(0);
tme.mutable_ipv4()->set_ipv4port (ep.address.port());

View File

@@ -20,7 +20,7 @@
#ifndef RIPPLE_OVERLAY_PROTOCOLMESSAGE_H_INCLUDED
#define RIPPLE_OVERLAY_PROTOCOLMESSAGE_H_INCLUDED
#include "ripple.pb.h"
#include <ripple/protocol/messages.h>
#include <ripple/overlay/Message.h>
#include <ripple/overlay/impl/ZeroCopyStream.h>
#include <boost/asio/buffer.hpp>

View File

@@ -20,7 +20,7 @@
#ifndef RIPPLE_OVERLAY_TMHELLO_H_INCLUDED
#define RIPPLE_OVERLAY_TMHELLO_H_INCLUDED
#include "ripple.pb.h"
#include <ripple/protocol/messages.h>
#include <ripple/app/main/Application.h>
#include <ripple/beast/utility/Journal.h>
#include <ripple/protocol/BuildInfo.h>

View File

@@ -20,7 +20,7 @@
#ifndef RIPPLE_OVERLAY_TRAFFIC_H_INCLUDED
#define RIPPLE_OVERLAY_TRAFFIC_H_INCLUDED
#include "ripple.pb.h"
#include <ripple/protocol/messages.h>
#include <atomic>
#include <map>