summaryrefslogtreecommitdiff
path: root/store
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2020-11-18 10:24:08 +0100
committerMike Kaganski <mike.kaganski@collabora.com>2020-11-18 15:18:25 +0100
commitd9af7ac4d697be1d520ea751eb7f8fc77a2ca03e (patch)
tree3aadd943bd2df92b355265917a60f75d7d28ccbe /store
parent20bc83ee9e63c0c099ad9962ecc483ec5af88991 (diff)
Replace #if with if constexpr()
This allows to test the actual type, not something unrelated Change-Id: I82d0714f6355fc5ae7bd3205af3472a43f1f1051 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105998 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'store')
-rw-r--r--store/source/storcach.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/store/source/storcach.cxx b/store/source/storcach.cxx
index c3db00d21f84..cefd963813a6 100644
--- a/store/source/storcach.cxx
+++ b/store/source/storcach.cxx
@@ -136,13 +136,14 @@ static int highbit(std::size_t n)
if (n == 0)
return 0;
-#if SAL_TYPES_SIZEOFLONG == 8
- if (n & 0xffffffff00000000ul)
+ if constexpr (sizeof(n) == 8)
{
- k |= 32;
- n >>= 32;
+ if (n & 0xffffffff00000000)
+ {
+ k |= 32;
+ n >>= 32;
+ }
}
-#endif
if (n & 0xffff0000)
{
k |= 16;