summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2021-03-09 12:53:36 +0100
committerJohnny Willemsen <jwillemsen@remedy.nl>2021-03-09 12:53:36 +0100
commit60d97734bef3939bb7ed54170fbcf9a1b459b496 (patch)
tree08c593473d49b9d271475a8b44cc8ce1293194f2
parent710e551540f9d1a24c7808ae0172ddce2e39f717 (diff)
downloadATCD-60d97734bef3939bb7ed54170fbcf9a1b459b496.tar.gz
Make use of constexpr instead of const
* ACE/ace/CDR_Base.cpp: * ACE/ace/Configuration.cpp: * ACE/ace/ETCL/ETCL_l.cpp: * ACE/ace/OS_NS_time.h: * ACE/ace/OS_NS_time.inl: * ACE/ace/UTF16_Encoding_Converter.cpp: * ACE/ace/Vector_T.h:
-rw-r--r--ACE/ace/CDR_Base.cpp7
-rw-r--r--ACE/ace/Configuration.cpp2
-rw-r--r--ACE/ace/ETCL/ETCL_l.cpp1
-rw-r--r--ACE/ace/OS_NS_time.h6
-rw-r--r--ACE/ace/OS_NS_time.inl2
-rw-r--r--ACE/ace/UTF16_Encoding_Converter.cpp22
-rw-r--r--ACE/ace/Vector_T.h2
7 files changed, 19 insertions, 23 deletions
diff --git a/ACE/ace/CDR_Base.cpp b/ACE/ace/CDR_Base.cpp
index 05312ecfd61..cf3a56904c5 100644
--- a/ACE/ace/CDR_Base.cpp
+++ b/ACE/ace/CDR_Base.cpp
@@ -22,14 +22,11 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
#if defined (NONNATIVE_LONGDOUBLE)
-static const ACE_INT16 max_eleven_bit = 0x3ff;
-static const ACE_INT16 max_fifteen_bit = 0x3fff;
+static constexpr ACE_INT16 max_eleven_bit = 0x3ff;
+static constexpr ACE_INT16 max_fifteen_bit = 0x3fff;
#endif /* NONNATIVE_LONGDOUBLE */
-//
// See comments in CDR_Base.inl about optimization cases for swap_XX_array.
-//
-
void
ACE_CDR::swap_2_array (char const * orig, char* target, size_t n)
{
diff --git a/ACE/ace/Configuration.cpp b/ACE/ace/Configuration.cpp
index 9242671776b..b0af75777c3 100644
--- a/ACE/ace/Configuration.cpp
+++ b/ACE/ace/Configuration.cpp
@@ -423,7 +423,7 @@ ACE_Configuration::operator!= (const ACE_Configuration& rhs) const
#if defined (ACE_WIN32) && !defined (ACE_LACKS_WIN32_REGISTRY)
-static const int ACE_DEFAULT_BUFSIZE = 256;
+static constexpr int ACE_DEFAULT_BUFSIZE = 256;
static const ACE_TCHAR *temp_name (const ACE_TCHAR *name)
{
diff --git a/ACE/ace/ETCL/ETCL_l.cpp b/ACE/ace/ETCL/ETCL_l.cpp
index 05f062af484..237c26c934a 100644
--- a/ACE/ace/ETCL/ETCL_l.cpp
+++ b/ACE/ace/ETCL/ETCL_l.cpp
@@ -462,7 +462,6 @@ ACE_END_VERSIONED_NAMESPACE_DECL
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
static const char* extract_string(char*);
-//static const char * extract_string(char*);
#define YY_LEX_DEBUG
diff --git a/ACE/ace/OS_NS_time.h b/ACE/ace/OS_NS_time.h
index 4e204c63b7b..6b115e6bc61 100644
--- a/ACE/ace/OS_NS_time.h
+++ b/ACE/ace/OS_NS_time.h
@@ -35,9 +35,9 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
// Type-safe, and unsigned.
-static const ACE_UINT32 ACE_U_ONE_SECOND_IN_MSECS = 1000U;
-static const ACE_UINT32 ACE_U_ONE_SECOND_IN_USECS = 1000000U;
-static const ACE_UINT32 ACE_U_ONE_SECOND_IN_NSECS = 1000000000U;
+static constexpr ACE_UINT32 ACE_U_ONE_SECOND_IN_MSECS = 1000U;
+static constexpr ACE_UINT32 ACE_U_ONE_SECOND_IN_USECS = 1000000U;
+static constexpr ACE_UINT32 ACE_U_ONE_SECOND_IN_NSECS = 1000000000U;
/// Helper for the ACE_OS::timezone() function
/**
diff --git a/ACE/ace/OS_NS_time.inl b/ACE/ace/OS_NS_time.inl
index 0e265607231..fee739324e7 100644
--- a/ACE/ace/OS_NS_time.inl
+++ b/ACE/ace/OS_NS_time.inl
@@ -84,7 +84,7 @@ ACE_OS::clock_settime (clockid_t clockid, const struct timespec *ts)
}
// Magic number declaration and definition for ctime and ctime_r ()
-static const int ctime_buf_size = 26;
+static constexpr int ctime_buf_size = 26;
ACE_INLINE ACE_TCHAR *
ACE_OS::ctime (const time_t *t)
diff --git a/ACE/ace/UTF16_Encoding_Converter.cpp b/ACE/ace/UTF16_Encoding_Converter.cpp
index 941ab11b24e..b1455d3b5f9 100644
--- a/ACE/ace/UTF16_Encoding_Converter.cpp
+++ b/ACE/ace/UTF16_Encoding_Converter.cpp
@@ -30,17 +30,17 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-static const ACE_UINT32 halfShift = 10;
-static const ACE_UINT32 halfBase = 0x00010000;
-static const ACE_UINT32 halfMask = 0x000003FF;
-
-static const ACE_UINT32 UNI_SUR_HIGH_START = 0x0000D800;
-static const ACE_UINT32 UNI_SUR_HIGH_END = 0x0000DBFF;
-static const ACE_UINT32 UNI_SUR_LOW_START = 0x0000DC00;
-static const ACE_UINT32 UNI_SUR_LOW_END = 0x0000DFFF;
-static const ACE_UINT32 UNI_REPLACEMENT_CHAR = 0x0000FFFD;
-static const ACE_UINT32 UNI_MAX_BMP = 0x0000FFFF;
-static const ACE_UINT32 UNI_MAX_UTF16 = 0x0010FFFF;
+static constexpr ACE_UINT32 halfShift = 10;
+static constexpr ACE_UINT32 halfBase = 0x00010000;
+static constexpr ACE_UINT32 halfMask = 0x000003FF;
+
+static constexpr ACE_UINT32 UNI_SUR_HIGH_START = 0x0000D800;
+static constexpr ACE_UINT32 UNI_SUR_HIGH_END = 0x0000DBFF;
+static constexpr ACE_UINT32 UNI_SUR_LOW_START = 0x0000DC00;
+static constexpr ACE_UINT32 UNI_SUR_LOW_END = 0x0000DFFF;
+static constexpr ACE_UINT32 UNI_REPLACEMENT_CHAR = 0x0000FFFD;
+static constexpr ACE_UINT32 UNI_MAX_BMP = 0x0000FFFF;
+static constexpr ACE_UINT32 UNI_MAX_UTF16 = 0x0010FFFF;
// Once the bits are split out into bytes of UTF-8, this is a mask OR-ed
// into the first byte, depending on how many bytes follow. There are
diff --git a/ACE/ace/Vector_T.h b/ACE/ace/Vector_T.h
index 4734ea8c0e5..e4cf710602e 100644
--- a/ACE/ace/Vector_T.h
+++ b/ACE/ace/Vector_T.h
@@ -25,7 +25,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
/*
* Default size for an ACE_Vector.
*/
-static const size_t ACE_VECTOR_DEFAULT_SIZE = 32;
+static constexpr size_t ACE_VECTOR_DEFAULT_SIZE = 32;
// Forward declaration.
template <class T, size_t DEFAULT_SIZE> class ACE_Vector_Iterator;