diff --git a/.clang-format.base b/.clang-format.base index c0a4eb50..862f03ff 100644 --- a/.clang-format.base +++ b/.clang-format.base @@ -45,7 +45,7 @@ IncludeCategories: - Regex: '' Priority: 4 # Headers in other third party libraries - - Regex: '<(gtest|crypto)/([A-Za-z0-9.\/-_])+>' + - Regex: '<(gtest|crypto|miniupnp)/([A-Za-z0-9.\/-_])+>' Priority: 3 # Headers from nano workspace. - Regex: '' diff --git a/CMakeLists.txt b/CMakeLists.txt index 4073e227..9955ca5c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,7 +49,7 @@ if (WIN32) endif() else () - add_compile_options(-Werror=switch) + add_compile_options(-Werror) if ((${USING_TSAN} AND ${USING_ASAN}) OR (${USING_TSAN} AND ${USING_ASAN_INT})) diff --git a/crypto/ed25519-donna/ed25519-donna-portable.h b/crypto/ed25519-donna/ed25519-donna-portable.h index 0a0f7fc3..d01160f8 100644 --- a/crypto/ed25519-donna/ed25519-donna-portable.h +++ b/crypto/ed25519-donna/ed25519-donna-portable.h @@ -20,6 +20,7 @@ #include #define DONNA_INLINE inline __attribute__((always_inline)) #define DONNA_NOINLINE __attribute__((noinline)) + #undef ALIGN #define ALIGN(x) __attribute__((aligned(x))) #define ROTL32(a,b) (((a) << (b)) | ((a) >> (32 - b))) #define ROTR32(a,b) (((a) >> (b)) | ((a) << (32 - b))) diff --git a/nano/boost/asio.hpp b/nano/boost/asio.hpp new file mode 100644 index 00000000..fc9ba6cd --- /dev/null +++ b/nano/boost/asio.hpp @@ -0,0 +1,13 @@ +#pragma once + +#ifdef _WIN32 +#pragma warning(push) +#pragma warning(disable : 4191) +#pragma warning(disable : 4242) +#endif + +#include + +#ifdef _WIN32 +#pragma warning(pop) +#endif diff --git a/nano/boost/beast.hpp b/nano/boost/beast.hpp new file mode 100644 index 00000000..462b1558 --- /dev/null +++ b/nano/boost/beast.hpp @@ -0,0 +1,13 @@ +#pragma once + +#ifdef _WIN32 +#pragma warning(push) +#pragma warning(disable : 4191) +#pragma warning(disable : 4242) +#endif + +#include + +#ifdef _WIN32 +#pragma warning(pop) +#endif diff --git a/nano/boost/process.hpp b/nano/boost/process.hpp new file mode 100644 index 00000000..6bd9b6a1 --- /dev/null +++ b/nano/boost/process.hpp @@ -0,0 +1,22 @@ +#pragma once + +#ifndef BOOST_PROCESS_SUPPORTED +#error BOOST_PROCESS_SUPPORTED must be set, check configuration +#endif + +#if BOOST_PROCESS_SUPPORTED + +#ifdef _WIN32 +#pragma warning(push) +#pragma warning(disable : 4191) +#pragma warning(disable : 4242) +#pragma warning(disable : 4244) +#endif + +#include + +#ifdef _WIN32 +#pragma warning(pop) +#endif + +#endif diff --git a/nano/boost/readme.txt b/nano/boost/readme.txt new file mode 100644 index 00000000..683faf9d --- /dev/null +++ b/nano/boost/readme.txt @@ -0,0 +1 @@ +These are files which wrap other boost files and suppress compiler warnings associated with them. \ No newline at end of file diff --git a/nano/core_test/CMakeLists.txt b/nano/core_test/CMakeLists.txt index 6917aba5..89bd18c0 100644 --- a/nano/core_test/CMakeLists.txt +++ b/nano/core_test/CMakeLists.txt @@ -8,7 +8,6 @@ add_executable (core_test difficulty.cpp entry.cpp gap_cache.cpp - interface.cpp ipc.cpp ledger.cpp logger.cpp diff --git a/nano/core_test/block.cpp b/nano/core_test/block.cpp index 60938eb2..5b23ec4d 100644 --- a/nano/core_test/block.cpp +++ b/nano/core_test/block.cpp @@ -1,5 +1,4 @@ #include -#include #include #include diff --git a/nano/core_test/block_store.cpp b/nano/core_test/block_store.cpp index 2985f16a..251cb0b6 100644 --- a/nano/core_test/block_store.cpp +++ b/nano/core_test/block_store.cpp @@ -1494,7 +1494,7 @@ TEST (block_store, peers) TEST (block_store, endpoint_key_byte_order) { boost::asio::ip::address_v6 address (boost::asio::ip::address_v6::from_string ("::ffff:127.0.0.1")); - auto port = 100; + uint16_t port = 100; nano::endpoint_key endpoint_key (address.to_bytes (), port); std::vector bytes; diff --git a/nano/core_test/entry.cpp b/nano/core_test/entry.cpp index 8528e659..07de691c 100644 --- a/nano/core_test/entry.cpp +++ b/nano/core_test/entry.cpp @@ -8,14 +8,14 @@ TEST (basic, basic) TEST (asan, DISABLED_memory) { // Ignore warning with gcc/clang compilers -#ifndef MSVC +#ifndef _WIN32 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Warray-bounds" #endif uint8_t array[1]; auto value (array[-0x800000]); (void)value; -#ifndef MSVC +#ifndef _WIN32 #pragma GCC diagnostic pop #endif } diff --git a/nano/core_test/interface.cpp b/nano/core_test/interface.cpp deleted file mode 100644 index 07bec784..00000000 --- a/nano/core_test/interface.cpp +++ /dev/null @@ -1,162 +0,0 @@ -#include -#include -#include -#include - -#include - -#include - -TEST (interface, xrb_uint128_to_dec) -{ - nano::uint128_union zero (0); - char text[40] = { 0 }; - xrb_uint128_to_dec (zero.bytes.data (), text); - ASSERT_STREQ ("0", text); -} - -TEST (interface, xrb_uint256_to_string) -{ - nano::uint256_union zero (0); - char text[65] = { 0 }; - xrb_uint256_to_string (zero.bytes.data (), text); - ASSERT_STREQ ("0000000000000000000000000000000000000000000000000000000000000000", text); -} - -TEST (interface, xrb_uint256_to_address) -{ - nano::uint256_union zero (0); - char text[66] = { 0 }; - xrb_uint256_to_address (zero.bytes.data (), text); - - /* - * Handle both "xrb_" and "nano_" results, since it is not - * specified which is returned - */ - auto account_alpha = "1111111111111111111111111111111111111111111111111111hifc8npp"; - auto prefix = text[0] == 'x' ? "xrb" : "nano"; - ASSERT_STREQ (boost::str (boost::format ("%1%_%2%") % prefix % account_alpha).c_str (), text); -} - -TEST (interface, xrb_uint512_to_string) -{ - nano::uint512_union zero (0); - char text[129] = { 0 }; - xrb_uint512_to_string (zero.bytes.data (), text); - ASSERT_STREQ ("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", text); -} - -TEST (interface, xrb_uint128_from_dec) -{ - nano::uint128_union zero (0); - ASSERT_EQ (0, xrb_uint128_from_dec ("340282366920938463463374607431768211455", zero.bytes.data ())); - ASSERT_EQ (1, xrb_uint128_from_dec ("340282366920938463463374607431768211456", zero.bytes.data ())); - ASSERT_EQ (1, xrb_uint128_from_dec ("3402823669209384634633%4607431768211455", zero.bytes.data ())); -} - -TEST (interface, xrb_uint256_from_string) -{ - nano::uint256_union zero (0); - ASSERT_EQ (0, xrb_uint256_from_string ("0000000000000000000000000000000000000000000000000000000000000000", zero.bytes.data ())); - ASSERT_EQ (1, xrb_uint256_from_string ("00000000000000000000000000000000000000000000000000000000000000000", zero.bytes.data ())); - ASSERT_EQ (1, xrb_uint256_from_string ("000000000000000000000000000%000000000000000000000000000000000000", zero.bytes.data ())); -} - -TEST (interface, xrb_uint512_from_string) -{ - nano::uint512_union zero (0); - ASSERT_EQ (0, xrb_uint512_from_string ("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", zero.bytes.data ())); - ASSERT_EQ (1, xrb_uint512_from_string ("000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", zero.bytes.data ())); - ASSERT_EQ (1, xrb_uint512_from_string ("0000000000000000000000000000000000000000000000000000000000%000000000000000000000000000000000000000000000000000000000000000000000", zero.bytes.data ())); -} - -TEST (interface, xrb_valid_address) -{ - ASSERT_EQ (0, xrb_valid_address ("xrb_1111111111111111111111111111111111111111111111111111hifc8npp")); - ASSERT_EQ (1, xrb_valid_address ("xrb_1111111111111111111111111111111111111111111111111111hifc8nppp")); - ASSERT_EQ (1, xrb_valid_address ("xrb_1111111211111111111111111111111111111111111111111111hifc8npp")); - ASSERT_EQ (0, xrb_valid_address ("nano_1111111111111111111111111111111111111111111111111111hifc8npp")); - ASSERT_EQ (1, xrb_valid_address ("nano_1111111111111111111111111111111111111111111111111111hifc8nppp")); - ASSERT_EQ (1, xrb_valid_address ("nano_1111111211111111111111111111111111111111111111111111hifc8npp")); -} - -TEST (interface, xrb_seed_create) -{ - nano::uint256_union seed; - xrb_generate_random (seed.bytes.data ()); - ASSERT_FALSE (seed.is_zero ()); -} - -TEST (interface, xrb_seed_key) -{ - nano::uint256_union seed (0); - nano::uint256_union prv; - xrb_seed_key (seed.bytes.data (), 0, prv.bytes.data ()); - ASSERT_FALSE (prv.is_zero ()); -} - -TEST (interface, xrb_key_account) -{ - nano::uint256_union prv (0); - nano::uint256_union pub; - xrb_key_account (prv.bytes.data (), pub.bytes.data ()); - ASSERT_FALSE (pub.is_zero ()); -} - -TEST (interface, sign_transaction) -{ - nano::raw_key key; - xrb_generate_random (key.data.bytes.data ()); - nano::uint256_union pub; - xrb_key_account (key.data.bytes.data (), pub.bytes.data ()); - nano::send_block send (0, 0, 0, key, pub, 0); - ASSERT_FALSE (nano::validate_message (pub, send.hash (), send.signature)); - send.signature.bytes[0] ^= 1; - ASSERT_TRUE (nano::validate_message (pub, send.hash (), send.signature)); - auto send_json (send.to_json ()); - auto transaction (xrb_sign_transaction (send_json.c_str (), key.data.bytes.data ())); - boost::property_tree::ptree block_l; - std::string transaction_l (transaction); - std::stringstream block_stream (transaction_l); - boost::property_tree::read_json (block_stream, block_l); - auto block (nano::deserialize_block_json (block_l)); - ASSERT_NE (nullptr, block); - auto send1 (dynamic_cast (block.get ())); - ASSERT_NE (nullptr, send1); - ASSERT_FALSE (nano::validate_message (pub, send.hash (), send1->signature)); - // Signatures should be non-deterministic - auto transaction2 (xrb_sign_transaction (send_json.c_str (), key.data.bytes.data ())); - ASSERT_NE (0, strcmp (transaction, transaction2)); - free (transaction); - free (transaction2); -} - -TEST (interface, fail_sign_transaction) -{ - nano::uint256_union data (0); - xrb_sign_transaction ("", data.bytes.data ()); -} - -TEST (interface, work_transaction) -{ - nano::raw_key key; - xrb_generate_random (key.data.bytes.data ()); - nano::uint256_union pub; - xrb_key_account (key.data.bytes.data (), pub.bytes.data ()); - nano::send_block send (1, 0, 0, key, pub, 0); - auto transaction (xrb_work_transaction (send.to_json ().c_str ())); - boost::property_tree::ptree block_l; - std::string transaction_l (transaction); - std::stringstream block_stream (transaction_l); - boost::property_tree::read_json (block_stream, block_l); - auto block (nano::deserialize_block_json (block_l)); - ASSERT_NE (nullptr, block); - ASSERT_FALSE (nano::work_validate (*block)); - free (transaction); -} - -TEST (interface, fail_work_transaction) -{ - nano::uint256_union data (0); - xrb_work_transaction (""); -} diff --git a/nano/core_test/node.cpp b/nano/core_test/node.cpp index 1ee3173c..13f8bc45 100644 --- a/nano/core_test/node.cpp +++ b/nano/core_test/node.cpp @@ -257,7 +257,7 @@ TEST (node, auto_bootstrap) ASSERT_NO_ERROR (system.poll ()); }; system.deadline_set (5s); - while (node1->stats.count (nano::stat::type::observer, nano::stat::detail::observer_confirmation_active_quorum, nano::stat::dir::out) < 0 || node1->stats.count (nano::stat::type::observer, nano::stat::detail::observer_confirmation_active_conf_height, nano::stat::dir::out) < 0) + while (node1->stats.count (nano::stat::type::observer, nano::stat::detail::observer_confirmation_active_quorum, nano::stat::dir::out) == 0 || node1->stats.count (nano::stat::type::observer, nano::stat::detail::observer_confirmation_active_conf_height, nano::stat::dir::out) == 0) { ASSERT_NO_ERROR (system.poll ()); } @@ -1635,7 +1635,7 @@ TEST (node, broadcast_elected) ASSERT_NO_ERROR (ec); } system.deadline_set (5s); - while (node1->stats.count (nano::stat::type::observer, nano::stat::detail::observer_confirmation_inactive, nano::stat::dir::out) < 0) + while (node1->stats.count (nano::stat::type::observer, nano::stat::detail::observer_confirmation_inactive, nano::stat::dir::out) == 0) { ASSERT_NO_ERROR (system.poll ()); } diff --git a/nano/core_test/peer_container.cpp b/nano/core_test/peer_container.cpp index 64821e43..3aa2e9a3 100644 --- a/nano/core_test/peer_container.cpp +++ b/nano/core_test/peer_container.cpp @@ -88,7 +88,7 @@ TEST (channels, fill_random_clear) TEST (channels, fill_random_full) { nano::system system (24000, 1); - for (auto i (0); i < 100; ++i) + for (uint16_t i (0u); i < 100u; ++i) { system.nodes[0]->network.udp_channels.insert (nano::endpoint (boost::asio::ip::address_v6::loopback (), i), 0); } diff --git a/nano/core_test/socket.cpp b/nano/core_test/socket.cpp index c6cf406c..28a3c11e 100644 --- a/nano/core_test/socket.cpp +++ b/nano/core_test/socket.cpp @@ -27,6 +27,15 @@ TEST (socket, concurrent_writes) std::function)> reader = [&read_count_completion, &total_message_count, &reader](std::shared_ptr socket_a) { auto buff (std::make_shared> ()); buff->resize (1); +#ifndef _WIN32 +#pragma GCC diagnostic push +#if defined(__has_warning) +#if __has_warning("-Wunused-lambda-capture") +/** total_message_count is constexpr and a capture isn't needed. However, removing it fails to compile on VS2017 due to a known compiler bug. */ +#pragma GCC diagnostic ignored "-Wunused-lambda-capture" +#endif +#endif +#endif socket_a->async_read (buff, 1, [&read_count_completion, &reader, &total_message_count, socket_a, buff](boost::system::error_code const & ec, size_t size_a) { if (!ec) { @@ -40,6 +49,9 @@ TEST (socket, concurrent_writes) std::cerr << "async_read: " << ec.message () << std::endl; } }); +#ifndef _WIN32 +#pragma GCC diagnostic pop +#endif }; boost::asio::ip::tcp::endpoint endpoint (boost::asio::ip::address_v4::any (), 25000); @@ -90,8 +102,15 @@ TEST (socket, concurrent_writes) std::vector client_threads; for (int i = 0; i < client_count; i++) { - // Note: this gives a warning on most compilers because message_count is constexpr and a - // capture isn't needed. However, removing it fails to compile on VS2017 due to a known compiler bug. +#ifndef _WIN32 +#pragma GCC diagnostic push +#if defined(__has_warning) +#if __has_warning("-Wunused-lambda-capture") +/** total_message_count is constexpr and a capture isn't needed. However, removing it fails to compile on VS2017 due to a known compiler bug. */ +#pragma GCC diagnostic ignored "-Wunused-lambda-capture" +#endif +#endif +#endif client_threads.emplace_back ([&client, &message_count]() { for (int i = 0; i < message_count; i++) { @@ -100,6 +119,9 @@ TEST (socket, concurrent_writes) client->async_write (buff); } }); +#ifndef _WIN32 +#pragma GCC diagnostic pop +#endif } ASSERT_FALSE (read_count_completion.await_count_for (10s)); diff --git a/nano/core_test/uint256_union.cpp b/nano/core_test/uint256_union.cpp index 9be8b9a1..75d5e673 100644 --- a/nano/core_test/uint256_union.cpp +++ b/nano/core_test/uint256_union.cpp @@ -1,5 +1,4 @@ #include -#include #include #include @@ -374,36 +373,6 @@ TEST (uint256_union, decode_nano_variant) ASSERT_FALSE (key.decode_account ("nano_1111111111111111111111111111111111111111111111111111hifc8npp")); } -TEST (uint256_union, decode_account_variations) -{ - for (int i = 0; i < 100; i++) - { - nano::raw_key key; - xrb_generate_random (key.data.bytes.data ()); - nano::uint256_union pub; - xrb_key_account (key.data.bytes.data (), pub.bytes.data ()); - - char account[66] = { 0 }; - xrb_uint256_to_address (pub.bytes.data (), account); - - /* - * Handle different offsets for the underscore separator - * for "xrb_" prefixed and "nano_" prefixed accounts - */ - unsigned offset = (account[0] == 'x') ? 4 : 5; - - // Replace first digit after xrb_ with '0'..'9', make sure only one of them is valid - int errors = 0; - for (int variation = 0; variation < 10; variation++) - { - account[offset] = static_cast (variation + 48); - errors += xrb_valid_address (account); - } - - ASSERT_EQ (errors, 9); - } -} - TEST (uint256_union, account_transcode) { nano::uint256_union value; diff --git a/nano/core_test/websocket.cpp b/nano/core_test/websocket.cpp index e228f8bf..f88d1f3f 100644 --- a/nano/core_test/websocket.cpp +++ b/nano/core_test/websocket.cpp @@ -1,3 +1,5 @@ +#include +#include #include #include #include @@ -5,11 +7,6 @@ #include -#include -#include -#include -#include -#include #include #include diff --git a/nano/crypto/blake2/blake2.h b/nano/crypto/blake2/blake2.h new file mode 100644 index 00000000..51481b2e --- /dev/null +++ b/nano/crypto/blake2/blake2.h @@ -0,0 +1,12 @@ +#pragma once + +#ifdef _WIN32 +#pragma warning(push) +#pragma warning(disable : 4804) +#endif + +#include + +#ifdef _WIN32 +#pragma warning(pop) +#endif diff --git a/nano/crypto/readme.txt b/nano/crypto/readme.txt new file mode 100644 index 00000000..a4283bd4 --- /dev/null +++ b/nano/crypto/readme.txt @@ -0,0 +1 @@ +These are files which wrap other crypto/ third party files and suppress compiler warnings associated with them. \ No newline at end of file diff --git a/nano/crypto_lib/interface.cpp b/nano/crypto_lib/interface.cpp index 37dc83a2..4c76e9e9 100644 --- a/nano/crypto_lib/interface.cpp +++ b/nano/crypto_lib/interface.cpp @@ -1,7 +1,6 @@ +#include #include -#include - extern "C" { #include void ed25519_randombytes_unsafe (void * out, size_t outlen) diff --git a/nano/lib/CMakeLists.txt b/nano/lib/CMakeLists.txt index 397d46c4..9bcbe3f2 100644 --- a/nano/lib/CMakeLists.txt +++ b/nano/lib/CMakeLists.txt @@ -20,8 +20,6 @@ add_library (nano_lib config.cpp errors.hpp errors.cpp - interface.h - interface.cpp ipc.hpp ipc.cpp ipc_client.hpp diff --git a/nano/lib/blockbuilders.cpp b/nano/lib/blockbuilders.cpp index ce408825..8761ff2e 100644 --- a/nano/lib/blockbuilders.cpp +++ b/nano/lib/blockbuilders.cpp @@ -185,7 +185,7 @@ std::error_code check_fields_set (uint8_t block_all_flags, uint8_t build_state) if (res) { // Convert the first bit set to a field mask and look up the error code. - auto build_flags_mask = ffs_mask (res); + auto build_flags_mask = static_cast (ffs_mask (res)); assert (ec_map.find (build_flags_mask) != ec_map.end ()); ec = ec_map[build_flags_mask]; } diff --git a/nano/lib/blocks.hpp b/nano/lib/blocks.hpp index deaad5af..96f5575f 100644 --- a/nano/lib/blocks.hpp +++ b/nano/lib/blocks.hpp @@ -1,11 +1,10 @@ #pragma once +#include #include #include #include -#include - #include #include diff --git a/nano/lib/interface.cpp b/nano/lib/interface.cpp deleted file mode 100644 index 6ac41d3e..00000000 --- a/nano/lib/interface.cpp +++ /dev/null @@ -1,139 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#include - -#include - -#include - -extern "C" { -void xrb_uint128_to_dec (xrb_uint128 source, char * destination) -{ - auto const & number (*reinterpret_cast (source)); - strncpy (destination, number.to_string_dec ().c_str (), 40); -} - -void xrb_uint256_to_string (xrb_uint256 source, char * destination) -{ - auto const & number (*reinterpret_cast (source)); - strncpy (destination, number.to_string ().c_str (), 65); -} - -void xrb_uint256_to_address (xrb_uint256 source, char * destination) -{ - auto const & number (*reinterpret_cast (source)); - strncpy (destination, number.to_account ().c_str (), 65); -} - -void xrb_uint512_to_string (xrb_uint512 source, char * destination) -{ - auto const & number (*reinterpret_cast (source)); - strncpy (destination, number.to_string ().c_str (), 129); -} - -int xrb_uint128_from_dec (const char * source, xrb_uint128 destination) -{ - auto & number (*reinterpret_cast (destination)); - auto error (number.decode_dec (source)); - return error ? 1 : 0; -} - -int xrb_uint256_from_string (const char * source, xrb_uint256 destination) -{ - auto & number (*reinterpret_cast (destination)); - auto error (number.decode_hex (source)); - return error ? 1 : 0; -} - -int xrb_uint512_from_string (const char * source, xrb_uint512 destination) -{ - auto & number (*reinterpret_cast (destination)); - auto error (number.decode_hex (source)); - return error ? 1 : 0; -} - -int xrb_valid_address (const char * account_a) -{ - nano::uint256_union account; - auto error (account.decode_account (account_a)); - return error ? 1 : 0; -} - -void xrb_generate_random (xrb_uint256 seed) -{ - auto & number (*reinterpret_cast (seed)); - nano::random_pool::generate_block (number.bytes.data (), number.bytes.size ()); -} - -void xrb_seed_key (xrb_uint256 seed, int index, xrb_uint256 destination) -{ - auto & seed_l (*reinterpret_cast (seed)); - auto & destination_l (*reinterpret_cast (destination)); - nano::deterministic_key (seed_l, index, destination_l); -} - -void xrb_key_account (const xrb_uint256 key, xrb_uint256 pub) -{ - ed25519_publickey (key, pub); -} - -char * xrb_sign_transaction (const char * transaction, const xrb_uint256 private_key) -{ - char * result (nullptr); - try - { - boost::property_tree::ptree block_l; - std::string transaction_l (transaction); - std::stringstream block_stream (transaction_l); - boost::property_tree::read_json (block_stream, block_l); - auto block (nano::deserialize_block_json (block_l)); - if (block != nullptr) - { - nano::uint256_union pub; - ed25519_publickey (private_key, pub.bytes.data ()); - nano::raw_key prv; - prv.data = *reinterpret_cast (private_key); - block->signature_set (nano::sign_message (prv, pub, block->hash ())); - auto json (block->to_json ()); - result = reinterpret_cast (malloc (json.size () + 1)); - strncpy (result, json.c_str (), json.size () + 1); - } - } - catch (std::runtime_error const &) - { - } - return result; -} - -char * xrb_work_transaction (const char * transaction) -{ - static nano::network_constants network_constants; - char * result (nullptr); - try - { - boost::property_tree::ptree block_l; - std::string transaction_l (transaction); - std::stringstream block_stream (transaction_l); - boost::property_tree::read_json (block_stream, block_l); - auto block (nano::deserialize_block_json (block_l)); - if (block != nullptr) - { - nano::work_pool pool (boost::thread::hardware_concurrency ()); - auto work (pool.generate (block->root (), network_constants.publish_threshold)); - block->block_work_set (work); - auto json (block->to_json ()); - result = reinterpret_cast (malloc (json.size () + 1)); - strncpy (result, json.c_str (), json.size () + 1); - } - } - catch (std::runtime_error const &) - { - } - return result; -} -} diff --git a/nano/lib/interface.h b/nano/lib/interface.h deleted file mode 100644 index edb8595e..00000000 --- a/nano/lib/interface.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef XRB_INTERFACE_H -#define XRB_INTERFACE_H - -#if __cplusplus -extern "C" { -#endif - -typedef unsigned char * xrb_uint128; // 16byte array for public and private keys -typedef unsigned char * xrb_uint256; // 32byte array for public and private keys -typedef unsigned char * xrb_uint512; // 64byte array for signatures -typedef void * xrb_transaction; -// clang-format off -// Convert amount bytes 'source' to a 40 byte null-terminated decimal string 'destination' -[[deprecated]] void xrb_uint128_to_dec (const xrb_uint128 source, char * destination); -// Convert public/private key bytes 'source' to a 65 byte null-terminated hex string 'destination' -[[deprecated]] void xrb_uint256_to_string (const xrb_uint256 source, char * destination); -// Convert public key bytes 'source' to a 66 byte non-null-terminated account string 'destination' -[[deprecated]] void xrb_uint256_to_address (xrb_uint256 source, char * destination); -// Convert public/private key bytes 'source' to a 129 byte null-terminated hex string 'destination' -[[deprecated]] void xrb_uint512_to_string (const xrb_uint512 source, char * destination); - -// Convert 39 byte decimal string 'source' to a byte array 'destination' -// Return 0 on success, nonzero on error -[[deprecated]] int xrb_uint128_from_dec (const char * source, xrb_uint128 destination); -// Convert 64 byte hex string 'source' to a byte array 'destination' -// Return 0 on success, nonzero on error -[[deprecated]] int xrb_uint256_from_string (const char * source, xrb_uint256 destination); -// Convert 128 byte hex string 'source' to a byte array 'destination' -// Return 0 on success, nonzero on error -[[deprecated]] int xrb_uint512_from_string (const char * source, xrb_uint512 destination); - -// Check if the null-terminated string 'account' is a valid xrb account number -// Return 0 on correct, nonzero on invalid -[[deprecated]] int xrb_valid_address (const char * account); - -// Create a new random number in to 'destination' -[[deprecated]] void xrb_generate_random (xrb_uint256 destination); -// Retrieve the deterministic private key for 'seed' at 'index' -[[deprecated]] void xrb_seed_key (const xrb_uint256 seed, int index, xrb_uint256); -// Derive the public key 'pub' from 'key' -[[deprecated]] void xrb_key_account (xrb_uint256 key, xrb_uint256 pub); - -// Sign 'transaction' using 'private_key' and write to 'signature' -char * xrb_sign_transaction (const char * transaction, const xrb_uint256 private_key); -// Generate work for 'transaction' -[[deprecated]] -char * xrb_work_transaction (const char * transaction); -// clang-format on -#if __cplusplus -} // extern "C" -#endif - -#endif // XRB_INTERFACE_H diff --git a/nano/lib/ipc.hpp b/nano/lib/ipc.hpp index 00b263e4..c89cde78 100644 --- a/nano/lib/ipc.hpp +++ b/nano/lib/ipc.hpp @@ -1,6 +1,7 @@ #pragma once -#include +#include + #include #include diff --git a/nano/lib/ipc_client.hpp b/nano/lib/ipc_client.hpp index 30a674f0..0f61dc33 100644 --- a/nano/lib/ipc_client.hpp +++ b/nano/lib/ipc_client.hpp @@ -1,9 +1,9 @@ #pragma once +#include #include #include -#include #include #include diff --git a/nano/lib/jsonconfig.hpp b/nano/lib/jsonconfig.hpp index 75d123ea..8d31d8c9 100644 --- a/nano/lib/jsonconfig.hpp +++ b/nano/lib/jsonconfig.hpp @@ -1,9 +1,9 @@ #pragma once +#include #include #include -#include #include #include #include diff --git a/nano/lib/numbers.cpp b/nano/lib/numbers.cpp index 390699f5..0914c876 100644 --- a/nano/lib/numbers.cpp +++ b/nano/lib/numbers.cpp @@ -1,8 +1,8 @@ +#include #include #include #include -#include #include #include @@ -817,6 +817,11 @@ std::string nano::to_string (double const value_a, int const precision_a) return stream.str (); } +#ifdef _WIN32 +#pragma warning(push) +#pragma warning(disable : 4146) // warning C4146: unary minus operator applied to unsigned type, result still unsigned +#endif + uint64_t nano::difficulty::from_multiplier (double const multiplier_a, uint64_t const base_difficulty_a) { assert (multiplier_a > 0.); @@ -827,4 +832,8 @@ double nano::difficulty::to_multiplier (uint64_t const difficulty_a, uint64_t co { assert (difficulty_a > 0); return static_cast (-base_difficulty_a) / (-difficulty_a); -} \ No newline at end of file +} + +#ifdef _WIN32 +#pragma warning(pop) +#endif diff --git a/nano/lib/rpcconfig.hpp b/nano/lib/rpcconfig.hpp index db4c6c4e..3dd51f19 100644 --- a/nano/lib/rpcconfig.hpp +++ b/nano/lib/rpcconfig.hpp @@ -1,9 +1,9 @@ #pragma once +#include #include #include -#include #include #include @@ -59,7 +59,7 @@ public: rpc_secure_config secure; uint8_t max_json_depth{ 20 }; uint64_t max_request_size{ 32 * 1024 * 1024 }; - static int json_version () + static unsigned json_version () { return 1; } diff --git a/nano/lib/stats.cpp b/nano/lib/stats.cpp index 36849b67..fe856a74 100644 --- a/nano/lib/stats.cpp +++ b/nano/lib/stats.cpp @@ -1,6 +1,6 @@ +#include #include -#include #include #include diff --git a/nano/lib/utility.hpp b/nano/lib/utility.hpp index 6c3c140d..1614feee 100644 --- a/nano/lib/utility.hpp +++ b/nano/lib/utility.hpp @@ -1,6 +1,7 @@ #pragma once -#include +#include + #include #include #include diff --git a/nano/load_test/entry.cpp b/nano/load_test/entry.cpp index 73f27d9a..1c150dd7 100644 --- a/nano/load_test/entry.cpp +++ b/nano/load_test/entry.cpp @@ -1,13 +1,11 @@ +#include +#include +#include #include #include #include #include -#include -#include -#include -#include -#include #include #include @@ -32,14 +30,6 @@ namespace http = beast::http; namespace net = boost::asio; using tcp = net::ip::tcp; -#ifndef BOOST_PROCESS_SUPPORTED -#error BOOST_PROCESS_SUPPORTED must be set, check configuration -#endif - -#if BOOST_PROCESS_SUPPORTED -#include -#endif - constexpr auto rpc_port_start = 60000; constexpr auto peering_port_start = 61000; constexpr auto ipc_port_start = 62000; diff --git a/nano/nano_node/daemon.cpp b/nano/nano_node/daemon.cpp index b0f67dfa..12e5138c 100644 --- a/nano/nano_node/daemon.cpp +++ b/nano/nano_node/daemon.cpp @@ -1,3 +1,4 @@ +#include #include #include #include @@ -14,14 +15,6 @@ #include #include -#ifndef BOOST_PROCESS_SUPPORTED -#error BOOST_PROCESS_SUPPORTED must be set, check configuration -#endif - -#if BOOST_PROCESS_SUPPORTED -#include -#endif - namespace { void my_abort_signal_handler (int signum) diff --git a/nano/nano_wallet/entry.cpp b/nano/nano_wallet/entry.cpp index cfd6e8d7..e5c975f5 100644 --- a/nano/nano_wallet/entry.cpp +++ b/nano/nano_wallet/entry.cpp @@ -1,3 +1,4 @@ +#include #include #include #include @@ -17,14 +18,6 @@ #include #include -#ifndef BOOST_PROCESS_SUPPORTED -#error BOOST_PROCESS_SUPPORTED must be set, check configuration -#endif - -#if BOOST_PROCESS_SUPPORTED -#include -#endif - class qt_wallet_config { public: @@ -180,7 +173,7 @@ public: bool opencl_enable{ false }; nano::opencl_config opencl; boost::filesystem::path data_path; - int json_version () const + unsigned json_version () const { return 4; } diff --git a/nano/node/active_transactions.cpp b/nano/node/active_transactions.cpp index 436a25ba..ddaea618 100644 --- a/nano/node/active_transactions.cpp +++ b/nano/node/active_transactions.cpp @@ -599,7 +599,7 @@ void nano::active_transactions::adjust_difficulty (nano::block_hash const & hash // Possible overflow check, will not occur for negative levels if ((multiplier + highest_level) > 10000000000) { - divider = ((multiplier + highest_level) / 10000000000) + 1; + divider = static_cast (((multiplier + highest_level) / 10000000000) + 1); } // Set adjusted difficulty diff --git a/nano/node/bootstrap.cpp b/nano/node/bootstrap.cpp index 633e0066..7232e449 100644 --- a/nano/node/bootstrap.cpp +++ b/nano/node/bootstrap.cpp @@ -1293,7 +1293,8 @@ void nano::bootstrap_attempt::lazy_pull_flush () // Recheck if block was already processed if (lazy_blocks.find (pull_start) == lazy_blocks.end () && !node->store.block_exists (transaction, pull_start)) { - pulls.push_back (nano::pull_info (pull_start, pull_start, nano::block_hash (0), node->network_params.bootstrap.lazy_max_pull_blocks)); + assert (node->network_params.bootstrap.lazy_max_pull_blocks <= std::numeric_limits::max ()); + pulls.push_back (nano::pull_info (pull_start, pull_start, nano::block_hash (0), static_cast (node->network_params.bootstrap.lazy_max_pull_blocks))); } } lazy_pulls.clear (); diff --git a/nano/node/cli.cpp b/nano/node/cli.cpp index 65a37f22..da3cb3c8 100644 --- a/nano/node/cli.cpp +++ b/nano/node/cli.cpp @@ -1,5 +1,4 @@ #include -#include #include #include #include diff --git a/nano/node/common.cpp b/nano/node/common.cpp index d783a81c..f41e2827 100644 --- a/nano/node/common.cpp +++ b/nano/node/common.cpp @@ -90,7 +90,7 @@ void nano::message_header::block_type_set (nano::block_type type_a) uint8_t nano::message_header::count_get () const { - return ((extensions & count_mask) >> 12).to_ullong (); + return static_cast (((extensions & count_mask) >> 12).to_ullong ()); } void nano::message_header::count_set (uint8_t count_a) @@ -561,7 +561,7 @@ roots_hashes (roots_hashes_a) // not_a_block (1) block type for hashes + roots request header.block_type_set (nano::block_type::not_a_block); assert (roots_hashes.size () < 16); - header.count_set (roots_hashes.size ()); + header.count_set (static_cast (roots_hashes.size ())); } nano::confirm_req::confirm_req (nano::block_hash const & hash_a, nano::block_hash const & root_a) : @@ -571,7 +571,8 @@ roots_hashes (std::vector> (1, std assert (!roots_hashes.empty ()); // not_a_block (1) block type for hashes + roots request header.block_type_set (nano::block_type::not_a_block); - header.count_set (roots_hashes.size ()); + assert (roots_hashes.size () < 16); + header.count_set (static_cast (roots_hashes.size ())); } void nano::confirm_req::visit (nano::message_visitor & visitor_a) const @@ -700,7 +701,7 @@ vote (vote_a) { header.block_type_set (nano::block_type::not_a_block); assert (vote_a->blocks.size () < 16); - header.count_set (vote_a->blocks.size ()); + header.count_set (static_cast (vote_a->blocks.size ())); } else { diff --git a/nano/node/common.hpp b/nano/node/common.hpp index 7c19844d..7cd53ba6 100644 --- a/nano/node/common.hpp +++ b/nano/node/common.hpp @@ -1,13 +1,11 @@ #pragma once +#include #include #include -#include #include #include -#include - #include namespace nano diff --git a/nano/node/daemonconfig.hpp b/nano/node/daemonconfig.hpp index 39d4b03a..5ca5c30c 100644 --- a/nano/node/daemonconfig.hpp +++ b/nano/node/daemonconfig.hpp @@ -25,7 +25,7 @@ public: bool opencl_enable{ false }; nano::opencl_config opencl; boost::filesystem::path data_path; - int json_version () const + unsigned json_version () const { return 2; } diff --git a/nano/node/ipc.cpp b/nano/node/ipc.cpp index 7d119e35..ea4c95c1 100644 --- a/nano/node/ipc.cpp +++ b/nano/node/ipc.cpp @@ -237,7 +237,7 @@ public: // A separate io_context for domain sockets may facilitate better performance on some systems. if (concurrency_a > 0) { - runner = std::make_unique (*io_ctx, concurrency_a); + runner = std::make_unique (*io_ctx, static_cast (concurrency_a)); } } @@ -304,7 +304,7 @@ node_rpc_config (node_rpc_config_a) if (node_a.config.ipc_config.transport_domain.enabled) { #if defined(BOOST_ASIO_HAS_LOCAL_SOCKETS) - size_t threads = node_a.config.ipc_config.transport_domain.io_threads; + auto threads = node_a.config.ipc_config.transport_domain.io_threads; file_remover = std::make_unique (node_a.config.ipc_config.transport_domain.path); boost::asio::local::stream_protocol::endpoint ep{ node_a.config.ipc_config.transport_domain.path }; transports.push_back (std::make_shared> (*this, ep, node_a.config.ipc_config.transport_domain, threads)); @@ -315,7 +315,7 @@ node_rpc_config (node_rpc_config_a) if (node_a.config.ipc_config.transport_tcp.enabled) { - size_t threads = node_a.config.ipc_config.transport_tcp.io_threads; + auto threads = node_a.config.ipc_config.transport_tcp.io_threads; transports.push_back (std::make_shared> (*this, boost::asio::ip::tcp::endpoint (boost::asio::ip::tcp::v6 (), node_a.config.ipc_config.transport_tcp.port), node_a.config.ipc_config.transport_tcp, threads)); } diff --git a/nano/node/ipcconfig.hpp b/nano/node/ipcconfig.hpp index f6b6ba1d..3a7a9df9 100644 --- a/nano/node/ipcconfig.hpp +++ b/nano/node/ipcconfig.hpp @@ -32,7 +32,7 @@ namespace ipc */ std::string path{ "/tmp/nano" }; - int json_version () const + unsigned json_version () const { return 1; } diff --git a/nano/node/logging.hpp b/nano/node/logging.hpp index 8552e81d..e77a09d1 100644 --- a/nano/node/logging.hpp +++ b/nano/node/logging.hpp @@ -65,7 +65,7 @@ public: uintmax_t rotation_size{ 4 * 1024 * 1024 }; std::chrono::milliseconds min_time_between_log_output{ 5 }; static void release_file_sink (); - int json_version () const + unsigned json_version () const { return 7; } diff --git a/nano/node/network.hpp b/nano/node/network.hpp index 2ed5ab00..fcfcb019 100644 --- a/nano/node/network.hpp +++ b/nano/node/network.hpp @@ -1,10 +1,10 @@ #pragma once +#include #include #include #include -#include #include #include diff --git a/nano/node/node.cpp b/nano/node/node.cpp index 6c4dba78..e247a524 100644 --- a/nano/node/node.cpp +++ b/nano/node/node.cpp @@ -1,5 +1,4 @@ #include -#include #include #include #include diff --git a/nano/node/node.hpp b/nano/node/node.hpp index b751ccd8..3affa7a8 100644 --- a/nano/node/node.hpp +++ b/nano/node/node.hpp @@ -1,5 +1,6 @@ #pragma once +#include #include #include #include @@ -23,7 +24,6 @@ #include #include -#include #include #include #include diff --git a/nano/node/node_rpc_config.hpp b/nano/node/node_rpc_config.hpp index 920d23a5..d519b044 100644 --- a/nano/node/node_rpc_config.hpp +++ b/nano/node/node_rpc_config.hpp @@ -23,7 +23,7 @@ public: bool enable_sign_hash{ false }; uint64_t max_work_generate_difficulty{ 0xffffffffc0000000 }; nano::rpc_child_process_config child_process; - static int json_version () + static unsigned json_version () { return 1; } diff --git a/nano/node/nodeconfig.cpp b/nano/node/nodeconfig.cpp index f54ace7b..57101911 100644 --- a/nano/node/nodeconfig.cpp +++ b/nano/node/nodeconfig.cpp @@ -351,8 +351,8 @@ nano::error nano::node_config::deserialize_json (bool & upgraded_a, nano::jsonco json.get_error ().set ("vote_minimum contains an invalid decimal amount"); } - unsigned long delay_l = vote_generator_delay.count (); - json.get ("vote_generator_delay", delay_l); + auto delay_l = vote_generator_delay.count (); + json.get ("vote_generator_delay", delay_l); vote_generator_delay = std::chrono::milliseconds (delay_l); json.get ("vote_generator_threshold", vote_generator_threshold); diff --git a/nano/node/nodeconfig.hpp b/nano/node/nodeconfig.hpp index bf4b92cf..13734d37 100644 --- a/nano/node/nodeconfig.hpp +++ b/nano/node/nodeconfig.hpp @@ -77,7 +77,7 @@ public: static std::chrono::minutes constexpr wallet_backup_interval = std::chrono::minutes (5); size_t bandwidth_limit{ 5 * 1024 * 1024 }; // 5Mb/s std::chrono::milliseconds conf_height_processor_batch_min_time{ 50 }; - static int json_version () + static unsigned json_version () { return 17; } diff --git a/nano/node/portmapping.cpp b/nano/node/portmapping.cpp index 6cf8e6bd..c49f02d2 100644 --- a/nano/node/portmapping.cpp +++ b/nano/node/portmapping.cpp @@ -82,7 +82,7 @@ void nano::port_mapping::refresh_mapping () } if (add_port_mapping_error == UPNPCOMMAND_SUCCESS) { - protocol.external_port = std::atoi (actual_external_port.data ()); + protocol.external_port = static_cast (std::atoi (actual_external_port.data ())); } else { diff --git a/nano/node/portmapping.hpp b/nano/node/portmapping.hpp index 445afed5..0b05477c 100644 --- a/nano/node/portmapping.hpp +++ b/nano/node/portmapping.hpp @@ -1,13 +1,12 @@ #pragma once +#include #include -#include +#include #include -#include - namespace nano { class node; diff --git a/nano/node/repcrawler.hpp b/nano/node/repcrawler.hpp index a673b0d5..12ce7664 100644 --- a/nano/node/repcrawler.hpp +++ b/nano/node/repcrawler.hpp @@ -1,9 +1,9 @@ #pragma once +#include #include #include -#include #include #include #include diff --git a/nano/node/signatures.hpp b/nano/node/signatures.hpp index d78db151..caaa783d 100644 --- a/nano/node/signatures.hpp +++ b/nano/node/signatures.hpp @@ -1,9 +1,8 @@ #pragma once +#include #include -#include - #include #include #include @@ -39,7 +38,7 @@ public: private: struct Task final { - Task (nano::signature_check_set & check, int pending) : + Task (nano::signature_check_set & check, size_t pending) : check (check), pending (pending) { } @@ -48,7 +47,7 @@ private: release_assert (pending == 0); } nano::signature_check_set & check; - std::atomic pending; + std::atomic pending; }; bool verify_batch (const nano::signature_check_set & check_a, size_t index, size_t size); diff --git a/nano/node/socket.hpp b/nano/node/socket.hpp index 6cee3227..bc4b44d0 100644 --- a/nano/node/socket.hpp +++ b/nano/node/socket.hpp @@ -1,6 +1,7 @@ #pragma once -#include +#include + #include #include diff --git a/nano/node/transport/tcp.hpp b/nano/node/transport/tcp.hpp index 833b8bc0..d4444428 100644 --- a/nano/node/transport/tcp.hpp +++ b/nano/node/transport/tcp.hpp @@ -1,9 +1,9 @@ #pragma once +#include #include #include -#include #include #include #include diff --git a/nano/node/transport/transport.cpp b/nano/node/transport/transport.cpp index 66d7c6bf..16466a37 100644 --- a/nano/node/transport/transport.cpp +++ b/nano/node/transport/transport.cpp @@ -235,7 +235,7 @@ bool nano::bandwidth_limiter::should_drop (const size_t & message_size) { next_trend = std::chrono::steady_clock::now () + 50ms; rate_buffer.push_back (rate); - trended_rate = std::accumulate (rate_buffer.begin (), rate_buffer.end (), 0) / rate_buffer.size (); + trended_rate = std::accumulate (rate_buffer.begin (), rate_buffer.end (), size_t{ 0 }) / rate_buffer.size (); rate = 0; } return result; diff --git a/nano/node/transport/udp.hpp b/nano/node/transport/udp.hpp index e560f8ed..d04028e6 100644 --- a/nano/node/transport/udp.hpp +++ b/nano/node/transport/udp.hpp @@ -1,9 +1,9 @@ #pragma once +#include #include #include -#include #include #include #include diff --git a/nano/node/websocket.hpp b/nano/node/websocket.hpp index 2681c1d3..325b80aa 100644 --- a/nano/node/websocket.hpp +++ b/nano/node/websocket.hpp @@ -1,14 +1,10 @@ #pragma once +#include +#include #include #include -#include -#include -#include -#include -#include -#include #include #include diff --git a/nano/node/websocketconfig.hpp b/nano/node/websocketconfig.hpp index 37b44d43..42a454b6 100644 --- a/nano/node/websocketconfig.hpp +++ b/nano/node/websocketconfig.hpp @@ -1,10 +1,9 @@ #pragma once +#include #include #include -#include - namespace nano { class jsonconfig; diff --git a/nano/qt_system/entry.cpp b/nano/qt_system/entry.cpp index 2c1fab73..8eadd92c 100644 --- a/nano/qt_system/entry.cpp +++ b/nano/qt_system/entry.cpp @@ -15,7 +15,7 @@ int main (int argc, char ** argv) QCoreApplication::setOrganizationDomain ("nano.org"); QCoreApplication::setApplicationName ("Nano Wallet"); nano_qt::eventloop_processor processor; - static int count (16); + static uint16_t count (16); nano::system system (24000, count); nano::thread_runner runner (system.io_ctx, system.nodes[0]->config.io_threads); std::unique_ptr client_tabs (new QTabWidget); diff --git a/nano/qt_test/QTest b/nano/qt_test/QTest new file mode 100644 index 00000000..0304c027 --- /dev/null +++ b/nano/qt_test/QTest @@ -0,0 +1,12 @@ +#pragma once + +#ifdef _WIN32 +#pragma warning (push) +#pragma warning (disable : 4242) // warning C4242: 'argument': conversion from 'int' to 'ushort', possible loss of data +#endif + +#include + +#ifdef _WIN32 +#pragma warning (pop) +#endif diff --git a/nano/qt_test/qt.cpp b/nano/qt_test/qt.cpp index efdf8909..cc7e694b 100644 --- a/nano/qt_test/qt.cpp +++ b/nano/qt_test/qt.cpp @@ -6,8 +6,8 @@ #include -#include #include +#include #include using namespace std::chrono_literals; diff --git a/nano/rpc/rpc.hpp b/nano/rpc/rpc.hpp index 95c35b95..7949dee3 100644 --- a/nano/rpc/rpc.hpp +++ b/nano/rpc/rpc.hpp @@ -1,11 +1,10 @@ #pragma once +#include #include #include #include -#include - namespace nano { class rpc_handler_interface; diff --git a/nano/secure/blockstore.hpp b/nano/secure/blockstore.hpp index 86276b71..e988360c 100644 --- a/nano/secure/blockstore.hpp +++ b/nano/secure/blockstore.hpp @@ -895,7 +895,7 @@ public: auto version (block_version (transaction_a, hash_a)); assert (value.size () != 0); std::vector data (static_cast (value.data ()), static_cast (value.data ()) + value.size ()); - std::fill_n (data.begin () + block_successor_offset (transaction_a, value.size (), type), sizeof (nano::uint256_union), 0); + std::fill_n (data.begin () + block_successor_offset (transaction_a, value.size (), type), sizeof (nano::uint256_union), uint8_t{ 0 }); block_raw_put (transaction_a, data, type, version, hash_a); } diff --git a/nano/secure/common.cpp b/nano/secure/common.cpp index 511e3314..df6c2e54 100644 --- a/nano/secure/common.cpp +++ b/nano/secure/common.cpp @@ -1,7 +1,6 @@ #include #include #include -#include #include #include #include diff --git a/nano/secure/common.hpp b/nano/secure/common.hpp index dbbb8368..5f3e998c 100644 --- a/nano/secure/common.hpp +++ b/nano/secure/common.hpp @@ -1,5 +1,6 @@ #pragma once +#include #include #include #include @@ -7,8 +8,6 @@ #include #include -#include - #include #include #include diff --git a/nano/secure/utility.cpp b/nano/secure/utility.cpp index d1342ae3..d4a16ac7 100644 --- a/nano/secure/utility.cpp +++ b/nano/secure/utility.cpp @@ -1,5 +1,4 @@ #include -#include #include #include diff --git a/nano/secure/utility.hpp b/nano/secure/utility.hpp index 9c63c636..716f0320 100644 --- a/nano/secure/utility.hpp +++ b/nano/secure/utility.hpp @@ -1,7 +1,6 @@ #pragma once #include -#include #include #include