From 572681bfc7bb141c9f16694df05a505e9d9f1a88 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Sat, 25 Jan 2020 12:11:26 +0100 Subject: 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 --- sal/rtl/alloc_arena.hxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'sal/rtl') 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 { -- cgit