From 2009ecbeb1b6b4c771c79ea695e34e7bf4e10965 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sat, 28 Sep 2024 19:33:58 +0200 Subject: [PATCH] cid#1607257 Overflowed constant this is a false positve, but perhaps we can help coverity work it out properly with some constexpr Change-Id: I8398153d6678585dacf4acaf7081ec32094bcda6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174150 Tested-by: Jenkins Reviewed-by: Noel Grandin --- store/source/storcach.cxx | 2 +- store/source/storcach.hxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/store/source/storcach.cxx b/store/source/storcach.cxx index bb4e34b5af27..dc030fa1c809 100644 --- a/store/source/storcach.cxx +++ b/store/source/storcach.cxx @@ -123,7 +123,7 @@ void EntryCache::destroy (Entry * entry) } // highbit():= log2() + 1 (complexity O(1)) -static int highbit(std::size_t n) +static constexpr int highbit(std::size_t n) { int k = 1; diff --git a/store/source/storcach.hxx b/store/source/storcach.hxx index b787248349ac..ebdbd392ee18 100644 --- a/store/source/storcach.hxx +++ b/store/source/storcach.hxx @@ -39,7 +39,7 @@ struct Entry; class PageCache : public store::OStoreObject { - static size_t const theTableSize = 32; + static size_t constexpr theTableSize = 32; static_assert((theTableSize & (theTableSize-1)) == 0, "table size should be a power of 2"); Entry ** m_hash_table;