summaryrefslogtreecommitdiff
path: root/include/store
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 /include/store
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 'include/store')
-rw-r--r--include/store/types.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/include/store/types.h b/include/store/types.h
index d31482fd946c..309456c3cce8 100644
--- a/include/store/types.h
+++ b/include/store/types.h
@@ -29,29 +29,29 @@ extern "C" {
/** PageSize (recommended) default.
@see store_openFile()
*/
-#define STORE_DEFAULT_PAGESIZE ((sal_uInt16)0x0400)
+constexpr sal_uInt16 STORE_DEFAULT_PAGESIZE = 0x0400;
/** PageSize (enforced) limits.
@see store_openFile()
*/
-#define STORE_MINIMUM_PAGESIZE ((sal_uInt16)0x0200)
-#define STORE_MAXIMUM_PAGESIZE ((sal_uInt16)0x8000)
+constexpr sal_uInt16 STORE_MINIMUM_PAGESIZE = 0x0200;
+constexpr sal_uInt16 STORE_MAXIMUM_PAGESIZE = 0x8000;
/** NameSize (enforced) limit.
@see any param pName
@see store_E_NameTooLong
*/
-#define STORE_MAXIMUM_NAMESIZE 256
+constexpr auto STORE_MAXIMUM_NAMESIZE = 256;
/** Attributes (predefined).
@see store_attrib()
*/
-#define STORE_ATTRIB_ISLINK ((sal_uInt32)0x10000000)
-#define STORE_ATTRIB_ISDIR ((sal_uInt32)0x20000000)
-#define STORE_ATTRIB_ISFILE ((sal_uInt32)0x40000000)
+constexpr sal_uInt32 STORE_ATTRIB_ISLINK = 0x10000000;
+constexpr sal_uInt32 STORE_ATTRIB_ISDIR = 0x20000000;
+constexpr sal_uInt32 STORE_ATTRIB_ISFILE = 0x40000000;
/** Access Mode enumeration.