mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
beast cleanup and tidying:
* Replace custom types with C++11 <cstdint> types * Fix sqlite integer intos and uses * Fix String implicit integer constructors * Escape the enclosing namespace in sqdb * Replace contract checks with assert * Make many header files compile independently * Remove the dependence on beast_core.h in many places * Remove unused or obsolete classes and functions * Remove unused or obsolete macros * Remove unused network functions and files * Remove unused or obsolete classes: - ChildProcess - HighResolutionTimer - InterProcessLock - Throw - TrackedMutex - UntrackedMutex - XmlDocument - XmlElement
This commit is contained in:
@@ -20,6 +20,9 @@
|
||||
#ifndef RIPPLE_VALIDATORS_MANAGER_H_INCLUDED
|
||||
#define RIPPLE_VALIDATORS_MANAGER_H_INCLUDED
|
||||
|
||||
#include "../../beast/beast/threads/Stoppable.h"
|
||||
#include "../../beast/modules/beast_core/files/File.h"
|
||||
|
||||
namespace ripple {
|
||||
namespace Validators {
|
||||
|
||||
|
||||
@@ -20,6 +20,9 @@
|
||||
#ifndef RIPPLE_VALIDATORS_SOURCE_H_INCLUDED
|
||||
#define RIPPLE_VALIDATORS_SOURCE_H_INCLUDED
|
||||
|
||||
#include "../../beast/beast/smart_ptr/SharedObject.h"
|
||||
#include "../../beast/modules/beast_core/time/Time.h"
|
||||
|
||||
namespace ripple {
|
||||
namespace Validators {
|
||||
|
||||
@@ -69,7 +72,9 @@ public:
|
||||
Results ();
|
||||
|
||||
bool success;
|
||||
// VFALCO TODO Replace with std::string
|
||||
beast::String message;
|
||||
// VFALCO TODO Replace with chrono
|
||||
beast::Time expirationTime;
|
||||
std::vector <Item> list;
|
||||
};
|
||||
|
||||
@@ -283,7 +283,7 @@ public:
|
||||
{
|
||||
Context::Scope scope (m_context);
|
||||
|
||||
map ["trusted"] = beast::uint32 (
|
||||
map ["trusted"] = std::uint32_t (
|
||||
m_logic.m_chosenList ?
|
||||
m_logic.m_chosenList->size() : 0);
|
||||
|
||||
|
||||
@@ -54,11 +54,11 @@ public:
|
||||
|
||||
void fetch (Results& results, beast::Journal journal)
|
||||
{
|
||||
beast::int64 const fileSize (m_file.getSize ());
|
||||
std::int64_t const fileSize (m_file.getSize ());
|
||||
|
||||
if (fileSize != 0)
|
||||
{
|
||||
if (fileSize < std::numeric_limits<beast::int32>::max())
|
||||
if (fileSize < std::numeric_limits<std::int32_t>::max())
|
||||
{
|
||||
beast::MemoryBlock buffer (fileSize);
|
||||
beast::RandomAccessFile f;
|
||||
|
||||
@@ -99,7 +99,7 @@ public:
|
||||
|
||||
struct TestSource : Source
|
||||
{
|
||||
TestSource (beast::String const& name, beast::uint32 start, beast::uint32 end)
|
||||
TestSource (beast::String const& name, std::uint32_t start, std::uint32_t end)
|
||||
: m_name (name)
|
||||
, m_start (start)
|
||||
, m_end (end)
|
||||
@@ -130,7 +130,7 @@ public:
|
||||
results.message = beast::String::empty;
|
||||
results.list.reserve (numberOfTestValidators);
|
||||
|
||||
for (beast::uint32 i = m_start ; i < m_end; ++i)
|
||||
for (std::uint32_t i = m_start ; i < m_end; ++i)
|
||||
{
|
||||
Item item;;
|
||||
item.publicKey = RipplePublicKey::createFromInteger (i);
|
||||
@@ -178,8 +178,8 @@ public:
|
||||
for (int i = 1; i <= numberofTestSources; ++i)
|
||||
{
|
||||
beast::String const name (beast::String::fromNumber (i));
|
||||
beast::uint32 const start = r.nextInt (numberOfTestValidators);
|
||||
beast::uint32 const end = start + r.nextInt (numberOfTestValidators);
|
||||
std::uint32_t const start = r.nextInt (numberOfTestValidators);
|
||||
std::uint32_t const end = start + r.nextInt (numberOfTestValidators);
|
||||
logic.add (new TestSource (name, start, end));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,8 +20,6 @@
|
||||
#ifndef RIPPLE_VALIDATORS_H_INCLUDED
|
||||
#define RIPPLE_VALIDATORS_H_INCLUDED
|
||||
|
||||
#include "../beast/modules/beast_core/beast_core.h"
|
||||
|
||||
#include "../beast/beast/http/URL.h"
|
||||
|
||||
#include "../ripple/types/ripple_types.h"
|
||||
|
||||
Reference in New Issue
Block a user