From 2d0122f1ed4d95fd0bd622b8680756e058cf15de Mon Sep 17 00:00:00 2001 From: Nathan Hourt Date: Mon, 25 Mar 2019 09:26:35 -0500 Subject: [PATCH] More tweaks vis-a-vis warnings Move crc_c fake usage out of strange main() function in a library Convert manual string formatting to FC string formatting --- src/crypto/crc.cpp | 4 ++-- tests/io/json_tests.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/crypto/crc.cpp b/src/crypto/crc.cpp index 2a2b026..7fa8cb1 100644 --- a/src/crypto/crc.cpp +++ b/src/crypto/crc.cpp @@ -606,6 +606,8 @@ static const uint32_t crc_c[256] = { uint64_t _mm_crc32_u64(uint64_t a, uint64_t b ) { + // Squelch warning about unusued variable crc_c + (void)(crc_c); return crc32cSlicingBy8(a, (unsigned char*)&b, sizeof(b)); } /* @@ -615,8 +617,6 @@ uint64_t _mm_crc32_u64(uint64_t a, uint64_t b ) int main( int argc, char** argv ) { - // Squelch warning about unusued variable crc_c - (void)(crc_c); uint64_t f = 0x1234; uint64_t a = 0x5678; uint32_t f1 = _mm_crc32_u64(f, a); diff --git a/tests/io/json_tests.cpp b/tests/io/json_tests.cpp index 7f0369e..90872e8 100644 --- a/tests/io/json_tests.cpp +++ b/tests/io/json_tests.cpp @@ -171,7 +171,7 @@ static bool equal( const fc::variant& a, const fc::variant& b ) return true; case fc::variant::type_id::blob_type: default: - FC_THROW_EXCEPTION( fc::invalid_arg_exception, "Unsupported variant type: " + std::to_string( a.get_type() ) ); + FC_THROW_EXCEPTION( fc::invalid_arg_exception, "Unsupported variant type: {t}", ( "t", a.get_type() ) ); } }