Remove XALAN_INLINE_INITIALIZATION
Initialise all statics in a standards-conforming way, i.e.
in the translation unit, rather than the header. If header
initialisation is needed, constexpr is the correct way to
do this, but will require C++11.
diff --git a/src/xalanc/Include/GCCDefinitions.hpp b/src/xalanc/Include/GCCDefinitions.hpp
index 6ef2504..4b7bb55 100644
--- a/src/xalanc/Include/GCCDefinitions.hpp
+++ b/src/xalanc/Include/GCCDefinitions.hpp
@@ -33,8 +33,6 @@
-#define XALAN_INLINE_INITIALIZATION
-
#if defined(CYGWIN)
#if defined(WIN32)
#undef WIN32
diff --git a/src/xalanc/Include/HPUXDefinitions.hpp b/src/xalanc/Include/HPUXDefinitions.hpp
index f8dd68f..b501182 100644
--- a/src/xalanc/Include/HPUXDefinitions.hpp
+++ b/src/xalanc/Include/HPUXDefinitions.hpp
@@ -40,7 +40,6 @@
#endif
#define XALAN_POSIX2_AVAILABLE
-#define XALAN_INLINE_INITIALIZATION
diff --git a/src/xalanc/Include/IntelDefinitions.hpp b/src/xalanc/Include/IntelDefinitions.hpp
index 17e3969..2d63ce5 100644
--- a/src/xalanc/Include/IntelDefinitions.hpp
+++ b/src/xalanc/Include/IntelDefinitions.hpp
@@ -34,7 +34,6 @@
#define XALAN_POSIX2_AVAILABLE
-#define XALAN_INLINE_INITIALIZATION
diff --git a/src/xalanc/Include/TRU64Definitions.hpp b/src/xalanc/Include/TRU64Definitions.hpp
index 0f72404..e1240e9 100644
--- a/src/xalanc/Include/TRU64Definitions.hpp
+++ b/src/xalanc/Include/TRU64Definitions.hpp
@@ -36,7 +36,6 @@
// This next line enables standard IO streams.
#define __USE_STD_IOSTREAM
#define XALAN_POSIX2_AVAILABLE
-#define XALAN_INLINE_INITIALIZATION
#define XALAN_NO_REENTRANT_TIME_FUNCTIONS
diff --git a/src/xalanc/Include/VCPPDefinitions.hpp b/src/xalanc/Include/VCPPDefinitions.hpp
index 3ba5f0a..3c2e23b 100644
--- a/src/xalanc/Include/VCPPDefinitions.hpp
+++ b/src/xalanc/Include/VCPPDefinitions.hpp
@@ -36,9 +36,7 @@
#if _MSC_VER >= 1300
- #define XALAN_INLINE_INITIALIZATION
#if !defined(__INTEL_COMPILER)
- #define XALAN_INLINE_INITIALIZATION_IS_DEFINITION_BUG
#if _MSC_VER >= 1400
#define XALAN_AUTO_PTR_REQUIRES_DEFINITION
#define XALAN_USE_WINDOWS_COLLATION
diff --git a/src/xalanc/PlatformSupport/FormatterListener.cpp b/src/xalanc/PlatformSupport/FormatterListener.cpp
index 0324d94..9c3ff7d 100644
--- a/src/xalanc/PlatformSupport/FormatterListener.cpp
+++ b/src/xalanc/PlatformSupport/FormatterListener.cpp
@@ -121,13 +121,8 @@
0
};
-#if !defined(XALAN_INLINE_INITIALIZATION)
const XalanDOMString::size_type FormatterListener::s_piTargetLength = 5;
const XalanDOMString::size_type FormatterListener::s_piDataLength = 3;
-#elif !defined(XALAN_INLINE_INITIALIZATION_IS_DEFINITION_BUG)
-const XalanDOMString::size_type FormatterListener::s_piTargetLength;
-const XalanDOMString::size_type FormatterListener::s_piDataLength;
-#endif
diff --git a/src/xalanc/PlatformSupport/FormatterListener.hpp b/src/xalanc/PlatformSupport/FormatterListener.hpp
index 8f6b8e5..a50687b 100644
--- a/src/xalanc/PlatformSupport/FormatterListener.hpp
+++ b/src/xalanc/PlatformSupport/FormatterListener.hpp
@@ -260,13 +260,8 @@
static const XalanDOMChar s_piData[];
-#if defined(XALAN_INLINE_INITIALIZATION)
- static const XalanDOMString::size_type s_piTargetLength = 5;
- static const XalanDOMString::size_type s_piDataLength = 3;
-#else
static const XalanDOMString::size_type s_piTargetLength;
static const XalanDOMString::size_type s_piDataLength;
-#endif
protected:
diff --git a/src/xalanc/PlatformSupport/Writer.cpp b/src/xalanc/PlatformSupport/Writer.cpp
index 30bca8d..5512658 100644
--- a/src/xalanc/PlatformSupport/Writer.cpp
+++ b/src/xalanc/PlatformSupport/Writer.cpp
@@ -24,11 +24,7 @@
-#if !defined(XALAN_INLINE_INITIALIZATION)
const size_t Writer::npos = ~0u;
-#elif !defined(XALAN_INLINE_INITIALIZATION_IS_DEFINITION_BUG)
-const size_t Writer::npos;
-#endif
diff --git a/src/xalanc/PlatformSupport/Writer.hpp b/src/xalanc/PlatformSupport/Writer.hpp
index 4d3bbdc..433d04b 100644
--- a/src/xalanc/PlatformSupport/Writer.hpp
+++ b/src/xalanc/PlatformSupport/Writer.hpp
@@ -77,11 +77,7 @@
// Output functions
-#if defined(XALAN_INLINE_INITIALIZATION)
- static const size_t npos = ~0u;
-#else
static const size_t npos;
-#endif
/**
* Writes a string
diff --git a/src/xalanc/PlatformSupport/XalanParsedURI.cpp b/src/xalanc/PlatformSupport/XalanParsedURI.cpp
index 9c2bbfb..6f5acec 100644
--- a/src/xalanc/PlatformSupport/XalanParsedURI.cpp
+++ b/src/xalanc/PlatformSupport/XalanParsedURI.cpp
@@ -30,15 +30,6 @@
namespace XALAN_CPP_NAMESPACE {
-#if defined(XALAN_INLINE_INITIALIZATION) && !defined(XALAN_INLINE_INITIALIZATION_IS_DEFINITION_BUG)
-const int XalanParsedURI::d_scheme;
-const int XalanParsedURI::d_authority;
-const int XalanParsedURI::d_query;
-const int XalanParsedURI::d_fragment;
-#endif
-
-
-
/* Merge the components back into a complete URI string */
XalanDOMString& XalanParsedURI::make(XalanDOMString& uri) const
{
diff --git a/src/xalanc/PlatformSupport/XalanParsedURI.hpp b/src/xalanc/PlatformSupport/XalanParsedURI.hpp
index 6979fb4..c3d8a91 100644
--- a/src/xalanc/PlatformSupport/XalanParsedURI.hpp
+++ b/src/xalanc/PlatformSupport/XalanParsedURI.hpp
@@ -44,12 +44,6 @@
// Flags to say if a component is defined. Note that each component may
// be defined but empty, except for the path.
-#if defined(XALAN_INLINE_INITIALIZATION)
- static const int d_scheme = 1;
- static const int d_authority = 2;
- static const int d_query = 4;
- static const int d_fragment = 8;
-#else
enum eComponent
{
d_scheme = 1,
@@ -57,7 +51,6 @@
d_query = 4,
d_fragment = 8
};
-#endif
/**
* Default constructor
diff --git a/src/xalanc/XPath/NodeRefListBase.cpp b/src/xalanc/XPath/NodeRefListBase.cpp
index 2d81cb6..a8a4410 100644
--- a/src/xalanc/XPath/NodeRefListBase.cpp
+++ b/src/xalanc/XPath/NodeRefListBase.cpp
@@ -24,11 +24,7 @@
-#if !defined(XALAN_INLINE_INITIALIZATION)
const NodeRefListBase::size_type NodeRefListBase::npos = ~0u;
-#elif !defined(XALAN_INLINE_INITIALIZATION_IS_DEFINITION_BUG)
-const NodeRefListBase::size_type NodeRefListBase::npos;
-#endif
diff --git a/src/xalanc/XPath/NodeRefListBase.hpp b/src/xalanc/XPath/NodeRefListBase.hpp
index b3893a8..4d971f4 100644
--- a/src/xalanc/XPath/NodeRefListBase.hpp
+++ b/src/xalanc/XPath/NodeRefListBase.hpp
@@ -83,11 +83,7 @@
virtual size_type
indexOf(const XalanNode* theNode) const = 0;
-#if defined(XALAN_INLINE_INITIALIZATION)
- static const size_type npos = ~0u;
-#else
static const size_type npos;
-#endif
protected:
diff --git a/src/xalanc/XPath/XPathExpression.cpp b/src/xalanc/XPath/XPathExpression.cpp
index 2154f98..6d05b23 100644
--- a/src/xalanc/XPath/XPathExpression.cpp
+++ b/src/xalanc/XPath/XPathExpression.cpp
@@ -42,10 +42,6 @@
-#if defined(XALAN_INLINE_INITIALIZATION) && !defined(XALAN_INLINE_INITIALIZATION_IS_DEFINITION_BUG)
-const XPathExpression::TokenQueueSizeType XPathExpression::s_opCodeMapLengthIndex;
-#endif
-
// This is an array which indicates which of the value defined by
diff --git a/src/xalanc/XPath/XPathExpression.hpp b/src/xalanc/XPath/XPathExpression.hpp
index 2466b0b..312411c 100644
--- a/src/xalanc/XPath/XPathExpression.hpp
+++ b/src/xalanc/XPath/XPathExpression.hpp
@@ -709,14 +709,10 @@
* offset from the op code where the length is stored. It will always
* remain one.
*/
-#if defined(XALAN_INLINE_INITIALIZATION)
- static const TokenQueueSizeType s_opCodeMapLengthIndex = 1;
-#else
enum eDummy
{
s_opCodeMapLengthIndex = 1
};
-#endif
explicit
XPathExpression(MemoryManager& theManager);
diff --git a/src/xalanc/XalanDOM/XalanDOMString.cpp b/src/xalanc/XalanDOM/XalanDOMString.cpp
index 6e62c2d..7ceb858 100644
--- a/src/xalanc/XalanDOM/XalanDOMString.cpp
+++ b/src/xalanc/XalanDOM/XalanDOMString.cpp
@@ -32,10 +32,7 @@
const XalanDOMChar XalanDOMString::s_empty = 0;
-#if defined(XALAN_INLINE_INITIALIZATION) && !defined(XALAN_INLINE_INITIALIZATION_IS_DEFINITION_BUG)
-const XalanDOMString::size_type XalanDOMString::npos;
-#endif
-
+const XalanDOMString::size_type XalanDOMString::npos = 0u;
XalanDOMString::XalanDOMString(MemoryManager& theManager) :
diff --git a/src/xalanc/XalanDOM/XalanDOMString.hpp b/src/xalanc/XalanDOM/XalanDOMString.hpp
index 743d935..270b931 100644
--- a/src/xalanc/XalanDOM/XalanDOMString.hpp
+++ b/src/xalanc/XalanDOM/XalanDOMString.hpp
@@ -61,11 +61,7 @@
typedef XalanDOMCharVectorType::reverse_iterator reverse_iterator;
typedef XalanDOMCharVectorType::const_reverse_iterator const_reverse_iterator;
-#if defined(XALAN_INLINE_INITIALIZATION)
- static const size_type npos = ~0u;
-#else
- enum { npos = ~0u };
-#endif
+ static const size_type npos;
XalanDOMString(MemoryManager& theManager XALAN_DEFAULT_CONSTRUCTOR_MEMMGR);