Boost logo

Boost-Commit :

From: RaoulGough_at_[hidden]
Date: 2008-05-18 11:59:20


Author: raoulgough
Date: 2008-05-18 11:59:20 EDT (Sun, 18 May 2008)
New Revision: 45491
URL: http://svn.boost.org/trac/boost/changeset/45491

Log:
Rename slice.cpp to iv2slice.cpp to avoid object-file nameclash on trunk
Added:
   sandbox/python_indexing_v2/libs/python/src/indexing_v2/iv2slice.cpp
      - copied, changed from r45489, /sandbox/python_indexing_v2/libs/python/src/indexing_v2/slice.cpp
Removed:
   sandbox/python_indexing_v2/libs/python/src/indexing_v2/slice.cpp
Text files modified:
   sandbox/python_indexing_v2/libs/python/src/indexing_v2/iv2slice.cpp | 1 +
   1 files changed, 1 insertions(+), 0 deletions(-)

Copied: sandbox/python_indexing_v2/libs/python/src/indexing_v2/iv2slice.cpp (from r45489, /sandbox/python_indexing_v2/libs/python/src/indexing_v2/slice.cpp)
==============================================================================
--- /sandbox/python_indexing_v2/libs/python/src/indexing_v2/slice.cpp (original)
+++ sandbox/python_indexing_v2/libs/python/src/indexing_v2/iv2slice.cpp 2008-05-18 11:59:20 EDT (Sun, 18 May 2008)
@@ -10,6 +10,7 @@
 // =======
 // 2003-09-10 rmg File creation
 // 2008-05-18 rmg Rename indexing subdirectory to indexing_v2
+// 2008-05-18 rmg Rename iv2slice.cpp to avoid object-file nameclash
 //
 // $Id$
 //

Deleted: sandbox/python_indexing_v2/libs/python/src/indexing_v2/slice.cpp
==============================================================================
--- sandbox/python_indexing_v2/libs/python/src/indexing_v2/slice.cpp 2008-05-18 11:59:20 EDT (Sun, 18 May 2008)
+++ (empty file)
@@ -1,77 +0,0 @@
-// Module slice.cpp
-//
-// Copyright (c) 2003, 2008 Raoul M. Gough
-//
-// Use, modification and distribution is subject to the Boost Software
-// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy
-// at http://www.boost.org/LICENSE_1_0.txt)
-//
-// History
-// =======
-// 2003-09-10 rmg File creation
-// 2008-05-18 rmg Rename indexing subdirectory to indexing_v2
-//
-// $Id$
-//
-
-#include <boost/python/suite/indexing_v2/slice.hpp>
-#include <algorithm>
-
-/////////////////////////////////////////////////////////////////////////////
-// MSVC6 workarounds
-/////////////////////////////////////////////////////////////////////////////
-
-#if defined (BOOST_NO_MEMBER_TEMPLATES)
-namespace boost { namespace python { namespace indexing_v2 {
- slice::slice (::boost::python::handle<> const &p) : object (p) { }
- slice::slice (::boost::python::detail::borrowed_reference p) : object (p) { }
- slice::slice (::boost::python::detail::new_reference p) : object (p) { }
- slice::slice (::boost::python::detail::new_non_null_reference p) : object (p) { }
-} } }
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// slice copy constructor
-/////////////////////////////////////////////////////////////////////////////
-
-boost::python::indexing_v2::slice::slice (slice const &copy)
- : object (copy)
-{
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// integer_slice constructor
-/////////////////////////////////////////////////////////////////////////////
-
-boost::python::indexing_v2::integer_slice
-::integer_slice (slice const &sl, index_type length)
- : m_slice (sl)
- // Leave index members uninitialized
-{
- PySlice_GetIndices(
- reinterpret_cast<PySliceObject *> (m_slice.ptr()),
- length,
- &m_start,
- &m_stop,
- &m_step);
-
- if (m_step == 0)
- {
- // Can happen with Python prior to 2.3
- PyErr_SetString (PyExc_ValueError, "slice step cannot be zero");
- boost::python::throw_error_already_set ();
- }
-
- m_start = std::max (0, std::min (length, m_start));
- m_stop = std::max (0, std::min (length, m_stop));
- m_direction = (m_step > 0) ? 1 : -1;
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// Check if an index is within the range of this integer_slice
-/////////////////////////////////////////////////////////////////////////////
-
-bool boost::python::indexing_v2::integer_slice::in_range (index_type index)
-{
- return ((m_stop - index) * m_direction) > 0;
-}


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk