summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-03-02 18:24:40 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-03-03 06:47:35 +0000
commitba423579255848440318d6c468a604914901779b (patch)
tree7c4bc01a2c7210bca3e8a19a012b15312f37b588 /include
parentuse SvxExtNumType in SvxNumberType (diff)
downloadcore-ba423579255848440318d6c468a604914901779b.tar.gz
core-ba423579255848440318d6c468a604914901779b.zip
Remove uses of SAL_CONSTEXPR in LIBO_INTERNAL_ONLY
Change-Id: I9a7dc7c83302b3361f056fcf6636bbba7672f15f Reviewed-on: https://gerrit.libreoffice.org/34840 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/o3tl/typed_flags_set.hxx55
-rw-r--r--include/osl/time.h4
-rw-r--r--include/rtl/stringutils.hxx14
-rw-r--r--include/rtl/ustring.hxx2
-rw-r--r--include/svx/dlgutil.hxx4
-rw-r--r--include/vcl/scheduler.hxx4
6 files changed, 35 insertions, 48 deletions
diff --git a/include/o3tl/typed_flags_set.hxx b/include/o3tl/typed_flags_set.hxx
index dfb196a582e1..09f0b61d8c01 100644
--- a/include/o3tl/typed_flags_set.hxx
+++ b/include/o3tl/typed_flags_set.hxx
@@ -32,14 +32,14 @@ namespace o3tl {
namespace detail {
-template<typename T> inline SAL_CONSTEXPR
+template<typename T> constexpr
typename std::enable_if<std::is_signed<T>::value, bool>::type isNonNegative(
T value)
{
return value >= 0;
}
-template<typename T> inline SAL_CONSTEXPR
+template<typename T> constexpr
typename std::enable_if<std::is_unsigned<T>::value, bool>::type isNonNegative(T)
{
return true;
@@ -73,8 +73,7 @@ struct is_typed_flags {
public:
typedef is_typed_flags Unwrapped;
- explicit SAL_CONSTEXPR Wrap(
- typename std::underlying_type<E>::type value):
+ explicit constexpr Wrap(typename std::underlying_type<E>::type value):
value_(value)
{
#if HAVE_CXX14_CONSTEXPR
@@ -87,13 +86,13 @@ struct is_typed_flags {
#endif
}
- SAL_CONSTEXPR operator E() const { return static_cast<E>(value_); }
+ constexpr operator E() const { return static_cast<E>(value_); }
- explicit SAL_CONSTEXPR operator typename std::underlying_type<E>::type()
+ explicit constexpr operator typename std::underlying_type<E>::type()
const
{ return value_; }
- explicit SAL_CONSTEXPR operator bool() const { return value_ != 0; }
+ explicit constexpr operator bool() const { return value_ != 0; }
private:
typename std::underlying_type<E>::type value_;
@@ -105,7 +104,7 @@ struct is_typed_flags {
}
template<typename E>
-inline SAL_CONSTEXPR typename o3tl::typed_flags<E>::Wrap operator ~(E rhs) {
+constexpr typename o3tl::typed_flags<E>::Wrap operator ~(E rhs) {
#if HAVE_CXX14_CONSTEXPR
assert(
o3tl::detail::isNonNegative(
@@ -116,8 +115,7 @@ inline SAL_CONSTEXPR typename o3tl::typed_flags<E>::Wrap operator ~(E rhs) {
& ~static_cast<typename std::underlying_type<E>::type>(rhs));
}
-template<typename E>
-inline SAL_CONSTEXPR typename o3tl::typed_flags<E>::Wrap operator ~(
+template<typename E> constexpr typename o3tl::typed_flags<E>::Wrap operator ~(
typename o3tl::typed_flags<E>::Wrap rhs)
{
return static_cast<typename o3tl::typed_flags<E>::Wrap>(
@@ -125,8 +123,7 @@ inline SAL_CONSTEXPR typename o3tl::typed_flags<E>::Wrap operator ~(
& ~static_cast<typename std::underlying_type<E>::type>(rhs));
}
-template<typename E>
-inline SAL_CONSTEXPR typename o3tl::typed_flags<E>::Wrap operator ^(
+template<typename E> constexpr typename o3tl::typed_flags<E>::Wrap operator ^(
E lhs, E rhs)
{
#if HAVE_CXX14_CONSTEXPR
@@ -142,8 +139,7 @@ inline SAL_CONSTEXPR typename o3tl::typed_flags<E>::Wrap operator ^(
^ static_cast<typename std::underlying_type<E>::type>(rhs));
}
-template<typename E>
-inline SAL_CONSTEXPR typename o3tl::typed_flags<E>::Wrap operator ^(
+template<typename E> constexpr typename o3tl::typed_flags<E>::Wrap operator ^(
E lhs, typename o3tl::typed_flags<E>::Wrap rhs)
{
#if HAVE_CXX14_CONSTEXPR
@@ -156,8 +152,7 @@ inline SAL_CONSTEXPR typename o3tl::typed_flags<E>::Wrap operator ^(
^ static_cast<typename std::underlying_type<E>::type>(rhs));
}
-template<typename E>
-inline SAL_CONSTEXPR typename o3tl::typed_flags<E>::Wrap operator ^(
+template<typename E> constexpr typename o3tl::typed_flags<E>::Wrap operator ^(
typename o3tl::typed_flags<E>::Wrap lhs, E rhs)
{
#if HAVE_CXX14_CONSTEXPR
@@ -170,8 +165,7 @@ inline SAL_CONSTEXPR typename o3tl::typed_flags<E>::Wrap operator ^(
^ static_cast<typename std::underlying_type<E>::type>(rhs));
}
-template<typename W>
-inline SAL_CONSTEXPR
+template<typename W> constexpr
typename o3tl::typed_flags<typename W::Unwrapped::Self>::Wrap operator ^(
W lhs, W rhs)
{
@@ -185,9 +179,7 @@ typename o3tl::typed_flags<typename W::Unwrapped::Self>::Wrap operator ^(
}
template<typename E>
-inline SAL_CONSTEXPR typename o3tl::typed_flags<E>::Wrap operator &(
- E lhs, E rhs)
-{
+constexpr typename o3tl::typed_flags<E>::Wrap operator &(E lhs, E rhs) {
#if HAVE_CXX14_CONSTEXPR
assert(
o3tl::detail::isNonNegative(
@@ -201,8 +193,7 @@ inline SAL_CONSTEXPR typename o3tl::typed_flags<E>::Wrap operator &(
& static_cast<typename std::underlying_type<E>::type>(rhs));
}
-template<typename E>
-inline SAL_CONSTEXPR typename o3tl::typed_flags<E>::Wrap operator &(
+template<typename E> constexpr typename o3tl::typed_flags<E>::Wrap operator &(
E lhs, typename o3tl::typed_flags<E>::Wrap rhs)
{
#if HAVE_CXX14_CONSTEXPR
@@ -215,8 +206,7 @@ inline SAL_CONSTEXPR typename o3tl::typed_flags<E>::Wrap operator &(
& static_cast<typename std::underlying_type<E>::type>(rhs));
}
-template<typename E>
-inline SAL_CONSTEXPR typename o3tl::typed_flags<E>::Wrap operator &(
+template<typename E> constexpr typename o3tl::typed_flags<E>::Wrap operator &(
typename o3tl::typed_flags<E>::Wrap lhs, E rhs)
{
#if HAVE_CXX14_CONSTEXPR
@@ -229,8 +219,7 @@ inline SAL_CONSTEXPR typename o3tl::typed_flags<E>::Wrap operator &(
& static_cast<typename std::underlying_type<E>::type>(rhs));
}
-template<typename W>
-inline SAL_CONSTEXPR
+template<typename W> constexpr
typename o3tl::typed_flags<typename W::Unwrapped::Self>::Wrap operator &(
W lhs, W rhs)
{
@@ -244,7 +233,7 @@ typename o3tl::typed_flags<typename W::Unwrapped::Self>::Wrap operator &(
}
template<typename E>
-inline SAL_CONSTEXPR typename o3tl::typed_flags<E>::Wrap operator |(E lhs, E rhs) {
+constexpr typename o3tl::typed_flags<E>::Wrap operator |(E lhs, E rhs) {
#if HAVE_CXX14_CONSTEXPR
assert(
o3tl::detail::isNonNegative(
@@ -258,8 +247,7 @@ inline SAL_CONSTEXPR typename o3tl::typed_flags<E>::Wrap operator |(E lhs, E rhs
| static_cast<typename std::underlying_type<E>::type>(rhs));
}
-template<typename E>
-inline SAL_CONSTEXPR typename o3tl::typed_flags<E>::Wrap operator |(
+template<typename E> constexpr typename o3tl::typed_flags<E>::Wrap operator |(
E lhs, typename o3tl::typed_flags<E>::Wrap rhs)
{
#if HAVE_CXX14_CONSTEXPR
@@ -272,8 +260,7 @@ inline SAL_CONSTEXPR typename o3tl::typed_flags<E>::Wrap operator |(
| static_cast<typename std::underlying_type<E>::type>(rhs));
}
-template<typename E>
-inline SAL_CONSTEXPR typename o3tl::typed_flags<E>::Wrap operator |(
+template<typename E> constexpr typename o3tl::typed_flags<E>::Wrap operator |(
typename o3tl::typed_flags<E>::Wrap lhs, E rhs)
{
#if HAVE_CXX14_CONSTEXPR
@@ -286,8 +273,8 @@ inline SAL_CONSTEXPR typename o3tl::typed_flags<E>::Wrap operator |(
| static_cast<typename std::underlying_type<E>::type>(rhs));
}
-template<typename W>
-inline SAL_CONSTEXPR typename o3tl::typed_flags<typename W::Unwrapped::Self>::Wrap operator |(
+template<typename W> constexpr
+typename o3tl::typed_flags<typename W::Unwrapped::Self>::Wrap operator |(
W lhs, W rhs)
{
return static_cast<W>(
diff --git a/include/osl/time.h b/include/osl/time.h
index 44f9af817759..965675301ef6 100644
--- a/include/osl/time.h
+++ b/include/osl/time.h
@@ -44,10 +44,10 @@
struct TimeValue {
TimeValue() = default;
- SAL_CONSTEXPR TimeValue(sal_uInt32 seconds, sal_uInt32 nanoseconds):
+ constexpr TimeValue(sal_uInt32 seconds, sal_uInt32 nanoseconds):
Seconds(seconds), Nanosec(nanoseconds) {}
- template<typename Rep, typename Period> SAL_CONSTEXPR
+ template<typename Rep, typename Period> constexpr
TimeValue(std::chrono::duration<Rep, Period> const & duration):
Seconds(
std::chrono::duration_cast<std::chrono::nanoseconds>(
diff --git a/include/rtl/stringutils.hxx b/include/rtl/stringutils.hxx
index dadbda61ec97..a88f5be861fd 100644
--- a/include/rtl/stringutils.hxx
+++ b/include/rtl/stringutils.hxx
@@ -72,7 +72,7 @@ namespace rtl
@since LibreOffice 5.0
*/
struct SAL_WARN_UNUSED OUStringLiteral1_ {
- SAL_CONSTEXPR OUStringLiteral1_(sal_Unicode theC): c(theC) {}
+ constexpr OUStringLiteral1_(sal_Unicode theC): c(theC) {}
sal_Unicode const c;
};
#if defined _MSC_VER && _MSC_VER <= 1900 && !defined __clang__
@@ -173,9 +173,9 @@ struct ConstCharArrayDetector< const char[ N ], T >
template<std::size_t N, typename T>
struct ConstCharArrayDetector<sal_Unicode const [N], T> {
using TypeUtf16 = T;
- static SAL_CONSTEXPR bool const ok = true;
- static SAL_CONSTEXPR std::size_t const length = N - 1;
- static SAL_CONSTEXPR sal_Unicode const * toPointer(
+ static constexpr bool const ok = true;
+ static constexpr std::size_t const length = N - 1;
+ static constexpr sal_Unicode const * toPointer(
sal_Unicode const (& literal)[N])
{ return literal; }
};
@@ -189,9 +189,9 @@ template<typename T> struct ConstCharArrayDetector<
T>
{
using TypeUtf16 = T;
- static SAL_CONSTEXPR bool const ok = true;
- static SAL_CONSTEXPR std::size_t const length = 1;
- static SAL_CONSTEXPR sal_Unicode const * toPointer(
+ static constexpr bool const ok = true;
+ static constexpr std::size_t const length = 1;
+ static constexpr sal_Unicode const * toPointer(
OUStringLiteral1_ const & literal)
{ return &literal.c; }
};
diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx
index eed067c1b754..1bc66d3d8ac2 100644
--- a/include/rtl/ustring.hxx
+++ b/include/rtl/ustring.hxx
@@ -70,7 +70,7 @@ This class is not part of public API and is meant to be used only in LibreOffice
*/
struct SAL_WARN_UNUSED OUStringLiteral
{
- template<typename T> SAL_CONSTEXPR OUStringLiteral(
+ template<typename T> constexpr OUStringLiteral(
T & literal,
typename libreoffice_internal::ConstCharArrayDetector<
T, libreoffice_internal::Dummy>::Type
diff --git a/include/svx/dlgutil.hxx b/include/svx/dlgutil.hxx
index 284d3554cdbb..59136e6fe487 100644
--- a/include/svx/dlgutil.hxx
+++ b/include/svx/dlgutil.hxx
@@ -33,8 +33,8 @@ SVX_DLLPUBLIC FieldUnit GetModuleFieldUnit( const SfxItemSet& );
SVX_DLLPUBLIC FieldUnit GetModuleFieldUnit();
SVX_DLLPUBLIC bool GetApplyCharUnit( const SfxItemSet& );
-SAL_CONSTEXPR DrawModeFlags const OUTPUT_DRAWMODE_COLOR = DrawModeFlags::Default;
-SAL_CONSTEXPR DrawModeFlags const OUTPUT_DRAWMODE_CONTRAST = DrawModeFlags::SettingsLine | DrawModeFlags::SettingsFill | DrawModeFlags::SettingsText | DrawModeFlags::SettingsGradient;
+constexpr DrawModeFlags OUTPUT_DRAWMODE_COLOR = DrawModeFlags::Default;
+constexpr DrawModeFlags OUTPUT_DRAWMODE_CONTRAST = DrawModeFlags::SettingsLine | DrawModeFlags::SettingsFill | DrawModeFlags::SettingsText | DrawModeFlags::SettingsGradient;
#endif
diff --git a/include/vcl/scheduler.hxx b/include/vcl/scheduler.hxx
index d504e28309e4..b4ed9e988ec8 100644
--- a/include/vcl/scheduler.hxx
+++ b/include/vcl/scheduler.hxx
@@ -33,8 +33,8 @@ protected:
static void ImplStartTimer ( sal_uInt64 nMS, bool bForce = false );
public:
- static const SAL_CONSTEXPR sal_uInt64 ImmediateTimeoutMs = 1;
- static const SAL_CONSTEXPR sal_uInt64 InfiniteTimeoutMs = 1000 * 60 * 60 * 24; // 1 day
+ static constexpr sal_uInt64 ImmediateTimeoutMs = 1;
+ static constexpr sal_uInt64 InfiniteTimeoutMs = 1000 * 60 * 60 * 24; // 1 day
static void ImplDeInitScheduler();