diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2024-09-28 19:33:58 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-09-29 09:05:06 +0200 |
commit | 2009ecbeb1b6b4c771c79ea695e34e7bf4e10965 (patch) | |
tree | 73402786f863b04e18d6c4bc3a25dd40ee55b6d5 | |
parent | df389675fc1e6c4f620b6769cc70c9c3b794175a (diff) |
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 <noel.grandin@collabora.co.uk>
-rw-r--r-- | store/source/storcach.cxx | 2 | ||||
-rw-r--r-- | 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; |