summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-01-25 12:11:26 +0100
committerStephan Bergmann <sbergman@redhat.com>2020-01-25 13:04:17 +0100
commit572681bfc7bb141c9f16694df05a505e9d9f1a88 (patch)
tree2e3af2a5a6f12fe788817227534028195fed7555 /sal
parent8eeac03bcafac6b2a4984ad70d0694cad01d5615 (diff)
Change some #define to constexpr
...plus loplugin:unnecessaryparen fallout in sw/source/uibase/docvw/edtwin.cxx. Each of the files contained at least one #define that would have caused warnings with upcoming loplugin:unsignedcompare. For consistency, I changed all #defines in those files (using a variable of a specific type if the original #define used a cast to that type, otherwise using 'auto'). Change-Id: I66f71b2d83394c9dc6952ae19df774cdd4d0b76a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87374 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sal')
-rw-r--r--sal/rtl/alloc_arena.hxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/sal/rtl/alloc_arena.hxx b/sal/rtl/alloc_arena.hxx
index 7da1c532e30e..7226ef3f111a 100644
--- a/sal/rtl/alloc_arena.hxx
+++ b/sal/rtl/alloc_arena.hxx
@@ -39,10 +39,10 @@ struct rtl_arena_stat_type
/** rtl_arena_segment_type
* @internal
*/
-#define RTL_ARENA_SEGMENT_TYPE_HEAD (sal_Size(0x01))
-#define RTL_ARENA_SEGMENT_TYPE_SPAN (sal_Size(0x02))
-#define RTL_ARENA_SEGMENT_TYPE_FREE (sal_Size(0x04))
-#define RTL_ARENA_SEGMENT_TYPE_USED (sal_Size(0x08))
+constexpr sal_Size RTL_ARENA_SEGMENT_TYPE_HEAD = 0x01;
+constexpr sal_Size RTL_ARENA_SEGMENT_TYPE_SPAN = 0x02;
+constexpr sal_Size RTL_ARENA_SEGMENT_TYPE_FREE = 0x04;
+constexpr sal_Size RTL_ARENA_SEGMENT_TYPE_USED = 0x08;
struct rtl_arena_segment_type
{
@@ -63,10 +63,10 @@ struct rtl_arena_segment_type
/** rtl_arena_type
* @internal
*/
-#define RTL_ARENA_FREELIST_SIZE (sizeof(void*) * 8)
-#define RTL_ARENA_HASH_SIZE 64
+constexpr auto RTL_ARENA_FREELIST_SIZE = sizeof(void*) * 8;
+constexpr auto RTL_ARENA_HASH_SIZE = 64;
-#define RTL_ARENA_FLAG_RESCALE 1 /* within hash rescale operation */
+constexpr auto RTL_ARENA_FLAG_RESCALE = 1; /* within hash rescale operation */
struct rtl_arena_st
{