You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by rl...@apache.org on 2020/04/01 21:13:11 UTC

[xalan-c] branch master updated: Use -1 as npos value

This is an automated email from the ASF dual-hosted git repository.

rleigh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/xalan-c.git


The following commit(s) were added to refs/heads/master by this push:
     new 8c7eeef  Use -1 as npos value
     new b6a8ca6  Merge pull request #10 from rleigh-codelibre/npos
8c7eeef is described below

commit 8c7eeef41e408fffcd2200e5e346665f953e4dc6
Author: Roger Leigh <rl...@codelibre.net>
AuthorDate: Wed Apr 1 08:11:45 2020 +0100

    Use -1 as npos value
    
    This is to match usage in the standard library.  For unsigned types,
    there will be no change in the effective value.
---
 src/xalanc/PlatformSupport/Writer.cpp  | 2 +-
 src/xalanc/XPath/NodeRefListBase.cpp   | 2 +-
 src/xalanc/XalanDOM/XalanDOMString.cpp | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/xalanc/PlatformSupport/Writer.cpp b/src/xalanc/PlatformSupport/Writer.cpp
index 5512658..1558e8e 100644
--- a/src/xalanc/PlatformSupport/Writer.cpp
+++ b/src/xalanc/PlatformSupport/Writer.cpp
@@ -24,7 +24,7 @@ namespace XALAN_CPP_NAMESPACE {
 
 
 
-const size_t    Writer::npos = ~0u;
+const size_t    Writer::npos = static_cast<size_t>(-1);
 
 
 
diff --git a/src/xalanc/XPath/NodeRefListBase.cpp b/src/xalanc/XPath/NodeRefListBase.cpp
index a8a4410..34cf435 100644
--- a/src/xalanc/XPath/NodeRefListBase.cpp
+++ b/src/xalanc/XPath/NodeRefListBase.cpp
@@ -24,7 +24,7 @@ namespace XALAN_CPP_NAMESPACE {
 
 
 
-const NodeRefListBase::size_type    NodeRefListBase::npos = ~0u;
+const NodeRefListBase::size_type    NodeRefListBase::npos = static_cast<NodeRefListBase::size_type>(-1);
 
 
 
diff --git a/src/xalanc/XalanDOM/XalanDOMString.cpp b/src/xalanc/XalanDOM/XalanDOMString.cpp
index d4342d6..138d1f0 100644
--- a/src/xalanc/XalanDOM/XalanDOMString.cpp
+++ b/src/xalanc/XalanDOM/XalanDOMString.cpp
@@ -32,7 +32,7 @@ namespace XALAN_CPP_NAMESPACE {
 
 const XalanDOMChar  XalanDOMString::s_empty = 0;
 
-const XalanDOMString::size_type  XalanDOMString::npos = ~0u;
+const XalanDOMString::size_type  XalanDOMString::npos = static_cast<XalanDOMString::size_type>(-1);
 
 
 XalanDOMString::XalanDOMString(MemoryManager&  theManager) :


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xalan.apache.org
For additional commands, e-mail: commits-help@xalan.apache.org