From 32ec3fe08903d4fd4d30de2eb7242510fe4b56b7 Mon Sep 17 00:00:00 2001 From: Tom Ritchford Date: Tue, 28 Jul 2015 23:24:25 -0400 Subject: [PATCH] Remove trailing spaces. --- src/beast/beast/ByteOrder.h | 10 +- src/beast/beast/Config.h | 2 +- src/beast/beast/Memory.h | 4 +- src/beast/beast/asio/error.h | 2 +- src/beast/beast/asio/impl/error.cpp | 4 +- src/beast/beast/asio/streambuf.h | 2 +- src/beast/beast/asio/tests/error_test.cpp | 2 +- src/beast/beast/asio/tests/streambuf.test.cpp | 2 +- src/beast/beast/chrono/chrono_io.h | 4 +- src/beast/beast/chrono/impl/RelativeTime.cpp | 18 +- src/beast/beast/container/cyclic_iterator.h | 2 +- src/beast/beast/crypto/base64.h | 2 +- src/beast/beast/crypto/detail/mac_facade.h | 2 +- .../beast/crypto/detail/ripemd_context.h | 12 +- src/beast/beast/crypto/detail/sha2_context.h | 6 +- .../cxx14/tests/integer_sequence.test.cpp | 12 +- src/beast/beast/cxx14/type_traits.h | 6 +- src/beast/beast/hash/hash_append.h | 20 +- src/beast/beast/hash/impl/siphash.cpp | 14 +- src/beast/beast/hash/impl/spookyv2.cpp | 76 +- src/beast/beast/hash/impl/spookyv2.h | 24 +- .../beast/hash/tests/hash_append_test.cpp | 6 +- src/beast/beast/http/headers.h | 2 +- src/beast/beast/http/impl/URL.cpp | 2 +- src/beast/beast/http/impl/basic_parser.cpp | 2 +- src/beast/beast/http/impl/basic_url.cpp | 2 +- src/beast/beast/http/impl/joyent_parser.cpp | 4 +- src/beast/beast/http/impl/joyent_parser.h | 2 +- src/beast/beast/http/message.h | 4 +- src/beast/beast/http/parser.h | 4 +- src/beast/beast/http/tests/URL.test.cpp | 2 +- .../beast/http/tests/chunked_encoder.test.cpp | 2 +- .../beast/http/tests/urls_large_data.cpp | 2 +- src/beast/beast/insight/Collector.h | 6 +- src/beast/beast/insight/Counter.h | 2 +- src/beast/beast/insight/CounterImpl.h | 2 +- src/beast/beast/insight/Event.h | 2 +- src/beast/beast/insight/Gauge.h | 2 +- src/beast/beast/insight/Hook.h | 2 +- src/beast/beast/insight/Meter.h | 2 +- src/beast/beast/insight/NullCollector.h | 2 +- .../beast/insight/impl/NullCollector.cpp | 2 +- .../beast/insight/impl/StatsDCollector.cpp | 4 +- src/beast/beast/intrusive/List.h | 66 +- src/beast/beast/intrusive/LockFreeStack.h | 8 +- src/beast/beast/module/asio/HTTPMessage.h | 2 +- .../beast/module/core/containers/Array.h | 2 +- .../core/diagnostic/SemanticVersion.cpp | 4 +- .../module/core/diagnostic/SemanticVersion.h | 6 +- .../module/core/files/FileOutputStream.h | 2 +- src/beast/beast/module/core/maths/Random.h | 2 +- .../beast/module/core/streams/InputStream.h | 4 +- .../module/core/streams/MemoryOutputStream.h | 2 +- .../beast/module/core/text/LexicalCast.h | 2 +- .../beast/module/core/thread/DeadlineTimer.h | 2 +- .../beast/module/core/thread/Workers.cpp | 2 +- .../module/core/thread/detail/ScopedLock.h | 4 +- .../beast/module/core/threads/ScopedLock.h | 2 +- src/beast/beast/net/DynamicBuffer.h | 2 +- src/beast/beast/net/IPAddress.h | 8 +- src/beast/beast/net/IPAddressV4.h | 2 +- src/beast/beast/net/impl/DynamicBuffer.cpp | 2 +- src/beast/beast/net/impl/IPAddressV4.cpp | 2 +- src/beast/beast/nudb/api.h | 4 +- src/beast/beast/nudb/detail/varint.h | 2 +- src/beast/beast/nudb/store.h | 4 +- src/beast/beast/random/xor_shift_engine.h | 2 +- src/beast/beast/smart_ptr/SharedPtr.h | 4 +- src/beast/beast/streams/debug_ostream.h | 2 +- src/beast/beast/threads/SharedLockGuard.h | 2 +- src/beast/beast/threads/SharedMutexAdapter.h | 4 +- src/beast/beast/threads/Stoppable.h | 6 +- src/beast/beast/threads/Thread.h | 2 +- src/beast/beast/unit_test/match.h | 2 +- src/beast/beast/unit_test/thread.h | 2 +- src/beast/beast/utility/Debug.h | 2 +- src/beast/beast/utility/Journal.h | 2 +- src/beast/beast/utility/PropertyStream.h | 4 +- src/beast/beast/utility/impl/Debug.cpp | 2 +- .../beast/utility/impl/PropertyStream.cpp | 18 +- src/beast/beast/utility/meta.h | 12 +- src/beast/beast/utility/static_initializer.h | 4 +- .../beast/utility/tests/Journal.test.cpp | 2 +- .../utility/tests/tagged_integer.test.cpp | 6 +- .../beast/utility/tests/weak_fn.test.cpp | 2 +- src/beast/beast/weak_fn.h | 10 +- src/ripple/app/ledger/AcceptedLedgerTx.h | 2 +- src/ripple/app/ledger/OpenLedger.h | 2 +- src/ripple/app/ledger/impl/OpenLedger.cpp | 2 +- src/ripple/app/ledger/tests/common_ledger.h | 6 +- src/ripple/app/misc/UniqueNodeList.cpp | 10 +- src/ripple/app/paths/PathState.h | 4 +- src/ripple/app/paths/RippleCalc.h | 2 +- src/ripple/app/tx/apply.h | 1 - .../app/tx/impl/InboundTransactions.cpp | 2 +- src/ripple/basics/chrono.h | 2 +- src/ripple/core/impl/Config.cpp | 2 +- src/ripple/core/impl/SNTPClock.cpp | 4 +- src/ripple/core/impl/SNTPClock.h | 2 +- src/ripple/core/tests/SociDB.test.cpp | 4 +- src/ripple/crypto/impl/ec_key.h | 2 +- src/ripple/ledger/TxMeta.h | 2 +- src/ripple/ledger/detail/RawStateTable.h | 2 +- src/ripple/ledger/tests/View_test.cpp | 4 +- src/ripple/nodestore/Database.h | 2 +- src/ripple/nodestore/NodeObject.h | 4 +- src/ripple/nodestore/impl/BatchWriter.cpp | 2 +- src/ripple/nodestore/impl/EncodedBlob.cpp | 2 +- src/ripple/nodestore/tests/Timing.test.cpp | 4 +- src/ripple/nodestore/tests/import_test.cpp | 6 +- src/ripple/overlay/PeerSet.h | 2 +- src/ripple/overlay/impl/ConnectAttempt.cpp | 2 +- src/ripple/overlay/tests/manifest_test.cpp | 2 +- src/ripple/protocol/Keylet.h | 2 +- src/ripple/protocol/PublicKey.h | 2 +- src/ripple/protocol/STInteger.h | 2 +- src/ripple/protocol/STLedgerEntry.h | 20 +- src/ripple/protocol/STPathSet.h | 2 +- src/ripple/protocol/STVector256.h | 4 +- src/ripple/protocol/Serializer.h | 2 +- src/ripple/protocol/digest.h | 4 +- src/ripple/protocol/impl/STArray.cpp | 2 +- src/ripple/protocol/impl/tokens.cpp | 2 +- src/ripple/protocol/tests/PublicKey_test.cpp | 2 +- src/ripple/protocol/tokens.h | 2 +- src/ripple/resource/impl/Entry.h | 2 +- src/ripple/rpc/RipplePathFind.h | 2 +- src/ripple/shamap/SHAMap.h | 4 +- src/ripple/shamap/SHAMapMissingNode.h | 2 +- src/ripple/shamap/tests/SHAMap.test.cpp | 2 +- src/ripple/test/jtx/Env.h | 1096 ++++++++--------- src/ripple/test/jtx/flags.h | 4 +- src/ripple/test/jtx/ticket.h | 2 +- src/ripple/unl/impl/BasicHorizon.h | 2 +- src/ripple/unl/impl/Logic.cpp | 2 +- src/ripple/unl/impl/Logic.h | 2 - src/ripple/websocket/WebSocket02.h | 2 +- src/ripple/websocket/WebSocket04.h | 4 +- 138 files changed, 881 insertions(+), 884 deletions(-) diff --git a/src/beast/beast/ByteOrder.h b/src/beast/beast/ByteOrder.h index 6577d616c..67c94cb6b 100644 --- a/src/beast/beast/ByteOrder.h +++ b/src/beast/beast/ByteOrder.h @@ -194,7 +194,7 @@ namespace detail { /** Specialized helper class template for swapping bytes. - + Normally you won't use this directly, use the helper function byteSwap instead. You can specialize this class for your own user defined types, as was done for uint24. @@ -204,7 +204,7 @@ namespace detail template struct SwapBytes { - inline IntegralType operator() (IntegralType value) const noexcept + inline IntegralType operator() (IntegralType value) const noexcept { return ByteOrder::swap (value); } @@ -215,7 +215,7 @@ struct SwapBytes template <> struct SwapBytes { - inline std::int16_t operator() (std::int16_t value) const noexcept + inline std::int16_t operator() (std::int16_t value) const noexcept { return static_cast (ByteOrder::swap (static_cast (value))); } @@ -224,7 +224,7 @@ struct SwapBytes template <> struct SwapBytes { - inline std::int32_t operator() (std::int32_t value) const noexcept + inline std::int32_t operator() (std::int32_t value) const noexcept { return static_cast (ByteOrder::swap (static_cast (value))); } @@ -233,7 +233,7 @@ struct SwapBytes template <> struct SwapBytes { - inline std::int64_t operator() (std::int64_t value) const noexcept + inline std::int64_t operator() (std::int64_t value) const noexcept { return static_cast (ByteOrder::swap (static_cast (value))); } diff --git a/src/beast/beast/Config.h b/src/beast/beast/Config.h index 8f10fedf0..aade21765 100644 --- a/src/beast/beast/Config.h +++ b/src/beast/beast/Config.h @@ -56,5 +56,5 @@ // Suffix #include - + #endif diff --git a/src/beast/beast/Memory.h b/src/beast/beast/Memory.h index 067242f9b..b556f3c4a 100644 --- a/src/beast/beast/Memory.h +++ b/src/beast/beast/Memory.h @@ -25,7 +25,7 @@ #define BEAST_MEMORY_H_INCLUDED #include - + #include namespace beast { @@ -86,7 +86,7 @@ Type* createCopyIfNotNull (const Type* pointer) ScopedAutoReleasePool(ScopedAutoReleasePool const&) = delete; ScopedAutoReleasePool& operator= (ScopedAutoReleasePool const&) = delete; - + private: void* pool; }; diff --git a/src/beast/beast/asio/error.h b/src/beast/beast/asio/error.h index 342e0fee3..18ab67cc9 100644 --- a/src/beast/beast/asio/error.h +++ b/src/beast/beast/asio/error.h @@ -34,7 +34,7 @@ is_short_read (boost::system::error_code const& ec) return (ec.category() == boost::asio::error::get_ssl_category()) && (ERR_GET_REASON(ec.value()) == SSL_R_SHORT_READ); } - + /** Returns a human readable message if the error code is SSL related. */ std::string asio_message(boost::system::error_code const& ec); diff --git a/src/beast/beast/asio/impl/error.cpp b/src/beast/beast/asio/impl/error.cpp index c97b15a15..65ede2e83 100644 --- a/src/beast/beast/asio/impl/error.cpp +++ b/src/beast/beast/asio/impl/error.cpp @@ -41,8 +41,8 @@ asio_message (boost::system::error_code const& ec) + "," + boost::lexical_cast (ERR_GET_REASON (ec.value ())) + ") "; - - // + + // char buf[errorBufferSize]; ::ERR_error_string_n (ec.value (), buf, errorBufferSize); error += buf; diff --git a/src/beast/beast/asio/streambuf.h b/src/beast/beast/asio/streambuf.h index 7988838e5..1a5a35755 100644 --- a/src/beast/beast/asio/streambuf.h +++ b/src/beast/beast/asio/streambuf.h @@ -112,7 +112,7 @@ private: the output sequence is empty, out_ will point to the end of the list of buffers, and out_pos_ and out_end_ will be 0: - + |<------+------------------>| out_ == list_.end() in_pos_ out_pos_ == 0 out_end_ == 0 diff --git a/src/beast/beast/asio/tests/error_test.cpp b/src/beast/beast/asio/tests/error_test.cpp index bc64109de..32e43decf 100644 --- a/src/beast/beast/asio/tests/error_test.cpp +++ b/src/beast/beast/asio/tests/error_test.cpp @@ -28,7 +28,7 @@ class error_test : public unit_test::suite { public: void run () - { + { { boost::system::error_code ec = boost::system::error_code (335544539, boost::asio::error::get_ssl_category ()); diff --git a/src/beast/beast/asio/tests/streambuf.test.cpp b/src/beast/beast/asio/tests/streambuf.test.cpp index 5361ad3b6..f36c121d8 100644 --- a/src/beast/beast/asio/tests/streambuf.test.cpp +++ b/src/beast/beast/asio/tests/streambuf.test.cpp @@ -145,7 +145,7 @@ public: b.commit(10); expect(to_str(b.data()) == "567890ABCD"); } - + test_prepare(); test_commit(); test_consume(); diff --git a/src/beast/beast/chrono/chrono_io.h b/src/beast/beast/chrono/chrono_io.h index 1d2490ea5..c17fe96fa 100644 --- a/src/beast/beast/chrono/chrono_io.h +++ b/src/beast/beast/chrono/chrono_io.h @@ -32,7 +32,7 @@ #include #include #include - + /* chrono_io synopsis @@ -58,7 +58,7 @@ public: explicit durationpunct(size_t refs = 0); explicit durationpunct(duration_style fmt, size_t refs = 0); - + bool is_symbol_name() const noexcept; bool is_prefix_name() const noexcept; }; diff --git a/src/beast/beast/chrono/impl/RelativeTime.cpp b/src/beast/beast/chrono/impl/RelativeTime.cpp index a08e3558b..0eb70e445 100644 --- a/src/beast/beast/chrono/impl/RelativeTime.cpp +++ b/src/beast/beast/chrono/impl/RelativeTime.cpp @@ -268,7 +268,7 @@ static double monotonicCurrentTimeInSeconds() { return GetTickCount64() / 1000.0; } - + } } @@ -279,7 +279,7 @@ static double monotonicCurrentTimeInSeconds() namespace beast { namespace detail { - + static double monotonicCurrentTimeInSeconds() { struct StaticInitializer @@ -291,7 +291,7 @@ static double monotonicCurrentTimeInSeconds() mach_timebase_info_data_t timebase; (void) mach_timebase_info (&timebase); - + if (timebase.numer % 1000000 == 0) { numerator = timebase.numer / 1000000.0; @@ -304,13 +304,13 @@ static double monotonicCurrentTimeInSeconds() //denominator = timebase.denom * (std::uint64_t) 1000000 * 1000.0; denominator = timebase.denom * 1000000000.0; } - + ratio = numerator / denominator; } double ratio; }; - + static StaticInitializer const data; return mach_absolute_time() * data.ratio; @@ -319,7 +319,7 @@ static double monotonicCurrentTimeInSeconds() } #else - + #include namespace beast { @@ -334,7 +334,7 @@ static double monotonicCurrentTimeInSeconds() } } - + #endif namespace beast { @@ -349,7 +349,7 @@ static double getStartupTime() { when = detail::monotonicCurrentTimeInSeconds(); } - + double when; }; @@ -368,7 +368,7 @@ struct StartupTimeStaticInitializer }; static StartupTimeStaticInitializer startupTimeStaticInitializer; - + } RelativeTime RelativeTime::fromStartup () diff --git a/src/beast/beast/container/cyclic_iterator.h b/src/beast/beast/container/cyclic_iterator.h index 2afe817a0..167ced9b5 100644 --- a/src/beast/beast/container/cyclic_iterator.h +++ b/src/beast/beast/container/cyclic_iterator.h @@ -115,7 +115,7 @@ struct cyclic_iterator_base } // -// cyclic_iterator_decl.hpp +// cyclic_iterator_decl.hpp // /** diff --git a/src/beast/beast/crypto/base64.h b/src/beast/beast/crypto/base64.h index 634610da2..4f2ecbba1 100644 --- a/src/beast/beast/crypto/base64.h +++ b/src/beast/beast/crypto/base64.h @@ -25,7 +25,7 @@ namespace beast { -/* +/* Portions from http://www.adp-gmbh.ch/cpp/common/base64.html Copyright notice: diff --git a/src/beast/beast/crypto/detail/mac_facade.h b/src/beast/beast/crypto/detail/mac_facade.h index 8997048c3..6dd7ff8b8 100644 --- a/src/beast/beast/crypto/detail/mac_facade.h +++ b/src/beast/beast/crypto/detail/mac_facade.h @@ -44,7 +44,7 @@ public: std::array; - mac_facade() noexcept + mac_facade() noexcept { init(ctx_); } diff --git a/src/beast/beast/crypto/detail/ripemd_context.h b/src/beast/beast/crypto/detail/ripemd_context.h index cc5f91fbb..391fd3d4e 100644 --- a/src/beast/beast/crypto/detail/ripemd_context.h +++ b/src/beast/beast/crypto/detail/ripemd_context.h @@ -71,12 +71,12 @@ struct ripemd160_context #define BEAST_RIPEMD_ROL(x, n) (((x) << (n)) | ((x) >> (32-(n)))) // the five basic functions F(), G() and H() -#define BEAST_RIPEMD_F(x, y, z) ((x) ^ (y) ^ (z)) -#define BEAST_RIPEMD_G(x, y, z) (((x) & (y)) | (~(x) & (z))) +#define BEAST_RIPEMD_F(x, y, z) ((x) ^ (y) ^ (z)) +#define BEAST_RIPEMD_G(x, y, z) (((x) & (y)) | (~(x) & (z))) #define BEAST_RIPEMD_H(x, y, z) (((x) | ~(y)) ^ (z)) -#define BEAST_RIPEMD_I(x, y, z) (((x) & (z)) | ((y) & ~(z))) +#define BEAST_RIPEMD_I(x, y, z) (((x) & (z)) | ((y) & ~(z))) #define BEAST_RIPEMD_J(x, y, z) ((x) ^ ((y) | ~(z))) - + // the ten basic operations FF() through III() #define BEAST_RIPEMD_FF(a, b, c, d, e, x, s) { \ (a) += BEAST_RIPEMD_F((b), (c), (d)) + (x); \ @@ -166,7 +166,7 @@ void ripemd_compress (ripemd160_context& ctx, BEAST_RIPEMD_FF(cc, dd, ee, aa, bb, X[13], 7); BEAST_RIPEMD_FF(bb, cc, dd, ee, aa, X[14], 9); BEAST_RIPEMD_FF(aa, bb, cc, dd, ee, X[15], 8); - + // round 2 BEAST_RIPEMD_GG(ee, aa, bb, cc, dd, X[ 7], 7); BEAST_RIPEMD_GG(dd, ee, aa, bb, cc, X[ 4], 6); @@ -258,7 +258,7 @@ void ripemd_compress (ripemd160_context& ctx, BEAST_RIPEMD_JJJ(aaa, bbb, ccc, ddd, eee, X[12], 6); // parallel round 2 - BEAST_RIPEMD_III(eee, aaa, bbb, ccc, ddd, X[ 6], 9); + BEAST_RIPEMD_III(eee, aaa, bbb, ccc, ddd, X[ 6], 9); BEAST_RIPEMD_III(ddd, eee, aaa, bbb, ccc, X[11], 13); BEAST_RIPEMD_III(ccc, ddd, eee, aaa, bbb, X[ 3], 15); BEAST_RIPEMD_III(bbb, ccc, ddd, eee, aaa, X[ 7], 7); diff --git a/src/beast/beast/crypto/detail/sha2_context.h b/src/beast/beast/crypto/detail/sha2_context.h index 101034936..4cb3449fd 100644 --- a/src/beast/beast/crypto/detail/sha2_context.h +++ b/src/beast/beast/crypto/detail/sha2_context.h @@ -34,7 +34,7 @@ namespace detail { /* * Updated to C++, zedwood.com 2012 * Based on Olivier Gay's version - * See Modified BSD License below: + * See Modified BSD License below: * * FIPS 180-2 SHA-224/256/384/512 implementation * Issue date: 04/30/2005 @@ -83,7 +83,7 @@ struct sha512_context { static unsigned int const block_size = 128; static unsigned int const digest_size = 64; - + unsigned int tot_len; unsigned int len; unsigned char block[2 * block_size]; @@ -369,7 +369,7 @@ void init (sha512_context& ctx) noexcept ctx.h[3] = 0xa54ff53a5f1d36f1ULL; ctx.h[4] = 0x510e527fade682d1ULL; ctx.h[5] = 0x9b05688c2b3e6c1fULL; - ctx.h[6] = 0x1f83d9abfb41bd6bULL; + ctx.h[6] = 0x1f83d9abfb41bd6bULL; ctx.h[7] = 0x5be0cd19137e2179ULL; } diff --git a/src/beast/beast/cxx14/tests/integer_sequence.test.cpp b/src/beast/beast/cxx14/tests/integer_sequence.test.cpp index a844290c8..0763666f9 100644 --- a/src/beast/beast/cxx14/tests/integer_sequence.test.cpp +++ b/src/beast/beast/cxx14/tests/integer_sequence.test.cpp @@ -55,20 +55,20 @@ public: using size2 = std::index_sequence_for; // generates size_t: 0,1 using intmix = std::integer_sequence; // generates int: 9,8,7,2 using sizemix = std::index_sequence<1, 1, 2, 3, 5>; // generates size_t: 1,1,2,3,5 - + // Make sure they're what we expect static_assert ( std::is_same ::value, "int3 type wrong" ); static_assert ( int3::static_size == 3, "int3 size wrong" ); - + static_assert ( std::is_same ::value, "size7 type wrong" ); static_assert ( size7::static_size == 7, "size7 size wrong" ); - + static_assert ( std::is_same ::value, "size4 type wrong" ); static_assert ( size4::static_size == 4, "size4 size wrong" ); - + static_assert ( std::is_same ::value, "size2 type wrong" ); static_assert ( size2::static_size == 2, "size2 size wrong" ); - + static_assert ( std::is_same ::value, "intmix type wrong" ); static_assert ( intmix::static_size == 4, "intmix size wrong" ); @@ -76,7 +76,7 @@ public: static_assert ( sizemix::static_size == 5, "sizemix size wrong" ); auto tup = std::make_tuple ( 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 ); - + // Use them auto t3 = extract ( tup, int3() ); static_assert ( std::tuple_size::value == int3::static_size, "t3 size wrong"); diff --git a/src/beast/beast/cxx14/type_traits.h b/src/beast/beast/cxx14/type_traits.h index 30f8b6920..bfd37b50c 100644 --- a/src/beast/beast/cxx14/type_traits.h +++ b/src/beast/beast/cxx14/type_traits.h @@ -90,7 +90,7 @@ template using add_volatile_t = typename add_volatile::type; // C++14 template using add_cv_t = typename add_cv::type; // C++14 - + // reference modifications: template using remove_reference_t = typename remove_reference::type; // C++14 @@ -98,13 +98,13 @@ template using add_lvalue_reference_t = typename add_lvalue_reference::type; // C++14 template using add_rvalue_reference_t = typename add_rvalue_reference::type; // C++14 - + // sign modifications: template using make_signed_t = typename make_signed::type; // C++14 template using make_unsigned_t = typename make_unsigned::type; // C++14 - + // array modifications: template using remove_extent_t = typename remove_extent::type; // C++14 diff --git a/src/beast/beast/hash/hash_append.h b/src/beast/beast/hash/hash_append.h index e7d274535..9a8615696 100644 --- a/src/beast/beast/hash/hash_append.h +++ b/src/beast/beast/hash/hash_append.h @@ -120,7 +120,7 @@ struct is_uniquely_represented template struct is_uniquely_represented> - : public std::integral_constant::value && + : public std::integral_constant::value && is_uniquely_represented::value && sizeof(T) + sizeof(U) == sizeof(std::pair)> { @@ -131,7 +131,7 @@ struct is_uniquely_represented> template struct is_uniquely_represented> : public std::integral_constant::value...>::value && + static_and::value...>::value && static_sum::value == sizeof(std::tuple)> { }; @@ -148,7 +148,7 @@ struct is_uniquely_represented template struct is_uniquely_represented> - : public std::integral_constant::value && + : public std::integral_constant::value && sizeof(T)*N == sizeof(std::array)> { }; @@ -159,7 +159,7 @@ struct is_uniquely_represented> combination of possible values of `T` held in `x` and `y`, if `x == y`, then it must be true that `memcmp(&x, &y, sizeof(T))` return 0; i.e. that `x` and `y` are represented by the same bit pattern. - + For example: A two's complement `int` should be contiguously hashable. Every bit pattern produces a unique value that does not compare equal to any other bit pattern's value. A IEEE floating point should not be @@ -206,7 +206,7 @@ struct is_contiguously_hashable Never Effect: Returns the reslting hash of all the input data. -*/ +*/ /** @{ */ // scalars @@ -271,21 +271,21 @@ hash_append(Hasher& h, T (&a)[N]) noexcept; template std::enable_if_t < - !is_contiguously_hashable::value + !is_contiguously_hashable::value > hash_append(Hasher& h, std::basic_string const& s) noexcept; template std::enable_if_t < - is_contiguously_hashable::value + is_contiguously_hashable::value > hash_append(Hasher& h, std::basic_string const& s) noexcept; template std::enable_if_t < - !is_contiguously_hashable, Hasher>::value + !is_contiguously_hashable, Hasher>::value > hash_append (Hasher& h, std::pair const& p) noexcept; @@ -348,7 +348,7 @@ template inline std::enable_if_t < - !is_contiguously_hashable::value + !is_contiguously_hashable::value > hash_append(Hasher& h, std::basic_string const& s) noexcept { @@ -361,7 +361,7 @@ template inline std::enable_if_t < - is_contiguously_hashable::value + is_contiguously_hashable::value > hash_append(Hasher& h, std::basic_string const& s) noexcept { diff --git a/src/beast/beast/hash/impl/siphash.cpp b/src/beast/beast/hash/impl/siphash.cpp index 174c9143c..22125f53e 100644 --- a/src/beast/beast/hash/impl/siphash.cpp +++ b/src/beast/beast/hash/impl/siphash.cpp @@ -1,27 +1,27 @@ //------------------------------- siphash.h ------------------------------------ -// +// // This software is in the public domain. The only restriction on its use is // that no one can remove it from the public domain by claiming ownership of it, // including the original authors. -// +// // There is no warranty of correctness on the software contained herein. Use // at your own risk. // // Derived from: -// +// // SipHash reference C implementation -// +// // Written in 2012 by Jean-Philippe Aumasson // Daniel J. Bernstein -// +// // To the extent possible under law, the author(s) have dedicated all copyright // and related and neighboring rights to this software to the public domain // worldwide. This software is distributed without any warranty. -// +// // You should have received a copy of the CC0 Public Domain Dedication along // with this software. If not, see // . -// +// //------------------------------------------------------------------------------ #include diff --git a/src/beast/beast/hash/impl/spookyv2.cpp b/src/beast/beast/hash/impl/spookyv2.cpp index 8aeeaa15c..85f65d3ee 100644 --- a/src/beast/beast/hash/impl/spookyv2.cpp +++ b/src/beast/beast/hash/impl/spookyv2.cpp @@ -21,7 +21,7 @@ #define ALLOW_UNALIGNED_READS 1 // -// short hash ... it could be used on any message, +// short hash ... it could be used on any message, // but it's used by Spooky just for short messages. // void SpookyHash::Short( @@ -31,16 +31,16 @@ void SpookyHash::Short( uint64 *hash2) { uint64 buf[2*sc_numVars]; - union - { - const uint8 *p8; + union + { + const uint8 *p8; uint32 *p32; - uint64 *p64; - size_t i; + uint64 *p64; + size_t i; } u; u.p8 = (const uint8 *)message; - + if (!ALLOW_UNALIGNED_READS && (u.i & 0x7)) { memcpy(buf, message, length); @@ -56,7 +56,7 @@ void SpookyHash::Short( if (length > 15) { const uint64 *end = u.p64 + (length/32)*4; - + // handle all complete sets of 32 bytes for (; u.p64 < end; u.p64 += 4) { @@ -66,7 +66,7 @@ void SpookyHash::Short( a += u.p64[2]; b += u.p64[3]; } - + //Handle the case of 16+ remaining bytes. if (remainder >= 16) { @@ -77,7 +77,7 @@ void SpookyHash::Short( remainder -= 16; } } - + // Handle the last 0..15 bytes, and its length d += ((uint64)length) << 56; switch (remainder) @@ -131,9 +131,9 @@ void SpookyHash::Short( // do the whole hash in one call void SpookyHash::Hash128( - const void *message, - size_t length, - uint64 *hash1, + const void *message, + size_t length, + uint64 *hash1, uint64 *hash2) { if (length < sc_bufSize) @@ -145,18 +145,18 @@ void SpookyHash::Hash128( uint64 h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11; uint64 buf[sc_numVars]; uint64 *end; - union - { - const uint8 *p8; - uint64 *p64; - size_t i; + union + { + const uint8 *p8; + uint64 *p64; + size_t i; } u; size_t remainder; - + h0=h3=h6=h9 = *hash1; h1=h4=h7=h10 = *hash2; h2=h5=h8=h11 = sc_const; - + u.p8 = (const uint8 *)message; end = u.p64 + (length/sc_blockSize)*sc_numVars; @@ -164,7 +164,7 @@ void SpookyHash::Hash128( if (ALLOW_UNALIGNED_READS || ((u.i & 0x7) == 0)) { while (u.p64 < end) - { + { Mix(u.p64, h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11); u.p64 += sc_numVars; } @@ -185,8 +185,8 @@ void SpookyHash::Hash128( memset(((uint8 *)buf)+remainder, 0, sc_blockSize-remainder); ((uint8 *)buf)[sc_blockSize-1] = static_cast(remainder); - - // do some final mixing + + // do some final mixing End(buf, h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11); *hash1 = h0; *hash2 = h1; @@ -210,14 +210,14 @@ void SpookyHash::Update(const void *message, size_t length) uint64 h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11; size_t newLength = length + m_remainder; uint8 remainder; - union - { - const uint8 *p8; - uint64 *p64; - size_t i; + union + { + const uint8 *p8; + uint64 *p64; + size_t i; } u; const uint64 *end; - + // Is this message fragment too short? If it is, stuff it away. if (newLength < sc_bufSize) { @@ -226,7 +226,7 @@ void SpookyHash::Update(const void *message, size_t length) m_remainder = (uint8)newLength; return; } - + // init the variables if (m_length < sc_bufSize) { @@ -250,7 +250,7 @@ void SpookyHash::Update(const void *message, size_t length) h11 = m_state[11]; } m_length = length + m_length; - + // if we've got anything stuffed away, use it now if (m_remainder) { @@ -266,14 +266,14 @@ void SpookyHash::Update(const void *message, size_t length) { u.p8 = (const uint8 *)message; } - + // handle all whole blocks of sc_blockSize bytes end = u.p64 + (length/sc_blockSize)*sc_numVars; remainder = (uint8)(length-((const uint8 *)end-u.p8)); if (ALLOW_UNALIGNED_READS || (u.i & 0x7) == 0) { while (u.p64 < end) - { + { Mix(u.p64, h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11); u.p64 += sc_numVars; } @@ -281,7 +281,7 @@ void SpookyHash::Update(const void *message, size_t length) else { while (u.p64 < end) - { + { memcpy(m_data, u.p8, sc_blockSize); Mix(m_data, h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11); u.p64 += sc_numVars; @@ -291,7 +291,7 @@ void SpookyHash::Update(const void *message, size_t length) // stuff away the last few bytes m_remainder = remainder; memcpy(m_data, end, remainder); - + // stuff away the variables m_state[0] = h0; m_state[1] = h1; @@ -319,10 +319,10 @@ void SpookyHash::Final(uint64 *hash1, uint64 *hash2) Short( m_data, m_length, hash1, hash2); return; } - + const uint64 *data = (const uint64 *)m_data; uint8 remainder = m_remainder; - + uint64 h0 = m_state[0]; uint64 h1 = m_state[1]; uint64 h2 = m_state[2]; @@ -348,7 +348,7 @@ void SpookyHash::Final(uint64 *hash1, uint64 *hash2) memset(&((uint8 *)data)[remainder], 0, (sc_blockSize-remainder)); ((uint8 *)data)[sc_blockSize-1] = remainder; - + // do some final mixing End(data, h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11); diff --git a/src/beast/beast/hash/impl/spookyv2.h b/src/beast/beast/hash/impl/spookyv2.h index fe3ab31bb..de198b43d 100644 --- a/src/beast/beast/hash/impl/spookyv2.h +++ b/src/beast/beast/hash/impl/spookyv2.h @@ -8,7 +8,7 @@ // Feb 5 2012: adjusted definitions of uint* to be more portable // Mar 30 2012: 3 bytes/cycle, not 4. Alpha was 4 but wasn't thorough enough. // August 5 2012: SpookyV2 (different results) -// +// // Up to 3 bytes/cycle for long messages. Reasonably fast for short messages. // All 1 or 2 bit deltas achieve avalanche within 1% bias per output bit. // @@ -20,9 +20,9 @@ // // Google's CityHash has similar specs to SpookyHash, and CityHash is faster // on new Intel boxes. MD4 and MD5 also have similar specs, but they are orders -// of magnitude slower. CRCs are two or more times slower, but unlike -// SpookyHash, they have nice math for combining the CRCs of pieces to form -// the CRCs of wholes. There are also cryptographic hashes, but those are even +// of magnitude slower. CRCs are two or more times slower, but unlike +// SpookyHash, they have nice math for combining the CRCs of pieces to form +// the CRCs of wholes. There are also cryptographic hashes, but those are even // slower than MD5. // @@ -91,7 +91,7 @@ public: void Init( uint64 seed1, // any 64-bit value will do, including 0 uint64 seed2); // different seeds produce independent hashes - + // // Update: add a piece of a message to a SpookyHash state // @@ -134,7 +134,7 @@ public: // I tried 3 pairs of each; they all differed by at least 212 bits. // static INLINE void Mix( - const uint64 *data, + const uint64 *data, uint64 &s0, uint64 &s1, uint64 &s2, uint64 &s3, uint64 &s4, uint64 &s5, uint64 &s6, uint64 &s7, uint64 &s8, uint64 &s9, uint64 &s10,uint64 &s11) @@ -171,7 +171,7 @@ public: // static INLINE void EndPartial( uint64 &h0, uint64 &h1, uint64 &h2, uint64 &h3, - uint64 &h4, uint64 &h5, uint64 &h6, uint64 &h7, + uint64 &h4, uint64 &h5, uint64 &h6, uint64 &h7, uint64 &h8, uint64 &h9, uint64 &h10,uint64 &h11) { h11+= h1; h2 ^= h11; h1 = Rot64(h1,44); @@ -189,9 +189,9 @@ public: } static INLINE void End( - const uint64 *data, + const uint64 *data, uint64 &h0, uint64 &h1, uint64 &h2, uint64 &h3, - uint64 &h4, uint64 &h5, uint64 &h6, uint64 &h7, + uint64 &h4, uint64 &h5, uint64 &h6, uint64 &h7, uint64 &h8, uint64 &h9, uint64 &h10,uint64 &h11) { h0 += data[0]; h1 += data[1]; h2 += data[2]; h3 += data[3]; @@ -203,7 +203,7 @@ public: } // - // The goal is for each bit of the input to expand into 128 bits of + // The goal is for each bit of the input to expand into 128 bits of // apparent entropy before it is fully overwritten. // n trials both set and cleared at least m bits of h0 h1 h2 h3 // n: 2 m: 29 @@ -259,7 +259,7 @@ public: h0 ^= h3; h3 = Rot64(h3,25); h0 += h3; h1 ^= h0; h0 = Rot64(h0,63); h1 += h0; } - + private: // @@ -267,7 +267,7 @@ private: // Short has a low startup cost, the normal mode is good for long // keys, the cost crossover is at about 192 bytes. The two modes were // held to the same quality bar. - // + // static void Short( const void *message, // message (array of bytes, not necessarily aligned) size_t length, // length of message (in bytes) diff --git a/src/beast/beast/hash/tests/hash_append_test.cpp b/src/beast/beast/hash/tests/hash_append_test.cpp index 711435207..e40ed70c4 100644 --- a/src/beast/beast/hash/tests/hash_append_test.cpp +++ b/src/beast/beast/hash/tests/hash_append_test.cpp @@ -206,7 +206,7 @@ class spooky private: SpookyHash state_; -public: +public: static beast::endian const endian = beast::endian::native; spooky(std::size_t seed1 = 1, std::size_t seed2 = 2) noexcept @@ -429,9 +429,9 @@ public: { auto const start ( std::chrono::high_resolution_clock::now()); - + auto const hashes (make_hashes (keys)); - + results.elapsed = std::chrono::duration_cast ( std::chrono::high_resolution_clock::now() - start); diff --git a/src/beast/beast/http/headers.h b/src/beast/beast/http/headers.h index 940047312..c010dd757 100644 --- a/src/beast/beast/http/headers.h +++ b/src/beast/beast/http/headers.h @@ -396,4 +396,4 @@ build_map (headers const& h) } // http } // beast -#endif \ No newline at end of file +#endif diff --git a/src/beast/beast/http/impl/URL.cpp b/src/beast/beast/http/impl/URL.cpp index d4820614d..1ab27479b 100644 --- a/src/beast/beast/http/impl/URL.cpp +++ b/src/beast/beast/http/impl/URL.cpp @@ -187,7 +187,7 @@ to_string (URL const& url) s.append (url.scheme ()); s.append ("://"); - + if (!url.userinfo ().empty ()) { s.append (url.userinfo ()); diff --git a/src/beast/beast/http/impl/basic_parser.cpp b/src/beast/beast/http/impl/basic_parser.cpp index 8d9aefac7..a31a14b4b 100644 --- a/src/beast/beast/http/impl/basic_parser.cpp +++ b/src/beast/beast/http/impl/basic_parser.cpp @@ -94,7 +94,7 @@ basic_parser::basic_parser (bool request) noexcept h->on_headers_complete = &basic_parser::cb_headers_complete; h->on_body = &basic_parser::cb_body; h->on_message_complete = &basic_parser::cb_message_complete; - + joyent::http_parser_init (s, request ? joyent::http_parser_type::HTTP_REQUEST : joyent::http_parser_type::HTTP_RESPONSE); diff --git a/src/beast/beast/http/impl/basic_url.cpp b/src/beast/beast/http/impl/basic_url.cpp index a05bfa43b..3ae3a9615 100644 --- a/src/beast/beast/http/impl/basic_url.cpp +++ b/src/beast/beast/http/impl/basic_url.cpp @@ -31,7 +31,7 @@ basic_url_base::parse_impl (string_ref s, boost::system::error_code& ec) joyent::http_parser_url p; value_type const* const data (s.data()); - + int const error (joyent::http_parser_parse_url ( data, s.size(), false, &p)); diff --git a/src/beast/beast/http/impl/joyent_parser.cpp b/src/beast/beast/http/impl/joyent_parser.cpp index da444b1a3..2c268717b 100644 --- a/src/beast/beast/http/impl/joyent_parser.cpp +++ b/src/beast/beast/http/impl/joyent_parser.cpp @@ -140,7 +140,7 @@ convert_http_errno (joyent::http_errno err) { return default_error_condition (code) == condition; } - + bool equivalent (error_code const& code, int condition ) const noexcept override @@ -151,7 +151,7 @@ convert_http_errno (joyent::http_errno err) }; static http_error_category_t http_error_category; - + return boost::system::error_code ( err, http_error_category); } diff --git a/src/beast/beast/http/impl/joyent_parser.h b/src/beast/beast/http/impl/joyent_parser.h index c04bb093d..9987b3b46 100644 --- a/src/beast/beast/http/impl/joyent_parser.h +++ b/src/beast/beast/http/impl/joyent_parser.h @@ -25,7 +25,7 @@ // TODO Use #include -// Wraps the C-language joyent http parser header in a namespace +// Wraps the C-language joyent http parser header in a namespace namespace beast { namespace joyent { diff --git a/src/beast/beast/http/message.h b/src/beast/beast/http/message.h index 155b8ee36..4d859d14a 100644 --- a/src/beast/beast/http/message.h +++ b/src/beast/beast/http/message.h @@ -58,7 +58,7 @@ private: // request beast::http::method_t method_; std::string url_; - + // response int status_; std::string reason_; @@ -248,7 +248,7 @@ message::operator= (message&& other) keep_alive_ = other.keep_alive_; upgrade_ = other.upgrade_; headers = std::move(other.headers); - return *this; + return *this; } #endif diff --git a/src/beast/beast/http/parser.h b/src/beast/beast/http/parser.h index 8d0e8ad81..2619d050a 100644 --- a/src/beast/beast/http/parser.h +++ b/src/beast/beast/http/parser.h @@ -49,7 +49,7 @@ public: message& m, bool request) : beast::http::basic_parser (request) , message_(m) - , write_body_(std::move(write_body)) + , write_body_(std::move(write_body)) { message_.get().request(request); } @@ -208,4 +208,4 @@ parser::do_complete() } // http } // beast -#endif \ No newline at end of file +#endif diff --git a/src/beast/beast/http/tests/URL.test.cpp b/src/beast/beast/http/tests/URL.test.cpp index a13c95e9d..af4687a84 100644 --- a/src/beast/beast/http/tests/URL.test.cpp +++ b/src/beast/beast/http/tests/URL.test.cpp @@ -37,7 +37,7 @@ public: void test_url_parsing () { - char const* const urls[] = + char const* const urls[] = { "http://en.wikipedia.org/wiki/URI#Examples_of_URI_references", "ftp://ftp.funet.fi/pub/standards/RFC/rfc959.txt" diff --git a/src/beast/beast/http/tests/chunked_encoder.test.cpp b/src/beast/beast/http/tests/chunked_encoder.test.cpp index 81ea77d8d..900b3ab58 100644 --- a/src/beast/beast/http/tests/chunked_encoder.test.cpp +++ b/src/beast/beast/http/tests/chunked_encoder.test.cpp @@ -55,7 +55,7 @@ public: log << encode (std::string( boost::asio::buffer_cast(buf), boost::asio::buffer_size(buf))); - } + } // Convert a ConstBufferSequence to a string template diff --git a/src/beast/beast/http/tests/urls_large_data.cpp b/src/beast/beast/http/tests/urls_large_data.cpp index fb8440c27..60eb0251c 100644 --- a/src/beast/beast/http/tests/urls_large_data.cpp +++ b/src/beast/beast/http/tests/urls_large_data.cpp @@ -18,7 +18,7 @@ //============================================================================== #include - + namespace beast { namespace http { diff --git a/src/beast/beast/insight/Collector.h b/src/beast/beast/insight/Collector.h index e177c3f6e..954b7fb22 100644 --- a/src/beast/beast/insight/Collector.h +++ b/src/beast/beast/insight/Collector.h @@ -49,7 +49,7 @@ public: virtual ~Collector() = 0; /** Create a hook. - + A hook is called at each collection interval, on an implementation defined thread. This is a convenience facility for gathering metrics in the polling style. The typical usage is to update all the metrics @@ -75,7 +75,7 @@ public: */ /** @{ */ virtual Counter make_counter (std::string const& name) = 0; - + Counter make_counter (std::string const& prefix, std::string const& name) { if (prefix.empty ()) @@ -98,7 +98,7 @@ public: } /** @} */ - /** Create a gauge with the specified name. + /** Create a gauge with the specified name. @see Gauge */ /** @{ */ diff --git a/src/beast/beast/insight/Counter.h b/src/beast/beast/insight/Counter.h index 6ec79ec3e..268c639c3 100644 --- a/src/beast/beast/insight/Counter.h +++ b/src/beast/beast/insight/Counter.h @@ -29,7 +29,7 @@ namespace beast { namespace insight { /** A metric for measuring an integral value. - + A counter is a gauge calculated at the server. The owner of the counter may increment and decrement the value by an amount. diff --git a/src/beast/beast/insight/CounterImpl.h b/src/beast/beast/insight/CounterImpl.h index 06f57e805..c970a0721 100644 --- a/src/beast/beast/insight/CounterImpl.h +++ b/src/beast/beast/insight/CounterImpl.h @@ -33,7 +33,7 @@ class CounterImpl { public: using value_type = std::int64_t; - + virtual ~CounterImpl () = 0; virtual void increment (value_type amount) = 0; }; diff --git a/src/beast/beast/insight/Event.h b/src/beast/beast/insight/Event.h index ae504900f..0e41ded8a 100644 --- a/src/beast/beast/insight/Event.h +++ b/src/beast/beast/insight/Event.h @@ -32,7 +32,7 @@ namespace beast { namespace insight { /** A metric for reporting event timing. - + An event is an operation that has an associated millisecond time, or other integral value. Because events happen at a specific moment, the metric only supports a push-style interface. diff --git a/src/beast/beast/insight/Gauge.h b/src/beast/beast/insight/Gauge.h index 6e6c580db..60133ec5b 100644 --- a/src/beast/beast/insight/Gauge.h +++ b/src/beast/beast/insight/Gauge.h @@ -29,7 +29,7 @@ namespace beast { namespace insight { /** A metric for measuring an integral value. - + A gauge is an instantaneous measurement of a value, like the gas gauge in a car. The caller directly sets the value, or adjusts it by a specified amount. The value is kept in the client rather than the collector. diff --git a/src/beast/beast/insight/Hook.h b/src/beast/beast/insight/Hook.h index 1940189f3..31fbfe840 100644 --- a/src/beast/beast/insight/Hook.h +++ b/src/beast/beast/insight/Hook.h @@ -27,7 +27,7 @@ namespace beast { namespace insight { - + /** A reference to a handler for performing polled collection. */ class Hook : public Base { diff --git a/src/beast/beast/insight/Meter.h b/src/beast/beast/insight/Meter.h index 709b28d5b..a7325aa0b 100644 --- a/src/beast/beast/insight/Meter.h +++ b/src/beast/beast/insight/Meter.h @@ -29,7 +29,7 @@ namespace beast { namespace insight { /** A metric for measuring an integral value. - + A meter may be thought of as an increment-only counter. This is a lightweight reference wrapper which is cheap to copy and assign. diff --git a/src/beast/beast/insight/NullCollector.h b/src/beast/beast/insight/NullCollector.h index 617b71bf1..0656c94dd 100644 --- a/src/beast/beast/insight/NullCollector.h +++ b/src/beast/beast/insight/NullCollector.h @@ -24,7 +24,7 @@ namespace beast { namespace insight { - + /** A Collector which does not collect metrics. */ class NullCollector : public Collector { diff --git a/src/beast/beast/insight/impl/NullCollector.cpp b/src/beast/beast/insight/impl/NullCollector.cpp index cf7229de1..b9e407454 100644 --- a/src/beast/beast/insight/impl/NullCollector.cpp +++ b/src/beast/beast/insight/impl/NullCollector.cpp @@ -117,7 +117,7 @@ public: { return Gauge (std::make_shared ()); } - + Meter make_meter (std::string const&) { return Meter (std::make_shared ()); diff --git a/src/beast/beast/insight/impl/StatsDCollector.cpp b/src/beast/beast/insight/impl/StatsDCollector.cpp index 55f0f5b0c..c180f3e66 100644 --- a/src/beast/beast/insight/impl/StatsDCollector.cpp +++ b/src/beast/beast/insight/impl/StatsDCollector.cpp @@ -616,7 +616,7 @@ void StatsDGaugeImpl::flush () void StatsDGaugeImpl::do_set (GaugeImpl::value_type value) { m_value = value; - + if (m_value != m_last_value) { m_last_value = m_value; @@ -641,7 +641,7 @@ void StatsDGaugeImpl::do_increment (GaugeImpl::difference_type amount) { GaugeImpl::value_type const d ( static_cast (-amount)); - value = (d >= value) ? 0 : value - d; + value = (d >= value) ? 0 : value - d; } do_set (value); diff --git a/src/beast/beast/intrusive/List.h b/src/beast/beast/intrusive/List.h index d1abe618d..f0bfbe876 100644 --- a/src/beast/beast/intrusive/List.h +++ b/src/beast/beast/intrusive/List.h @@ -160,91 +160,91 @@ private: } /** Intrusive doubly linked list. - + This intrusive List is a container similar in operation to std::list in the Standard Template Library (STL). Like all @ref intrusive containers, List requires you to first derive your class from List<>::Node: - + @code - + struct Object : List ::Node { explicit Object (int value) : m_value (value) { } - + int m_value; }; - + @endcode - + Now we define the list, and add a couple of items. - + @code - + List list; - + list.push_back (* (new Object (1))); list.push_back (* (new Object (2))); - + @endcode - + For compatibility with the standard containers, push_back() expects a reference to the object. Unlike the standard container, however, push_back() places the actual object in the list and not a copy-constructed duplicate. - + Iterating over the list follows the same idiom as the STL: - + @code - + for (List ::iterator iter = list.begin(); iter != list.end; ++iter) std::cout << iter->m_value; - + @endcode - + You can even use BOOST_FOREACH, or range based for loops: - + @code - + BOOST_FOREACH (Object& object, list) // boost only std::cout << object.m_value; - + for (Object& object : list) // C++11 only std::cout << object.m_value; - + @endcode - + Because List is mostly STL compliant, it can be passed into STL algorithms: e.g. `std::for_each()` or `std::find_first_of()`. - + In general, objects placed into a List should be dynamically allocated although this cannot be enforced at compile time. Since the caller provides the storage for the object, the caller is also responsible for deleting the object. An object still exists after being removed from a List, until the caller deletes it. This means an element can be moved from one List to another with practically no overhead. - + Unlike the standard containers, an object may only exist in one list at a time, unless special preparations are made. The Tag template parameter is used to distinguish between different list types for the same object, allowing the object to exist in more than one list simultaneously. - + For example, consider an actor system where a global list of actors is maintained, so that they can each be periodically receive processing time. We wish to also maintain a list of the subset of actors that require a domain-dependent update. To achieve this, we declare two tags, the associated list types, and the list element thusly: - + @code - + struct Actor; // Forward declaration required - + struct ProcessTag { }; struct UpdateTag { }; - + using ProcessList = List ; using UpdateList = List ; - + // Derive from both node types so we can be in each list at once. // struct Actor : ProcessList::Node, UpdateList::Node @@ -252,15 +252,15 @@ private: bool process (); // returns true if we need an update void update (); }; - + @endcode - + @tparam T The base type of element which the list will store pointers to. - + @tparam Tag An optional unique type name used to distinguish lists and nodes, when the object can exist in multiple lists simultaneously. - + @ingroup beast_core intrusive */ template diff --git a/src/beast/beast/intrusive/LockFreeStack.h b/src/beast/beast/intrusive/LockFreeStack.h index 1fb1b4feb..eae0d1190 100644 --- a/src/beast/beast/intrusive/LockFreeStack.h +++ b/src/beast/beast/intrusive/LockFreeStack.h @@ -146,7 +146,7 @@ public: class Node { public: - Node () + Node () : m_next (nullptr) { } @@ -159,7 +159,7 @@ public: private: friend class LockFreeStack; - + template friend class LockFreeStackIterator; @@ -262,7 +262,7 @@ public: { return iterator (&m_end); } - + const_iterator begin () const { return const_iterator (m_head.load ()); @@ -272,7 +272,7 @@ public: { return const_iterator (&m_end); } - + const_iterator cbegin () const { return const_iterator (m_head.load ()); diff --git a/src/beast/beast/module/asio/HTTPMessage.h b/src/beast/beast/module/asio/HTTPMessage.h index a3606309e..07f1eeb92 100644 --- a/src/beast/beast/module/asio/HTTPMessage.h +++ b/src/beast/beast/module/asio/HTTPMessage.h @@ -62,7 +62,7 @@ public: /** Outputs all the HTTPMessage data excluding the body into a string. */ String toString () const; - + private: HTTPVersion m_version; HTTPHeaders m_headers; diff --git a/src/beast/beast/module/core/containers/Array.h b/src/beast/beast/module/core/containers/Array.h index c9d8295b2..dbaf274ab 100644 --- a/src/beast/beast/module/core/containers/Array.h +++ b/src/beast/beast/module/core/containers/Array.h @@ -727,7 +727,7 @@ public: if (isPositiveAndBelow (indexToRemove, numUsed)) { - bassert (data.elements != nullptr); + bassert (data.elements != nullptr); ElementType removed (data.elements[indexToRemove]); removeInternal (indexToRemove); return removed; diff --git a/src/beast/beast/module/core/diagnostic/SemanticVersion.cpp b/src/beast/beast/module/core/diagnostic/SemanticVersion.cpp index 9a31b4f33..904cfc0a8 100644 --- a/src/beast/beast/module/core/diagnostic/SemanticVersion.cpp +++ b/src/beast/beast/module/core/diagnostic/SemanticVersion.cpp @@ -70,7 +70,7 @@ bool chopUInt (int& value, int limit, std::string& input) auto left_iter = std::find_if_not (input.begin (), input.end (), [](std::string::value_type c) { - return std::isdigit (c, std::locale::classic()); + return std::isdigit (c, std::locale::classic()); }); std::string item (input.begin (), left_iter); @@ -163,7 +163,7 @@ bool SemanticVersion::parse (std::string const& input, bool debug) auto left_iter = std::find_if_not (input.begin (), input.end (), [](std::string::value_type c) { - return std::isspace (c, std::locale::classic()); + return std::isspace (c, std::locale::classic()); }); auto right_iter = std::find_if_not (input.rbegin (), input.rend (), diff --git a/src/beast/beast/module/core/diagnostic/SemanticVersion.h b/src/beast/beast/module/core/diagnostic/SemanticVersion.h index a2a3311a6..b55a4ef6b 100644 --- a/src/beast/beast/module/core/diagnostic/SemanticVersion.h +++ b/src/beast/beast/module/core/diagnostic/SemanticVersion.h @@ -60,7 +60,7 @@ public: std::string print () const; inline bool isRelease () const noexcept - { + { return preReleaseIdentifiers.empty(); } inline bool isPreRelease () const noexcept @@ -75,8 +75,8 @@ public: int compare (SemanticVersion const& lhs, SemanticVersion const& rhs); inline bool -operator== (SemanticVersion const& lhs, SemanticVersion const& rhs) -{ +operator== (SemanticVersion const& lhs, SemanticVersion const& rhs) +{ return compare (lhs, rhs) == 0; } diff --git a/src/beast/beast/module/core/files/FileOutputStream.h b/src/beast/beast/module/core/files/FileOutputStream.h index ccb1ec3ad..8e7211be1 100644 --- a/src/beast/beast/module/core/files/FileOutputStream.h +++ b/src/beast/beast/module/core/files/FileOutputStream.h @@ -109,4 +109,4 @@ private: } // beast -#endif \ No newline at end of file +#endif diff --git a/src/beast/beast/module/core/maths/Random.h b/src/beast/beast/module/core/maths/Random.h index 631c164ab..45b311b20 100644 --- a/src/beast/beast/module/core/maths/Random.h +++ b/src/beast/beast/module/core/maths/Random.h @@ -26,7 +26,7 @@ #include #include - + namespace beast { //============================================================================== diff --git a/src/beast/beast/module/core/streams/InputStream.h b/src/beast/beast/module/core/streams/InputStream.h index 2a31e03ed..d7d1fd051 100644 --- a/src/beast/beast/module/core/streams/InputStream.h +++ b/src/beast/beast/module/core/streams/InputStream.h @@ -91,7 +91,7 @@ public: /** Reads a boolean from the stream. - The bool is encoded as a single byte - non-zero for true, 0 for false. + The bool is encoded as a single byte - non-zero for true, 0 for false. If the stream is exhausted, this will return false. @@ -116,7 +116,7 @@ public: /** Reads two bytes from the stream as a little-endian 16-bit value. - If the next two bytes read are byte1 and byte2, this returns (byte1 | (byte2 << 8)). + If the next two bytes read are byte1 and byte2, this returns (byte1 | (byte2 << 8)). If the stream is exhausted partway through reading the bytes, this will return zero. diff --git a/src/beast/beast/module/core/streams/MemoryOutputStream.h b/src/beast/beast/module/core/streams/MemoryOutputStream.h index 82217a9fa..dea2b940d 100644 --- a/src/beast/beast/module/core/streams/MemoryOutputStream.h +++ b/src/beast/beast/module/core/streams/MemoryOutputStream.h @@ -43,7 +43,7 @@ namespace beast */ class MemoryOutputStream : public OutputStream -{ +{ public: //============================================================================== /** Creates an empty memory stream, ready to be written into. diff --git a/src/beast/beast/module/core/text/LexicalCast.h b/src/beast/beast/module/core/text/LexicalCast.h index 353c13373..ba2907b56 100644 --- a/src/beast/beast/module/core/text/LexicalCast.h +++ b/src/beast/beast/module/core/text/LexicalCast.h @@ -73,7 +73,7 @@ parse_negative_integral (Int& num, FwdIt first, FwdIt last) if (limit_digit < 0) limit_digit = -limit_digit; - return parse_integral (num, first, last, + return parse_integral (num, first, last, [limit_value, limit_digit](Int& value, Int digit) { assert ((digit >= 0) && (digit <= 9)); diff --git a/src/beast/beast/module/core/thread/DeadlineTimer.h b/src/beast/beast/module/core/thread/DeadlineTimer.h index ba7ff0d71..2567b72d4 100644 --- a/src/beast/beast/module/core/thread/DeadlineTimer.h +++ b/src/beast/beast/module/core/thread/DeadlineTimer.h @@ -49,7 +49,7 @@ public: DeadlineTimer (DeadlineTimer const&) = delete; DeadlineTimer& operator= (DeadlineTimer const&) = delete; - + ~DeadlineTimer (); /** Cancel all notifications. diff --git a/src/beast/beast/module/core/thread/Workers.cpp b/src/beast/beast/module/core/thread/Workers.cpp index da4cf9f98..a21256d25 100644 --- a/src/beast/beast/module/core/thread/Workers.cpp +++ b/src/beast/beast/module/core/thread/Workers.cpp @@ -129,7 +129,7 @@ void Workers::deleteWorkers (LockFreeStack & stack) if (worker != nullptr) { - // This call blocks until the thread orderly exits + // This call blocks until the thread orderly exits delete worker; } else diff --git a/src/beast/beast/module/core/thread/detail/ScopedLock.h b/src/beast/beast/module/core/thread/detail/ScopedLock.h index ad690e8d1..43c84acca 100644 --- a/src/beast/beast/module/core/thread/detail/ScopedLock.h +++ b/src/beast/beast/module/core/thread/detail/ScopedLock.h @@ -47,7 +47,7 @@ public: { if (m_lock_count > 0) unlock (); - } + } inline void lock (char const* fileName, int lineNumber) noexcept { @@ -233,7 +233,7 @@ public: m_mutex.unlock (); --m_lock_count; } - + private: Mutex const& m_mutex; int m_lock_count; diff --git a/src/beast/beast/module/core/threads/ScopedLock.h b/src/beast/beast/module/core/threads/ScopedLock.h index a481a4b83..ca52e582a 100644 --- a/src/beast/beast/module/core/threads/ScopedLock.h +++ b/src/beast/beast/module/core/threads/ScopedLock.h @@ -145,7 +145,7 @@ public: */ inline explicit GenericScopedUnlock (LockType& lock) noexcept : lock_ (lock) - { + { lock.unlock(); } diff --git a/src/beast/beast/net/DynamicBuffer.h b/src/beast/beast/net/DynamicBuffer.h index 0e4a733d8..78d01078d 100644 --- a/src/beast/beast/net/DynamicBuffer.h +++ b/src/beast/beast/net/DynamicBuffer.h @@ -40,7 +40,7 @@ public: /** Create the dynamic buffer with the specified block size. */ explicit DynamicBuffer (size_type blocksize = defaultBlocksize); - + DynamicBuffer (DynamicBuffer const& other); ~DynamicBuffer (); diff --git a/src/beast/beast/net/IPAddress.h b/src/beast/beast/net/IPAddress.h index f5bb8bbe9..1f42ab41a 100644 --- a/src/beast/beast/net/IPAddress.h +++ b/src/beast/beast/net/IPAddress.h @@ -146,7 +146,7 @@ public: return is_v4 () ? m_v4 == IP::AddressV4::any () : false; // m_v6 == IP::AddressV6::any(); } - + template friend void @@ -198,21 +198,21 @@ public: { return ! (lhs == rhs); } - + friend bool operator> (Address const& lhs, Address const& rhs) { return rhs < lhs; } - + friend bool operator<= (Address const& lhs, Address const& rhs) { return ! (lhs > rhs); } - + friend bool operator>= (Address const& lhs, Address const& rhs) diff --git a/src/beast/beast/net/IPAddressV4.h b/src/beast/beast/net/IPAddressV4.h index f47a9776f..24c9e41c5 100644 --- a/src/beast/beast/net/IPAddressV4.h +++ b/src/beast/beast/net/IPAddressV4.h @@ -38,7 +38,7 @@ struct AddressV4 AddressV4 (); /** Construct from a 32-bit unsigned. - @note Octets are formed in order from the MSB to the LSB. + @note Octets are formed in order from the MSB to the LSB. */ explicit AddressV4 (std::uint32_t value_); diff --git a/src/beast/beast/net/impl/DynamicBuffer.cpp b/src/beast/beast/net/impl/DynamicBuffer.cpp index dc9d26cd3..f7b30acfe 100644 --- a/src/beast/beast/net/impl/DynamicBuffer.cpp +++ b/src/beast/beast/net/impl/DynamicBuffer.cpp @@ -74,7 +74,7 @@ void DynamicBuffer::shrink_to_fit () { free (m_buffers.back ()); m_buffers.erase (m_buffers.end () - 1); - } + } } std::string DynamicBuffer::to_string () const diff --git a/src/beast/beast/net/impl/IPAddressV4.cpp b/src/beast/beast/net/impl/IPAddressV4.cpp index 69f08cce8..ce1f33a69 100644 --- a/src/beast/beast/net/impl/IPAddressV4.cpp +++ b/src/beast/beast/net/impl/IPAddressV4.cpp @@ -26,7 +26,7 @@ #include #include - + namespace beast { namespace IP { diff --git a/src/beast/beast/nudb/api.h b/src/beast/beast/nudb/api.h index 4891b364f..a473c62ff 100644 --- a/src/beast/beast/nudb/api.h +++ b/src/beast/beast/nudb/api.h @@ -66,7 +66,7 @@ struct api dat_path, key_path, log_path, appnum, salt, key_size, block_size, load_factor, args...); - } + } template static @@ -91,7 +91,7 @@ struct api return nudb::verify( dat_path, key_path, BufferSize); } - + template static bool diff --git a/src/beast/beast/nudb/detail/varint.h b/src/beast/beast/nudb/detail/varint.h index 98b116da9..ff138ea51 100644 --- a/src/beast/beast/nudb/detail/varint.h +++ b/src/beast/beast/nudb/detail/varint.h @@ -40,7 +40,7 @@ struct varint; // possible size of T represented as varint. // T must be unsigned template ::value> + bool = std::is_unsigned::value> struct varint_traits; template diff --git a/src/beast/beast/nudb/store.h b/src/beast/beast/nudb/store.h index a6355e782..4d903b838 100644 --- a/src/beast/beast/nudb/store.h +++ b/src/beast/beast/nudb/store.h @@ -62,7 +62,7 @@ namespace nudb { /* TODO - + - fingerprint / checksum on log records - size field at end of data records @@ -550,7 +550,7 @@ store::fetch ( if (item.hash != h) break; // Data Record - auto const len = + auto const len = s_->kh.key_size + // Key item.size; // Value buf0.reserve(len); diff --git a/src/beast/beast/random/xor_shift_engine.h b/src/beast/beast/random/xor_shift_engine.h index 3e02a8640..bf773f0df 100644 --- a/src/beast/beast/random/xor_shift_engine.h +++ b/src/beast/beast/random/xor_shift_engine.h @@ -47,7 +47,7 @@ public: result_type operator()(); - static + static result_type BEAST_CONSTEXPR min() { diff --git a/src/beast/beast/smart_ptr/SharedPtr.h b/src/beast/beast/smart_ptr/SharedPtr.h index db092d4ab..1f5f31a89 100644 --- a/src/beast/beast/smart_ptr/SharedPtr.h +++ b/src/beast/beast/smart_ptr/SharedPtr.h @@ -52,9 +52,9 @@ namespace beast { abbreviate the full templated name - e.g. @code - + using MyClassPtr = SharedPtr ; - + @endcode @see SharedObject, SharedObjectArray diff --git a/src/beast/beast/streams/debug_ostream.h b/src/beast/beast/streams/debug_ostream.h index 2d95f92b5..fc6322f41 100644 --- a/src/beast/beast/streams/debug_ostream.h +++ b/src/beast/beast/streams/debug_ostream.h @@ -67,7 +67,7 @@ public: OutputDebugStringA ((s + "\n").c_str()); return; } - + std::cout << s << std::endl; } }; diff --git a/src/beast/beast/threads/SharedLockGuard.h b/src/beast/beast/threads/SharedLockGuard.h index ea387ae3e..a20377d1d 100644 --- a/src/beast/beast/threads/SharedLockGuard.h +++ b/src/beast/beast/threads/SharedLockGuard.h @@ -23,7 +23,7 @@ namespace beast { -/** A scoped container that acquires a shared lock. */ +/** A scoped container that acquires a shared lock. */ template class SharedLockGuard { diff --git a/src/beast/beast/threads/SharedMutexAdapter.h b/src/beast/beast/threads/SharedMutexAdapter.h index 06e443da1..4dc439a4e 100644 --- a/src/beast/beast/threads/SharedMutexAdapter.h +++ b/src/beast/beast/threads/SharedMutexAdapter.h @@ -25,7 +25,7 @@ #include namespace beast { - + /** Adapts a regular Lockable to conform to the SharedMutex concept. Shared locks become unique locks with this interface. Two threads may not simultaneously acquire ownership of the lock. Typically the Mutex template @@ -38,7 +38,7 @@ public: using MutexType = Mutex; using LockGuardType = std::lock_guard ; using SharedLockGuardType = SharedLockGuard ; - + void lock() const { m_mutex.lock(); diff --git a/src/beast/beast/threads/Stoppable.h b/src/beast/beast/threads/Stoppable.h index 873ee2fb1..e08810770 100644 --- a/src/beast/beast/threads/Stoppable.h +++ b/src/beast/beast/threads/Stoppable.h @@ -64,7 +64,7 @@ class RootStoppable; This override is called for all Stoppable objects in the hierarchy during the prepare stage. It is guaranteed that all child Stoppable objects have already been prepared when this is called. - + Objects are called children first. 4. start() @@ -127,7 +127,7 @@ class RootStoppable; funtion areChildrenStopped() can be used after children have stopped, but before the Stoppable logic itself has stopped, to determine if the stoppable's logic is a true stop. - + Pseudo code for this process is as follows: @code @@ -236,7 +236,7 @@ private: onStop and onChildrenStopped will never be called concurrently, across all Stoppable objects descended from the same root, inclusive of the root. - + It is safe to call isStopping, isStopped, and areChildrenStopped from within this function; The values returned will always be valid and never change during the callback. diff --git a/src/beast/beast/threads/Thread.h b/src/beast/beast/threads/Thread.h index f6ce9b3e8..ddf1850f7 100644 --- a/src/beast/beast/threads/Thread.h +++ b/src/beast/beast/threads/Thread.h @@ -56,7 +56,7 @@ public: Thread (Thread const&) = delete; Thread& operator= (Thread const&) = delete; - + /** Destructor. If the thread has not been stopped first, this will generate a fatal error. diff --git a/src/beast/beast/unit_test/match.h b/src/beast/beast/unit_test/match.h index 74e77b973..cc9b2b014 100644 --- a/src/beast/beast/unit_test/match.h +++ b/src/beast/beast/unit_test/match.h @@ -136,7 +136,7 @@ selector::operator() (suite_info const& s) The predicate checks the suite, module, and library fields of the suite_info in that order. When it finds a match, it changes modes depending on what was found: - + If a suite is matched first, then only the suite is selected. The suite may be marked manual. diff --git a/src/beast/beast/unit_test/thread.h b/src/beast/beast/unit_test/thread.h index 2f025c0f0..b2ac684a7 100644 --- a/src/beast/beast/unit_test/thread.h +++ b/src/beast/beast/unit_test/thread.h @@ -62,7 +62,7 @@ public: thread (suite& s, F&& f, Args&&... args) : s_ (&s) { - std::function b = + std::function b = std::bind(std::forward(f), std::forward(args)...); t_ = std::thread (&thread::run, this, diff --git a/src/beast/beast/utility/Debug.h b/src/beast/beast/utility/Debug.h index f43b3ae2e..7a9e1896b 100644 --- a/src/beast/beast/utility/Debug.h +++ b/src/beast/beast/utility/Debug.h @@ -21,7 +21,7 @@ #define BEAST_UTILITY_DEBUG_H_INCLUDED #include - + namespace beast { // Auxiliary outines for debugging diff --git a/src/beast/beast/utility/Journal.h b/src/beast/beast/utility/Journal.h index 0e6a7aeb3..3b4171f36 100644 --- a/src/beast/beast/utility/Journal.h +++ b/src/beast/beast/utility/Journal.h @@ -175,7 +175,7 @@ public: /** Returns `true` if sink logs anything at this stream's severity. */ /** @{ */ bool active() const; - + explicit operator bool() const { diff --git a/src/beast/beast/utility/PropertyStream.h b/src/beast/beast/utility/PropertyStream.h index d81317310..cdedf01eb 100644 --- a/src/beast/beast/utility/PropertyStream.h +++ b/src/beast/beast/utility/PropertyStream.h @@ -214,7 +214,7 @@ public: add (ss.str(), value); } - Proxy operator[] (std::string const& key); + Proxy operator[] (std::string const& key); Proxy operator[] (char const* key) { return Proxy (*this, key); } @@ -364,7 +364,7 @@ public: static bool peel_leading_slash (std::string* path); static bool peel_trailing_slashstar (std::string* path); - static std::string peel_name(std::string* path); + static std::string peel_name(std::string* path); //-------------------------------------------------------------------------- diff --git a/src/beast/beast/utility/impl/Debug.cpp b/src/beast/beast/utility/impl/Debug.cpp index e533df760..30b17840c 100644 --- a/src/beast/beast/utility/impl/Debug.cpp +++ b/src/beast/beast/utility/impl/Debug.cpp @@ -196,7 +196,7 @@ public: log << "_DEBUG = " << String::fromNumber (envDebug ()); - + log << "BEAST_DEBUG = " << String::fromNumber (beastDebug ()); diff --git a/src/beast/beast/utility/impl/PropertyStream.cpp b/src/beast/beast/utility/impl/PropertyStream.cpp index 9f521fc1c..de271a06a 100644 --- a/src/beast/beast/utility/impl/PropertyStream.cpp +++ b/src/beast/beast/utility/impl/PropertyStream.cpp @@ -310,12 +310,12 @@ std::string PropertyStream::Source::peel_name (std::string* path) { if (path->empty()) return ""; - + std::string::const_iterator first = (*path).begin(); std::string::const_iterator last = (*path).end(); std::string::const_iterator pos (std::find (first, last, '/')); std::string s (first, pos); - + if (pos != last) *path = std::string (pos+1, last); else @@ -352,7 +352,7 @@ PropertyStream::Source* PropertyStream::Source::find_path (std::string path) break; source = source->find_one(name); } - while (source != nullptr); + while (source != nullptr); return source; } @@ -636,7 +636,7 @@ public: } } - void test_peel_trailing_slashstar (std::string s, + void test_peel_trailing_slashstar (std::string s, std::string const& expected_remainder, bool should_be_found) { try @@ -648,7 +648,7 @@ public: catch (...) { fail ("unhandled exception");; - } + } } void test_find_one (Source& root, Source* expected, std::string const& name) @@ -692,7 +692,7 @@ public: } } - void test_find (Source& root, std::string path, Source* expected, + void test_find (Source& root, std::string path, Source* expected, bool expected_star) { try @@ -759,8 +759,8 @@ public: test_find_one (d, &f, "f"); testcase ("find_path"); - test_find_path (a, "a", nullptr); - test_find_path (a, "e", nullptr); + test_find_path (a, "a", nullptr); + test_find_path (a, "e", nullptr); test_find_path (a, "a/b", nullptr); test_find_path (a, "a/b/e", nullptr); test_find_path (a, "b/e/g", nullptr); @@ -768,7 +768,7 @@ public: test_find_path (a, "b", &b); test_find_path (a, "b/e", &e); test_find_path (a, "b/d/f", &f); - + testcase ("find_one_deep"); test_find_one_deep (a, "z", nullptr); test_find_one_deep (a, "g", &g); diff --git a/src/beast/beast/utility/meta.h b/src/beast/beast/utility/meta.h index e7af4e1f4..4098fadc6 100644 --- a/src/beast/beast/utility/meta.h +++ b/src/beast/beast/utility/meta.h @@ -71,16 +71,16 @@ struct enable_if_lvalue }; /** Ensure const reference function parameters are valid lvalues. - + Some functions, especially class constructors, accept const references and - store them for later use. If any of those parameters are rvalue objects, - the object will be freed as soon as the function returns. This could + store them for later use. If any of those parameters are rvalue objects, + the object will be freed as soon as the function returns. This could potentially lead to a variety of "use after free" errors. - - If the function is rewritten as a template using this type and the + + If the function is rewritten as a template using this type and the parameters references as rvalue references (eg. TX&&), a compiler error will be generated if an rvalue is provided in the caller. - + @code // Example: struct X diff --git a/src/beast/beast/utility/static_initializer.h b/src/beast/beast/utility/static_initializer.h index 237af40b4..99917f19a 100644 --- a/src/beast/beast/utility/static_initializer.h +++ b/src/beast/beast/utility/static_initializer.h @@ -145,7 +145,7 @@ static_initializer ::static_initializer (Args&&... args) { try { - ::new(t) T (std::forward(args)...); + ::new(t) T (std::forward(args)...); static destroyer on_exit (t); _InterlockedIncrement(&_.state); } @@ -198,7 +198,7 @@ public: static_initializer (Args&&... args); static_initializer (); - + T& get() noexcept { diff --git a/src/beast/beast/utility/tests/Journal.test.cpp b/src/beast/beast/utility/tests/Journal.test.cpp index b08f48b10..3196f7fcf 100644 --- a/src/beast/beast/utility/tests/Journal.test.cpp +++ b/src/beast/beast/utility/tests/Journal.test.cpp @@ -62,7 +62,7 @@ public: sink.severity(Journal::kInfo); Journal j(sink); - + j.trace << " "; expect(sink.count() == 0); j.debug << " "; diff --git a/src/beast/beast/utility/tests/tagged_integer.test.cpp b/src/beast/beast/utility/tests/tagged_integer.test.cpp index 2e011c025..32f4d58df 100644 --- a/src/beast/beast/utility/tests/tagged_integer.test.cpp +++ b/src/beast/beast/utility/tests/tagged_integer.test.cpp @@ -28,7 +28,7 @@ namespace beast { -class tagged_integer_test +class tagged_integer_test : public unit_test::suite { private: @@ -112,7 +112,7 @@ public: expect (zero >= zero, "Should be greater than or equal"); expect (zero == zero, "Should be equal"); - + expect (one > zero, "Should be greater"); expect (one >= zero, "Should be greater than or equal"); expect (one != zero, "Should not be equal"); @@ -140,7 +140,7 @@ public: expect(++tmp == one, "Should be equal"); tmp = zero; - + tmp += 1u; expect(tmp == one, "Should be equal"); diff --git a/src/beast/beast/utility/tests/weak_fn.test.cpp b/src/beast/beast/utility/tests/weak_fn.test.cpp index 6d551ab78..27ff3fa4c 100644 --- a/src/beast/beast/utility/tests/weak_fn.test.cpp +++ b/src/beast/beast/utility/tests/weak_fn.test.cpp @@ -86,7 +86,7 @@ public: std::bind(weak_fn(&T::fi, p), 1)(); expect(called); } - + { bool called = false; auto p = std::make_shared(called); diff --git a/src/beast/beast/weak_fn.h b/src/beast/beast/weak_fn.h index b15982c1b..f3e78cc4f 100644 --- a/src/beast/beast/weak_fn.h +++ b/src/beast/beast/weak_fn.h @@ -111,7 +111,7 @@ public: if(auto p = object_.lock()) return ((*p).*member_)(args...); return this->member()(); - } + } }; } // detail @@ -120,11 +120,11 @@ public: When called, it tries to lock weak_ptr to get a shared_ptr. If successful, it calls given member function with given arguments. If not successful, the policy functor is called. Built-in policies are: - + ignore_if_invalid does nothing throw_if_invalid throws `bad_weak_ptr` return_default_if_invalid returns a chosen value - + Example: struct Foo { @@ -138,12 +138,12 @@ public: std::cout << "outdated reference" << std::endl; } }; - + int main() { std::shared_ptr sp(new Foo()); std::weak_ptr wp(sp); - + std::bind(weak_fn(&Foo::bar, wp), _1)(1); sp.reset(); std::bind(weak_fn(&Foo::bar, wp), 1)(); diff --git a/src/ripple/app/ledger/AcceptedLedgerTx.h b/src/ripple/app/ledger/AcceptedLedgerTx.h index 85cc8a5ab..cf24210d4 100644 --- a/src/ripple/app/ledger/AcceptedLedgerTx.h +++ b/src/ripple/app/ledger/AcceptedLedgerTx.h @@ -65,7 +65,7 @@ public: { return mMeta; } - + boost::container::flat_set const& getAffected() const { diff --git a/src/ripple/app/ledger/OpenLedger.h b/src/ripple/app/ledger/OpenLedger.h index 37f92d398..13eedeebb 100644 --- a/src/ripple/app/ledger/OpenLedger.h +++ b/src/ripple/app/ledger/OpenLedger.h @@ -186,7 +186,7 @@ private: ApplyFlags flags, IHashRouter& router, Config const& config, beast::Journal j); -public: +public: //-------------------------------------------------------------------------- // // TEST CODE diff --git a/src/ripple/app/ledger/impl/OpenLedger.cpp b/src/ripple/app/ledger/impl/OpenLedger.cpp index 6429b947f..f2a2cfb80 100644 --- a/src/ripple/app/ledger/impl/OpenLedger.cpp +++ b/src/ripple/app/ledger/impl/OpenLedger.cpp @@ -182,7 +182,7 @@ OpenLedger::verify (Ledger const& ledger, return true; JLOG(j_.error) << "verify ledger " << ledger.seq() << ": " << - list1.size() << " / " << list2.size() << + list1.size() << " / " << list2.size() << " " << " MISMATCH " << suffix; return false; #else diff --git a/src/ripple/app/ledger/tests/common_ledger.h b/src/ripple/app/ledger/tests/common_ledger.h index 2b6869936..9506b98cc 100644 --- a/src/ripple/app/ledger/tests/common_ledger.h +++ b/src/ripple/app/ledger/tests/common_ledger.h @@ -134,7 +134,7 @@ TestAccount createAccount(std::string const& passphrase, KeyType keyType); TestAccount -createAndFundAccount(TestAccount& from, std::string const& passphrase, +createAndFundAccount(TestAccount& from, std::string const& passphrase, KeyType keyType, std::uint64_t amountDrops, Ledger::pointer const& ledger, bool sign = true); @@ -239,8 +239,8 @@ trust(TestAccount& from, TestAccount const& issuer, void close_and_advance(Ledger::pointer& ledger, std::shared_ptr& LCL); -Json::Value findPath(Ledger::pointer ledger, TestAccount const& src, - TestAccount const& dest, std::vector srcCurrencies, +Json::Value findPath(Ledger::pointer ledger, TestAccount const& src, + TestAccount const& dest, std::vector srcCurrencies, Amount const& dstAmount, beast::abstract_ostream& log, boost::optional contextPaths = boost::none); diff --git a/src/ripple/app/misc/UniqueNodeList.cpp b/src/ripple/app/misc/UniqueNodeList.cpp index 8c236f86a..de8fcb6bb 100644 --- a/src/ripple/app/misc/UniqueNodeList.cpp +++ b/src/ripple/app/misc/UniqueNodeList.cpp @@ -900,7 +900,7 @@ Json::Value UniqueNodeListImp::getUnlJson() auto db = getApp().getWalletDB ().checkoutDb (); - + std::vector, 2>> columns; selectBlobsIntoStrings(*db, "SELECT PublicKey, Comment FROM TrustedNodes;", @@ -986,7 +986,7 @@ bool UniqueNodeListImp::miscLoad() if (!db->got_data() ) return false; - + mtpFetchUpdated = ptFromSeconds (fuO.value_or(-1)); mtpScoreUpdated = ptFromSeconds (suO.value_or(-1)); @@ -1147,7 +1147,7 @@ void UniqueNodeListImp::scoreCompute() std::string const strSource = strArray[2].value_or(""); assert (!strSource.empty ()); - + int const iScore = iSourceScore (static_cast (strSource[0])); auto siOld = umPulicIdx.find (strPublicKey); @@ -1269,7 +1269,7 @@ void UniqueNodeListImp::scoreCompute() for(auto const& strArray : columns) { strReferral = strArray[0].value_or(""); - + int iReferral; RippleAddress na; @@ -1372,7 +1372,7 @@ void UniqueNodeListImp::scoreCompute() for(auto const& col : columns) { pk = get<0>(col).value_or (""); - + vsnNodes[umPulicIdx[pk]].iSeen = get<1>(col).value_or (-1); } } diff --git a/src/ripple/app/paths/PathState.h b/src/ripple/app/paths/PathState.h index 76cc7106a..839bb91b4 100644 --- a/src/ripple/app/paths/PathState.h +++ b/src/ripple/app/paths/PathState.h @@ -136,7 +136,7 @@ private: AccountID const& account, Currency const& currency, AccountID const& issuer); - + Json::Value getJson () const; private: @@ -157,7 +157,7 @@ private: bool allLiquidityConsumed_ = false; TER terStatus; - + path::Node::List nodes_; // When processing, don't want to complicate directory walking with diff --git a/src/ripple/app/paths/RippleCalc.h b/src/ripple/app/paths/RippleCalc.h index 9c49f4f5d..4fe2d98c8 100644 --- a/src/ripple/app/paths/RippleCalc.h +++ b/src/ripple/app/paths/RippleCalc.h @@ -72,7 +72,7 @@ public: }; - static + static Output rippleCalculate( PaymentSandbox& view, diff --git a/src/ripple/app/tx/apply.h b/src/ripple/app/tx/apply.h index 86f6c7a9b..5b059c08e 100644 --- a/src/ripple/app/tx/apply.h +++ b/src/ripple/app/tx/apply.h @@ -60,7 +60,6 @@ doapply(OpenView& view, STTx const& tx, /** Apply a transaction to a ReadView. Throws: - Does not throw. For open ledgers, the Transactor will catch and diff --git a/src/ripple/app/tx/impl/InboundTransactions.cpp b/src/ripple/app/tx/impl/InboundTransactions.cpp index c1938f2c4..c47a49324 100644 --- a/src/ripple/app/tx/impl/InboundTransactions.cpp +++ b/src/ripple/app/tx/impl/InboundTransactions.cpp @@ -182,7 +182,7 @@ public: bool fromAcquire) override { bool isNew = true; - + { ScopedLockType sl (mLock); diff --git a/src/ripple/basics/chrono.h b/src/ripple/basics/chrono.h index b9531cf43..763359794 100644 --- a/src/ripple/basics/chrono.h +++ b/src/ripple/basics/chrono.h @@ -40,7 +40,7 @@ using weeks = std::chrono::duration days::period, std::ratio<7>>>; /** Clock for measuring Ripple Network Time. - + The epoch is January 1, 2000 */ // VFALCO TODO Finish the implementation and make diff --git a/src/ripple/core/impl/Config.cpp b/src/ripple/core/impl/Config.cpp index 0bcf39f31..09e5598e3 100644 --- a/src/ripple/core/impl/Config.cpp +++ b/src/ripple/core/impl/Config.cpp @@ -416,7 +416,7 @@ void Config::loadFromString (std::string const& fileContents) if (getSingleSection (secConfig, "database_path", dbPath)) { boost::filesystem::path p(dbPath); - legacy("database_path", + legacy("database_path", boost::filesystem::absolute (p).string ()); } } diff --git a/src/ripple/core/impl/SNTPClock.cpp b/src/ripple/core/impl/SNTPClock.cpp index 990ada97e..0ea86a63c 100644 --- a/src/ripple/core/impl/SNTPClock.cpp +++ b/src/ripple/core/impl/SNTPClock.cpp @@ -183,7 +183,7 @@ public: return when; return when + std::chrono::seconds(offset_); } - + duration offset() const override { @@ -198,7 +198,7 @@ public: setCallingThreadName("SNTPClock"); io_service_.run(); } - + void onTimer (error_code const& ec) { diff --git a/src/ripple/core/impl/SNTPClock.h b/src/ripple/core/impl/SNTPClock.h index f76621143..117bb7875 100644 --- a/src/ripple/core/impl/SNTPClock.h +++ b/src/ripple/core/impl/SNTPClock.h @@ -35,7 +35,7 @@ class SNTPClock std::chrono::system_clock> { public: - virtual + virtual void run (std::vector const& servers) = 0; diff --git a/src/ripple/core/tests/SociDB.test.cpp b/src/ripple/core/tests/SociDB.test.cpp index 1841cac58..e082dc661 100644 --- a/src/ripple/core/tests/SociDB.test.cpp +++ b/src/ripple/core/tests/SociDB.test.cpp @@ -232,7 +232,7 @@ public: // There are too many issues when working with soci::row and boost::tuple. DO NOT USE // soci row! I had a set of workarounds to make soci row less error prone, I'm keeping // these tests in case I try to add soci::row and boost::tuple back into soci. -#if 0 +#if 0 try { std::int32_t ig = 0; @@ -285,7 +285,7 @@ public: { fail (); } -#endif +#endif } { using namespace boost::filesystem; diff --git a/src/ripple/crypto/impl/ec_key.h b/src/ripple/crypto/impl/ec_key.h index 217fbfe57..cad4ead7a 100644 --- a/src/ripple/crypto/impl/ec_key.h +++ b/src/ripple/crypto/impl/ec_key.h @@ -44,7 +44,7 @@ public: destroy(); } - bool valid() const + bool valid() const { return ptr != nullptr; } diff --git a/src/ripple/ledger/TxMeta.h b/src/ripple/ledger/TxMeta.h index bc274658f..f41f070b1 100644 --- a/src/ripple/ledger/TxMeta.h +++ b/src/ripple/ledger/TxMeta.h @@ -94,7 +94,7 @@ public: STObject& getAffectedNode (SLE::ref node, SField const& type); // create if needed STObject& getAffectedNode (uint256 const& ); const STObject& peekAffectedNode (uint256 const& ) const; - + /** Return a list of accounts affected by this transaction */ boost::container::flat_set getAffectedAccounts() const; diff --git a/src/ripple/ledger/detail/RawStateTable.h b/src/ripple/ledger/detail/RawStateTable.h index 67dabce77..ac55ce9e4 100644 --- a/src/ripple/ledger/detail/RawStateTable.h +++ b/src/ripple/ledger/detail/RawStateTable.h @@ -84,7 +84,7 @@ private: insert, replace, }; - + using items_t = std::map>>; diff --git a/src/ripple/ledger/tests/View_test.cpp b/src/ripple/ledger/tests/View_test.cpp index da292e280..82559e595 100644 --- a/src/ripple/ledger/tests/View_test.cpp +++ b/src/ripple/ledger/tests/View_test.cpp @@ -361,7 +361,7 @@ class View_test expect(v2.parentCloseTime() == v1.parentCloseTime()); expect(v2.seq() == v1.seq()); - expect(v2.flags() == tapNO_CHECK_SIGN); + expect(v2.flags() == tapNO_CHECK_SIGN); Sandbox v3(&v2); expect(v3.seq() == v2.seq()); @@ -375,7 +375,7 @@ class View_test expect(v2.seq() == v0.seq()); expect(v2.parentCloseTime() == v0.parentCloseTime()); - expect(v2.flags() == tapNO_CHECK_SIGN); + expect(v2.flags() == tapNO_CHECK_SIGN); PaymentSandbox v3(&v2); expect(v3.seq() == v2.seq()); expect(v3.parentCloseTime() == diff --git a/src/ripple/nodestore/Database.h b/src/ripple/nodestore/Database.h index 7ab775906..b1356a392 100644 --- a/src/ripple/nodestore/Database.h +++ b/src/ripple/nodestore/Database.h @@ -54,7 +54,7 @@ public: or paths used by the underlying backend. */ virtual std::string getName () const = 0; - + /** Close the database. This allows the caller to catch exceptions. */ diff --git a/src/ripple/nodestore/NodeObject.h b/src/ripple/nodestore/NodeObject.h index 8809669d3..d7a511872 100644 --- a/src/ripple/nodestore/NodeObject.h +++ b/src/ripple/nodestore/NodeObject.h @@ -39,8 +39,8 @@ enum NodeObjectType /** A simple object that the Ledger uses to store entries. NodeObjects are comprised of a type, a hash, a ledger index and a blob. - They can be uniquely identified by the hash, which is a half-SHA512 of - the blob. The blob is a variable length block of serialized data. The + They can be uniquely identified by the hash, which is a half-SHA512 of + the blob. The blob is a variable length block of serialized data. The type identifies what the blob contains. @note No checking is performed to make sure the hash matches the data. diff --git a/src/ripple/nodestore/impl/BatchWriter.cpp b/src/ripple/nodestore/impl/BatchWriter.cpp index 1dd40a33f..cb56e0dbe 100644 --- a/src/ripple/nodestore/impl/BatchWriter.cpp +++ b/src/ripple/nodestore/impl/BatchWriter.cpp @@ -19,7 +19,7 @@ #include #include - + namespace ripple { namespace NodeStore { diff --git a/src/ripple/nodestore/impl/EncodedBlob.cpp b/src/ripple/nodestore/impl/EncodedBlob.cpp index 3a5722bf8..5b811751e 100644 --- a/src/ripple/nodestore/impl/EncodedBlob.cpp +++ b/src/ripple/nodestore/impl/EncodedBlob.cpp @@ -20,7 +20,7 @@ #include #include #include - + namespace ripple { namespace NodeStore { diff --git a/src/ripple/nodestore/tests/Timing.test.cpp b/src/ripple/nodestore/tests/Timing.test.cpp index c8cc0c29f..fee563def 100644 --- a/src/ripple/nodestore/tests/Timing.test.cpp +++ b/src/ripple/nodestore/tests/Timing.test.cpp @@ -112,7 +112,7 @@ public: { gen_.seed(n+1); uint256 key; - auto const data = + auto const data = static_cast(&*key.begin()); *data = prefix_; rngcpy (data + 1, key.size() - 1, gen_); @@ -508,7 +508,7 @@ public: } } }; - + try { parallel_for_id(params.items, params.threads, diff --git a/src/ripple/nodestore/tests/import_test.cpp b/src/ripple/nodestore/tests/import_test.cpp index 35efa7cfc..3cd254152 100644 --- a/src/ripple/nodestore/tests/import_test.cpp +++ b/src/ripple/nodestore/tests/import_test.cpp @@ -331,7 +331,7 @@ public: "Missing parameter: buffer"; usage = true; } - + if (usage) { log << @@ -603,7 +603,7 @@ public: "Missing parameter: buffer"; usage = true; } - + if (usage) { log << @@ -919,7 +919,7 @@ public: "Missing parameter: path"; usage = true; } - + if (usage) { log << diff --git a/src/ripple/overlay/PeerSet.h b/src/ripple/overlay/PeerSet.h index 80ee0245b..51dc6032a 100644 --- a/src/ripple/overlay/PeerSet.h +++ b/src/ripple/overlay/PeerSet.h @@ -97,7 +97,7 @@ public: @return `true` If the peer was added */ bool insert (Peer::ptr const&); - + virtual bool isDone () const { return mComplete || mFailed; diff --git a/src/ripple/overlay/impl/ConnectAttempt.cpp b/src/ripple/overlay/impl/ConnectAttempt.cpp index 7ca3da47f..6afc6be65 100644 --- a/src/ripple/overlay/impl/ConnectAttempt.cpp +++ b/src/ripple/overlay/impl/ConnectAttempt.cpp @@ -22,7 +22,7 @@ #include #include #include - + namespace ripple { ConnectAttempt::ConnectAttempt (boost::asio::io_service& io_service, diff --git a/src/ripple/overlay/tests/manifest_test.cpp b/src/ripple/overlay/tests/manifest_test.cpp index 00409360b..72d61ff2e 100644 --- a/src/ripple/overlay/tests/manifest_test.cpp +++ b/src/ripple/overlay/tests/manifest_test.cpp @@ -126,7 +126,7 @@ public: testcase ("load/store"); std::string const dbName("ManifestCacheTestDB"); - { + { // create a database, save the manifest to the db and reload and // check that the manifest caches are the same DatabaseCon::Setup setup; diff --git a/src/ripple/protocol/Keylet.h b/src/ripple/protocol/Keylet.h index 50697a1f9..13e899441 100644 --- a/src/ripple/protocol/Keylet.h +++ b/src/ripple/protocol/Keylet.h @@ -28,7 +28,7 @@ namespace ripple { class STLedgerEntry; /** A pair of SHAMap key and LedgerEntryType. - + A Keylet identifies both a key in the state map and its ledger entry type. diff --git a/src/ripple/protocol/PublicKey.h b/src/ripple/protocol/PublicKey.h index dda06c54e..342e9dc97 100644 --- a/src/ripple/protocol/PublicKey.h +++ b/src/ripple/protocol/PublicKey.h @@ -187,7 +187,7 @@ enum class ECDSACanonicality Therefore, to prevent malleability attacks we define a fully canonical signature as one where: - + R < G - S where G is the curve order. diff --git a/src/ripple/protocol/STInteger.h b/src/ripple/protocol/STInteger.h index 5ea610e93..63f5f8a6a 100644 --- a/src/ripple/protocol/STInteger.h +++ b/src/ripple/protocol/STInteger.h @@ -32,7 +32,7 @@ public: using value_type = Integer; explicit - STInteger (Integer v) + STInteger (Integer v) : value_ (v) { } diff --git a/src/ripple/protocol/STLedgerEntry.h b/src/ripple/protocol/STLedgerEntry.h index 3eaccafb7..e79af5476 100644 --- a/src/ripple/protocol/STLedgerEntry.h +++ b/src/ripple/protocol/STLedgerEntry.h @@ -46,12 +46,12 @@ public: } STLedgerEntry (const Serializer & s, uint256 const& index); - + STLedgerEntry (SerialIter & sit, uint256 const& index); STLedgerEntry(SerialIter&& sit, uint256 const& index) : STLedgerEntry(sit, index) {} - - + + STLedgerEntry (const STObject & object, uint256 const& index); STBase* @@ -72,9 +72,9 @@ public: } std::string getFullText () const override; - + std::string getText () const override; - + Json::Value getJson (int options) const override; /** Returns the 'key' (or 'index') of this item. @@ -112,15 +112,15 @@ public: { return getFieldU16 (sfLedgerEntryType); } - + bool isThreadedType() const; // is this a ledger entry that can be threaded - + bool isThreaded () const; // is this ledger entry actually threaded - + uint256 getThreadedTransaction () const; - + std::uint32_t getThreadedLedger () const; - + bool thread (uint256 const& txID, std::uint32_t ledgerSeq, uint256 & prevTxID, std::uint32_t & prevLedgerID); diff --git a/src/ripple/protocol/STPathSet.h b/src/ripple/protocol/STPathSet.h index a800af5aa..c1d3c1c9e 100644 --- a/src/ripple/protocol/STPathSet.h +++ b/src/ripple/protocol/STPathSet.h @@ -268,7 +268,7 @@ public: bool isEquivalent (const STBase& t) const override; - + bool isDefault () const override { diff --git a/src/ripple/protocol/STVector256.h b/src/ripple/protocol/STVector256.h index 64508d0a9..1339d1290 100644 --- a/src/ripple/protocol/STVector256.h +++ b/src/ripple/protocol/STVector256.h @@ -66,7 +66,7 @@ public: { return STI_VECTOR256; } - + void add (Serializer& s) const override; @@ -75,7 +75,7 @@ public: bool isEquivalent (const STBase& t) const override; - + bool isDefault () const override { diff --git a/src/ripple/protocol/Serializer.h b/src/ripple/protocol/Serializer.h index 05aea17e6..4ae3682e2 100644 --- a/src/ripple/protocol/Serializer.h +++ b/src/ripple/protocol/Serializer.h @@ -343,7 +343,7 @@ public: { return getBitString<160>(); } - + uint256 get256() { diff --git a/src/ripple/protocol/digest.h b/src/ripple/protocol/digest.h index 845c3dbfa..e15be3a89 100644 --- a/src/ripple/protocol/digest.h +++ b/src/ripple/protocol/digest.h @@ -141,7 +141,7 @@ using sha512_hasher = beast::sha512_hasher; representing a Ripple account, from a message. Typically the message is the public key of the account - which is not stored in the account root. - + The same computation is used regardless of the cryptographic scheme implied by the public key. For example, the public key may be an ed25519 public key or a secp256k1 public key. Support @@ -217,7 +217,7 @@ public: explicit operator result_type() noexcept { - auto const digest = + auto const digest = sha512_hasher::result_type(h_); result_type result; std::copy(digest.begin(), diff --git a/src/ripple/protocol/impl/STArray.cpp b/src/ripple/protocol/impl/STArray.cpp index e3fd03e3d..614c7b9ae 100644 --- a/src/ripple/protocol/impl/STArray.cpp +++ b/src/ripple/protocol/impl/STArray.cpp @@ -97,7 +97,7 @@ STArray::STArray (SerialIter& sit, SField const& f) v_.emplace_back(fn); v_.back().set (sit, 1); - + if (v_.back().setTypeFromSField (fn) == STObject::typeSetFail) { throw std::runtime_error ("Malformed object in array"); diff --git a/src/ripple/protocol/impl/tokens.cpp b/src/ripple/protocol/impl/tokens.cpp index e7d412bc8..0f2b7d020 100644 --- a/src/ripple/protocol/impl/tokens.cpp +++ b/src/ripple/protocol/impl/tokens.cpp @@ -157,7 +157,7 @@ encodeBase58( Wallet Seed Account Public Key Account ID - + @param temp A pointer to storage of not less than 2*(size+6) bytes */ diff --git a/src/ripple/protocol/tests/PublicKey_test.cpp b/src/ripple/protocol/tests/PublicKey_test.cpp index 99bf56ff8..15a6c9f17 100644 --- a/src/ripple/protocol/tests/PublicKey_test.cpp +++ b/src/ripple/protocol/tests/PublicKey_test.cpp @@ -63,7 +63,7 @@ public: out.push_back ((hi*16)+lo); } } - + blob sig (std::string const& hex) { diff --git a/src/ripple/protocol/tokens.h b/src/ripple/protocol/tokens.h index f8585d90d..add1a87f2 100644 --- a/src/ripple/protocol/tokens.h +++ b/src/ripple/protocol/tokens.h @@ -68,7 +68,7 @@ parseHexOrBase58 (std::string const& s); Wallet Seed Account Public Key Account ID - + @param temp A pointer to storage of not less than 2*(size+6) bytes */ diff --git a/src/ripple/resource/impl/Entry.h b/src/ripple/resource/impl/Entry.h index ee814facd..2c77dfed1 100644 --- a/src/ripple/resource/impl/Entry.h +++ b/src/ripple/resource/impl/Entry.h @@ -33,7 +33,7 @@ using clock_type = beast::abstract_clock ; // An entry in the table // VFALCO DEPRECATED using boost::intrusive list -struct Entry +struct Entry : public beast::List ::Node { Entry () = delete; diff --git a/src/ripple/rpc/RipplePathFind.h b/src/ripple/rpc/RipplePathFind.h index 377fea001..2bbabbea5 100644 --- a/src/ripple/rpc/RipplePathFind.h +++ b/src/ripple/rpc/RipplePathFind.h @@ -35,4 +35,4 @@ ripplePathFind (RippleLineCache::pointer const& cache, } -#endif \ No newline at end of file +#endif diff --git a/src/ripple/shamap/SHAMap.h b/src/ripple/shamap/SHAMap.h index 97574b0a8..44cc07c8a 100644 --- a/src/ripple/shamap/SHAMap.h +++ b/src/ripple/shamap/SHAMap.h @@ -184,12 +184,12 @@ public: // comparison/sync functions void getMissingNodes (std::vector& nodeIDs, std::vector& hashes, int max, SHAMapSyncFilter * filter); - + bool getNodeFat (SHAMapNodeID node, std::vector& nodeIDs, std::vector& rawNode, bool fatLeaves, std::uint32_t depth) const; - + bool getRootNode (Serializer & s, SHANodeFormat format) const; std::vector getNeededHashes (int max, SHAMapSyncFilter * filter); SHAMapAddNode addRootNode (uint256 const& hash, Blob const& rootNode, SHANodeFormat format, diff --git a/src/ripple/shamap/SHAMapMissingNode.h b/src/ripple/shamap/SHAMapMissingNode.h index 8562467f6..8a87486ea 100644 --- a/src/ripple/shamap/SHAMapMissingNode.h +++ b/src/ripple/shamap/SHAMapMissingNode.h @@ -23,7 +23,7 @@ #include #include #include - + namespace ripple { enum class SHAMapType diff --git a/src/ripple/shamap/tests/SHAMap.test.cpp b/src/ripple/shamap/tests/SHAMap.test.cpp index 0583d63c6..56f739cc8 100644 --- a/src/ripple/shamap/tests/SHAMap.test.cpp +++ b/src/ripple/shamap/tests/SHAMap.test.cpp @@ -52,7 +52,7 @@ public: testcase ("add/traverse"); beast::Journal const j; // debug journal - + tests::TestFamily f(j); // h3 and h4 differ only in the leaf, same terminal node (level 19) diff --git a/src/ripple/test/jtx/Env.h b/src/ripple/test/jtx/Env.h index 8a8661cc6..e950eb31f 100644 --- a/src/ripple/test/jtx/Env.h +++ b/src/ripple/test/jtx/Env.h @@ -1,548 +1,548 @@ -//------------------------------------------------------------------------------ -/* - This file is part of rippled: https://github.com/ripple/rippled - Copyright (c) 2012, 2013 Ripple Labs Inc. - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ -//============================================================================== - -#ifndef RIPPLE_TEST_JTX_ENV_H_INCLUDED -#define RIPPLE_TEST_JTX_ENV_H_INCLUDED - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include // -#include // -#include -#include -#include -#include - -namespace ripple { -namespace test { -namespace jtx { - -namespace detail { - -#ifdef _MSC_VER - -// Workaround for C2797: -// list initialization inside member initializer -// list or non-static data member initializer is -// not implemented -// -template -struct noripple_helper -{ - std::array args; - - template - std::array - flatten (Args&& ...args) - { - return std::array { - std::forward(args)...}; - } - - template - explicit - noripple_helper(Args const&... args_) - : args(flatten(args_...)) - { - } -}; - -#else - -template -struct noripple_helper -{ - std::array args; - - template - explicit - noripple_helper(Args const&... args_) - : args { { args_... } } - { - } -}; - -#endif - -} // detail - -/** Designate accounts as no-ripple in Env::fund */ -template -detail::noripple_helper<1 + sizeof...(Args)> -noripple (Account const& account, - Args const&... args) -{ - return detail::noripple_helper< - 1 + sizeof...(Args)>( - account, args...); -} - -//------------------------------------------------------------------------------ - -/** A transaction testing environment. */ -class Env -{ -public: - using clock_type = TestNetClock; - - clock_type clock; - - beast::unit_test::suite& test; - - beast::Journal const journal; - - /** Configuration used. */ - // VFALCO NOTE Some code still calls getConfig() - Config const config; - - /** The master account. */ - Account const master; - -private: - std::shared_ptr closed_; - CachedSLEs cachedSLEs_; - LogSquelcher logSquelcher_; - -public: - // Careful with this - OpenLedger openLedger; - - Env() = delete; - Env (Env const&) = delete; - Env& operator= (Env const&) = delete; - - Env (beast::unit_test::suite& test_); - - /** Returns the open ledger. - - This is a non-modifiable snapshot of the - open ledger at the moment of the call. - Transactions applied after the call to open() - will not be visible. - - */ - std::shared_ptr - open() const; - - /** Returns the last closed ledger. - - The open ledger is built on top of the - last closed ledger. When the open ledger - is closed, it becomes the new closed ledger - and a new open ledger takes its place. - */ - std::shared_ptr - closed() const; - - /** Close and advance the ledger. - - Effects: - - Creates a new closed ledger from the last - closed ledger. - - All transactions that made it into the open - ledger are applied to the closed ledger. - - The Env clock is set to the new time. - */ - void - close (NetClock::time_point const& closeTime); - - /** Close and advance the ledger. - - The time is calculated as the duration from - the previous ledger closing time. - */ - template - void - close (std::chrono::duration< - Rep, Period> const& elapsed) - { - stopwatch_.advance(elapsed); - close (clock.now() + elapsed); - } - - /** Close and advance the ledger. - - The time is calculated as five seconds from - the previous ledger closing time. - */ - void - close() - { - close (std::chrono::seconds(5)); - } - - /** Turn on JSON tracing. - With no arguments, trace all - */ - void - trace (int howMany = -1) - { - trace_ = howMany; - } - - /** Turn off JSON tracing. */ - void - notrace () - { - trace_ = 0; - } - - /** Turn off testing. */ - void - disable_testing () - { - testing_ = false; - } - - /** Associate AccountID with account. */ - void - memoize (Account const& account); - - /** Returns the Account given the AccountID. */ - /** @{ */ - Account const& - lookup (AccountID const& id) const; - - Account const& - lookup (std::string const& base58ID) const; - /** @} */ - - /** Returns the XRP balance on an account. - Returns 0 if the account does not exist. - */ - PrettyAmount - balance (Account const& account) const; - - /** Returns the next sequence number on account. - Exceptions: - Throws if the account does not exist - */ - std::uint32_t - seq (Account const& account) const; - - /** Return the balance on an account. - Returns 0 if the trust line does not exist. - */ - // VFALCO NOTE This should return a unit-less amount - PrettyAmount - balance (Account const& account, - Issue const& issue) const; - - /** Return an account root. - @return empty if the account does not exist. - */ - std::shared_ptr - le (Account const& account) const; - - /** Return a ledger entry. - @return empty if the ledger entry does not exist - */ - std::shared_ptr - le (Keylet const& k) const; - - /** Create a JTx from parameters. */ - template - JTx - jt (JsonValue&& jv, FN const&... fN) - { - JTx jt(std::forward(jv)); - invoke(jt, fN...); - autofill(jt); - return jt; - } - - /** Create JSON from parameters. - This will apply funclets and autofill. - */ - template - Json::Value - json (JsonValue&&jv, FN const&... fN) - { - auto tj = jt( - std::forward(jv), - fN...); - return std::move(tj.jv); - } - - /** Check a set of requirements. - - The requirements are formed - from condition functors. - */ - template - void - require (Args const&... args) const - { - jtx::required(args...)(*this); - } - - /** Submit an existing JTx. - This calls postconditions. - */ - virtual - void - submit (JTx const& jt); - - /** Apply funclets and submit. */ - /** @{ */ - template - void - apply (JsonValue&& jv, FN const&... fN) - { - submit(jt(std::forward< - JsonValue>(jv), fN...)); - } - - template - void - operator()(JsonValue&& jv, - FN const&... fN) - { - apply(std::forward< - JsonValue>(jv), fN...); - } - /** @} */ - -private: - void - fund (bool setDefaultRipple, - STAmount const& amount, - Account const& account); - - // If you get an error here it means - // you're calling fund with no accounts - inline - void - fund (STAmount const&) - { - } - - void - fund_arg (STAmount const& amount, - Account const& account) - { - fund (true, amount, account); - } - - template - void - fund_arg (STAmount const& amount, - detail::noripple_helper const& list) - { - for (auto const& account : list.args) - fund (false, amount, account); - } -public: - - /** Create a new account with some XRP. - - These convenience functions are for easy set-up - of the environment, they bypass fee, seq, and sig - settings. The XRP is transferred from the master - account. - - Preconditions: - The account must not already exist - - Effects: - The asfDefaultRipple on the account is set, - and the sequence number is incremented, unless - the account is wrapped with a call to noripple. - - The account's XRP balance is set to amount. - - Generates a test that the balance is set. - - @param amount The amount of XRP to transfer to - each account. - - @param args A heterogeneous list of accounts to fund - or calls to noripple with lists of accounts - to fund. - */ - template - void - fund (STAmount const& amount, - Arg const& arg, Args const&... args) - { - fund_arg (amount, arg); - fund (amount, args...); - } - - /** Establish trust lines. - - These convenience functions are for easy set-up - of the environment, they bypass fee, seq, and sig - settings. - - Preconditions: - The account must already exist - - Effects: - A trust line is added for the account. - The account's sequence number is incremented. - The account is refunded for the transaction fee - to set the trust line. - - The refund comes from the master account. - */ - /** @{ */ - void - trust (STAmount const& amount, - Account const& account); - - template - void - trust (STAmount const& amount, Account const& to0, - Account const& to1, Accounts const&... toN) - { - trust(amount, to0); - trust(amount, to1, toN...); - } - /** @} */ - -protected: - int trace_ = 0; - bool testing_ = true; - TestStopwatch stopwatch_; - - void - autofill_sig (JTx& jt); - - virtual - void - autofill (JTx& jt); - - /** Create a STTx from a JTx - The framework requires that JSON is valid. - On a parse error, the JSON is logged and - an exception thrown. - Throws: - parse_error - */ - // VFALCO NOTE This should be - std::shared_ptr - st (JTx const& jt); - - ApplyFlags - applyFlags() const; - - inline - void - invoke (STTx& stx) - { - } - - template - inline - void - maybe_invoke (STTx& stx, F const& f, - std::false_type) - { - } - - template - void - maybe_invoke (STTx& stx, F const& f, - std::true_type) - { - f(*this, stx); - } - - // Invoke funclets on stx - // Note: The STTx may not be modified - template - void - invoke (STTx& stx, F const& f, - FN const&... fN) - { - maybe_invoke(stx, f, - beast::is_call_possible()); - invoke(stx, fN...); - } - - inline - void - invoke (JTx&) - { - } - - template - inline - void - maybe_invoke (JTx& jt, F const& f, - std::false_type) - { - } - - template - void - maybe_invoke (JTx& jt, F const& f, - std::true_type) - { - f(*this, jt); - } - - // Invoke funclets on jt - template - void - invoke (JTx& jt, F const& f, - FN const&... fN) - { - maybe_invoke(jt, f, - beast::is_call_possible()); - invoke(jt, fN...); - } - - // Map of account IDs to Account - std::unordered_map< - AccountID, Account> map_; -}; - -} // jtx -} // test -} // ripple - -#endif +//------------------------------------------------------------------------------ +/* + This file is part of rippled: https://github.com/ripple/rippled + Copyright (c) 2012, 2013 Ripple Labs Inc. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +//============================================================================== + +#ifndef RIPPLE_TEST_JTX_ENV_H_INCLUDED +#define RIPPLE_TEST_JTX_ENV_H_INCLUDED + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // +#include // +#include +#include +#include +#include + +namespace ripple { +namespace test { +namespace jtx { + +namespace detail { + +#ifdef _MSC_VER + +// Workaround for C2797: +// list initialization inside member initializer +// list or non-static data member initializer is +// not implemented +// +template +struct noripple_helper +{ + std::array args; + + template + std::array + flatten (Args&& ...args) + { + return std::array { + std::forward(args)...}; + } + + template + explicit + noripple_helper(Args const&... args_) + : args(flatten(args_...)) + { + } +}; + +#else + +template +struct noripple_helper +{ + std::array args; + + template + explicit + noripple_helper(Args const&... args_) + : args { { args_... } } + { + } +}; + +#endif + +} // detail + +/** Designate accounts as no-ripple in Env::fund */ +template +detail::noripple_helper<1 + sizeof...(Args)> +noripple (Account const& account, + Args const&... args) +{ + return detail::noripple_helper< + 1 + sizeof...(Args)>( + account, args...); +} + +//------------------------------------------------------------------------------ + +/** A transaction testing environment. */ +class Env +{ +public: + using clock_type = TestNetClock; + + clock_type clock; + + beast::unit_test::suite& test; + + beast::Journal const journal; + + /** Configuration used. */ + // VFALCO NOTE Some code still calls getConfig() + Config const config; + + /** The master account. */ + Account const master; + +private: + std::shared_ptr closed_; + CachedSLEs cachedSLEs_; + LogSquelcher logSquelcher_; + +public: + // Careful with this + OpenLedger openLedger; + + Env() = delete; + Env (Env const&) = delete; + Env& operator= (Env const&) = delete; + + Env (beast::unit_test::suite& test_); + + /** Returns the open ledger. + + This is a non-modifiable snapshot of the + open ledger at the moment of the call. + Transactions applied after the call to open() + will not be visible. + + */ + std::shared_ptr + open() const; + + /** Returns the last closed ledger. + + The open ledger is built on top of the + last closed ledger. When the open ledger + is closed, it becomes the new closed ledger + and a new open ledger takes its place. + */ + std::shared_ptr + closed() const; + + /** Close and advance the ledger. + + Effects: + + Creates a new closed ledger from the last + closed ledger. + + All transactions that made it into the open + ledger are applied to the closed ledger. + + The Env clock is set to the new time. + */ + void + close (NetClock::time_point const& closeTime); + + /** Close and advance the ledger. + + The time is calculated as the duration from + the previous ledger closing time. + */ + template + void + close (std::chrono::duration< + Rep, Period> const& elapsed) + { + stopwatch_.advance(elapsed); + close (clock.now() + elapsed); + } + + /** Close and advance the ledger. + + The time is calculated as five seconds from + the previous ledger closing time. + */ + void + close() + { + close (std::chrono::seconds(5)); + } + + /** Turn on JSON tracing. + With no arguments, trace all + */ + void + trace (int howMany = -1) + { + trace_ = howMany; + } + + /** Turn off JSON tracing. */ + void + notrace () + { + trace_ = 0; + } + + /** Turn off testing. */ + void + disable_testing () + { + testing_ = false; + } + + /** Associate AccountID with account. */ + void + memoize (Account const& account); + + /** Returns the Account given the AccountID. */ + /** @{ */ + Account const& + lookup (AccountID const& id) const; + + Account const& + lookup (std::string const& base58ID) const; + /** @} */ + + /** Returns the XRP balance on an account. + Returns 0 if the account does not exist. + */ + PrettyAmount + balance (Account const& account) const; + + /** Returns the next sequence number on account. + Exceptions: + Throws if the account does not exist + */ + std::uint32_t + seq (Account const& account) const; + + /** Return the balance on an account. + Returns 0 if the trust line does not exist. + */ + // VFALCO NOTE This should return a unit-less amount + PrettyAmount + balance (Account const& account, + Issue const& issue) const; + + /** Return an account root. + @return empty if the account does not exist. + */ + std::shared_ptr + le (Account const& account) const; + + /** Return a ledger entry. + @return empty if the ledger entry does not exist + */ + std::shared_ptr + le (Keylet const& k) const; + + /** Create a JTx from parameters. */ + template + JTx + jt (JsonValue&& jv, FN const&... fN) + { + JTx jt(std::forward(jv)); + invoke(jt, fN...); + autofill(jt); + return jt; + } + + /** Create JSON from parameters. + This will apply funclets and autofill. + */ + template + Json::Value + json (JsonValue&&jv, FN const&... fN) + { + auto tj = jt( + std::forward(jv), + fN...); + return std::move(tj.jv); + } + + /** Check a set of requirements. + + The requirements are formed + from condition functors. + */ + template + void + require (Args const&... args) const + { + jtx::required(args...)(*this); + } + + /** Submit an existing JTx. + This calls postconditions. + */ + virtual + void + submit (JTx const& jt); + + /** Apply funclets and submit. */ + /** @{ */ + template + void + apply (JsonValue&& jv, FN const&... fN) + { + submit(jt(std::forward< + JsonValue>(jv), fN...)); + } + + template + void + operator()(JsonValue&& jv, + FN const&... fN) + { + apply(std::forward< + JsonValue>(jv), fN...); + } + /** @} */ + +private: + void + fund (bool setDefaultRipple, + STAmount const& amount, + Account const& account); + + // If you get an error here it means + // you're calling fund with no accounts + inline + void + fund (STAmount const&) + { + } + + void + fund_arg (STAmount const& amount, + Account const& account) + { + fund (true, amount, account); + } + + template + void + fund_arg (STAmount const& amount, + detail::noripple_helper const& list) + { + for (auto const& account : list.args) + fund (false, amount, account); + } +public: + + /** Create a new account with some XRP. + + These convenience functions are for easy set-up + of the environment, they bypass fee, seq, and sig + settings. The XRP is transferred from the master + account. + + Preconditions: + The account must not already exist + + Effects: + The asfDefaultRipple on the account is set, + and the sequence number is incremented, unless + the account is wrapped with a call to noripple. + + The account's XRP balance is set to amount. + + Generates a test that the balance is set. + + @param amount The amount of XRP to transfer to + each account. + + @param args A heterogeneous list of accounts to fund + or calls to noripple with lists of accounts + to fund. + */ + template + void + fund (STAmount const& amount, + Arg const& arg, Args const&... args) + { + fund_arg (amount, arg); + fund (amount, args...); + } + + /** Establish trust lines. + + These convenience functions are for easy set-up + of the environment, they bypass fee, seq, and sig + settings. + + Preconditions: + The account must already exist + + Effects: + A trust line is added for the account. + The account's sequence number is incremented. + The account is refunded for the transaction fee + to set the trust line. + + The refund comes from the master account. + */ + /** @{ */ + void + trust (STAmount const& amount, + Account const& account); + + template + void + trust (STAmount const& amount, Account const& to0, + Account const& to1, Accounts const&... toN) + { + trust(amount, to0); + trust(amount, to1, toN...); + } + /** @} */ + +protected: + int trace_ = 0; + bool testing_ = true; + TestStopwatch stopwatch_; + + void + autofill_sig (JTx& jt); + + virtual + void + autofill (JTx& jt); + + /** Create a STTx from a JTx + The framework requires that JSON is valid. + On a parse error, the JSON is logged and + an exception thrown. + Throws: + parse_error + */ + // VFALCO NOTE This should be + std::shared_ptr + st (JTx const& jt); + + ApplyFlags + applyFlags() const; + + inline + void + invoke (STTx& stx) + { + } + + template + inline + void + maybe_invoke (STTx& stx, F const& f, + std::false_type) + { + } + + template + void + maybe_invoke (STTx& stx, F const& f, + std::true_type) + { + f(*this, stx); + } + + // Invoke funclets on stx + // Note: The STTx may not be modified + template + void + invoke (STTx& stx, F const& f, + FN const&... fN) + { + maybe_invoke(stx, f, + beast::is_call_possible()); + invoke(stx, fN...); + } + + inline + void + invoke (JTx&) + { + } + + template + inline + void + maybe_invoke (JTx& jt, F const& f, + std::false_type) + { + } + + template + void + maybe_invoke (JTx& jt, F const& f, + std::true_type) + { + f(*this, jt); + } + + // Invoke funclets on jt + template + void + invoke (JTx& jt, F const& f, + FN const&... fN) + { + maybe_invoke(jt, f, + beast::is_call_possible()); + invoke(jt, fN...); + } + + // Map of account IDs to Account + std::unordered_map< + AccountID, Account> map_; +}; + +} // jtx +} // test +} // ripple + +#endif diff --git a/src/ripple/test/jtx/flags.h b/src/ripple/test/jtx/flags.h index ef3451e33..1a1ea1fb5 100644 --- a/src/ripple/test/jtx/flags.h +++ b/src/ripple/test/jtx/flags.h @@ -102,7 +102,7 @@ class flags : private detail::flags_helper { private: Account account_; - + public: template flags (Account const& account, @@ -121,7 +121,7 @@ class nflags : private detail::flags_helper { private: Account account_; - + public: template nflags (Account const& account, diff --git a/src/ripple/test/jtx/ticket.h b/src/ripple/test/jtx/ticket.h index a2085873c..813e35b56 100644 --- a/src/ripple/test/jtx/ticket.h +++ b/src/ripple/test/jtx/ticket.h @@ -99,7 +99,7 @@ create (Account const& account, /** Cancel a ticket */ //Json::Value //cancel (Account const& account, - + } // ticket /** Match the number of tickets on the account. */ diff --git a/src/ripple/unl/impl/BasicHorizon.h b/src/ripple/unl/impl/BasicHorizon.h index 5e4cead2f..7fce1e09a 100644 --- a/src/ripple/unl/impl/BasicHorizon.h +++ b/src/ripple/unl/impl/BasicHorizon.h @@ -194,7 +194,7 @@ public: #endif if (result.second) good_.insert(key); - // register a hit for slightly late validations + // register a hit for slightly late validations if (ledger_ && ledger == ledger_) if (result.first->second.onHit()) good_.insert(key); diff --git a/src/ripple/unl/impl/Logic.cpp b/src/ripple/unl/impl/Logic.cpp index 46ccfb0d8..344fe0da8 100644 --- a/src/ripple/unl/impl/Logic.cpp +++ b/src/ripple/unl/impl/Logic.cpp @@ -58,7 +58,7 @@ Most important thing that we do: namespace ripple { namespace unl { - + Logic::Logic (Store& store, beast::Journal journal) : /*store_ (store) , */journal_ (journal) diff --git a/src/ripple/unl/impl/Logic.h b/src/ripple/unl/impl/Logic.h index 20788d30c..d1f046785 100644 --- a/src/ripple/unl/impl/Logic.h +++ b/src/ripple/unl/impl/Logic.h @@ -71,8 +71,6 @@ private: std::chrono::steady_clock, hardened_hash<>> ledgers_; std::pair latest_; // last fully validated boost::container::flat_set connections_; - - //boost::container::flat_set< public: explicit diff --git a/src/ripple/websocket/WebSocket02.h b/src/ripple/websocket/WebSocket02.h index e58d97cbf..cb647c71a 100644 --- a/src/ripple/websocket/WebSocket02.h +++ b/src/ripple/websocket/WebSocket02.h @@ -70,7 +70,7 @@ struct WebSocket02 HandlerPtr makeHandler (ServerDescription const&); /** Make a connection endpoint from a handler. */ - static + static EndpointPtr makeEndpoint (HandlerPtr&&); /** Get the ASIO strand that this connection lives on. */ diff --git a/src/ripple/websocket/WebSocket04.h b/src/ripple/websocket/WebSocket04.h index e241d1dba..fbd190074 100644 --- a/src/ripple/websocket/WebSocket04.h +++ b/src/ripple/websocket/WebSocket04.h @@ -29,7 +29,7 @@ namespace websocket { struct WebSocket04 { using EndpointBase = websocketpp::server ; - + using Connection = EndpointBase::connection_type; using ConnectionPtr = std::shared_ptr; using ConnectionWeakPtr = std::weak_ptr; @@ -92,7 +92,7 @@ struct WebSocket04 HandlerPtr makeHandler (ServerDescription const&); /** Make a connection endpoint from a handler. */ - static + static EndpointPtr makeEndpoint (HandlerPtr&&); /** Get the ASIO strand that this connection lives on. */