From b5b95ad52864e9006bed87d25aad9d4f9796d216 Mon Sep 17 00:00:00 2001 From: Adrien Beraud <adrien.beraud@savoirfairelinux.com> Date: Sun, 8 Jan 2023 14:14:26 -0500 Subject: [PATCH] eth: fix warnings Change-Id: I510df00599ea148fa18cec08a12737159c52ebd4 --- src/jamidht/eth/libdevcore/FixedHash.h | 3 +++ src/jamidht/eth/libdevcrypto/Common.cpp | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/jamidht/eth/libdevcore/FixedHash.h b/src/jamidht/eth/libdevcore/FixedHash.h index d6347aa75c..29b2602a2f 100644 --- a/src/jamidht/eth/libdevcore/FixedHash.h +++ b/src/jamidht/eth/libdevcore/FixedHash.h @@ -332,6 +332,9 @@ public: ConstructFromHashType _t = FixedHash<T>::AlignLeft) : FixedHash<T>(_h, _t) {} + SecureFixedHash(SecureFixedHash<T> const& _h) + : FixedHash<T>(_h.makeInsecure()) + {} template<unsigned M> explicit SecureFixedHash(SecureFixedHash<M> const& _h, ConstructFromHashType _t = FixedHash<T>::AlignLeft) diff --git a/src/jamidht/eth/libdevcrypto/Common.cpp b/src/jamidht/eth/libdevcrypto/Common.cpp index 9a38eb209f..a1999af20a 100644 --- a/src/jamidht/eth/libdevcrypto/Common.cpp +++ b/src/jamidht/eth/libdevcrypto/Common.cpp @@ -33,9 +33,11 @@ namespace { secp256k1_context const* getCtx() { - static std::unique_ptr<secp256k1_context, decltype(&secp256k1_context_destroy)> - s_ctx {secp256k1_context_create(SECP256K1_CONTEXT_SIGN | SECP256K1_CONTEXT_VERIFY), - &secp256k1_context_destroy}; + struct secp256k1Deleter { + void operator()(secp256k1_context* b) { secp256k1_context_destroy(b); } + }; + static std::unique_ptr<secp256k1_context, secp256k1Deleter> + s_ctx(secp256k1_context_create(SECP256K1_CONTEXT_SIGN | SECP256K1_CONTEXT_VERIFY)); return s_ctx.get(); } -- GitLab