From 0af734f5e904abaded54f06338e01cb63d4ffa58 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Tue, 8 Oct 2019 11:43:24 -0400 Subject: Attempt to address some LGTM warnings in Roughtime --- src/lib/misc/roughtime/roughtime.cpp | 3 +++ src/lib/misc/roughtime/roughtime.h | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lib/misc/roughtime/roughtime.cpp b/src/lib/misc/roughtime/roughtime.cpp index 94a9a6b82..b8c53bdc8 100644 --- a/src/lib/misc/roughtime/roughtime.cpp +++ b/src/lib/misc/roughtime/roughtime.cpp @@ -21,6 +21,9 @@ namespace Botan { namespace { +// This exists to work around a LGTM false positive +static_assert(Roughtime::request_min_size == 1024, "Expected minimum size"); + template< bool B, class T = void > using enable_if_t = typename std::enable_if::type; diff --git a/src/lib/misc/roughtime/roughtime.h b/src/lib/misc/roughtime/roughtime.h index 595e693b9..82d093e6f 100644 --- a/src/lib/misc/roughtime/roughtime.h +++ b/src/lib/misc/roughtime/roughtime.h @@ -20,7 +20,7 @@ class RandomNumberGenerator; namespace Roughtime { -constexpr unsigned request_min_size = 1024; +const unsigned request_min_size = 1024; class BOTAN_PUBLIC_API(2, 13) Roughtime_Error final : public Decoding_Error { @@ -70,7 +70,9 @@ class BOTAN_PUBLIC_API(2, 13) Response final microseconds32 utc_radius() const { return m_utc_radius; } private: - Response(std::array dele, std::array sig, sys_microseconds64 utc_midp, + Response(const std::array& dele, + const std::array& sig, + sys_microseconds64 utc_midp, microseconds32 utc_radius) : m_cert_dele(dele) , m_cert_sig(sig) -- cgit v1.2.3