Skip to content

Commit cbe6de2

Browse files
author
Ralf W. Grosse-Kunstleve
committed
fixes to avoid EDG 245 warnings (by Jonathan Brandmeyer)
[SVN r24130]
1 parent 4885d65 commit cbe6de2

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

include/boost/python/suite/indexing/detail/indexing_suite_detail.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# include <boost/scoped_ptr.hpp>
1212
# include <boost/get_pointer.hpp>
1313
# include <boost/detail/binary_search.hpp>
14+
# include <boost/cast.hpp>
1415
# include <vector>
1516
# include <map>
1617
#include <iostream>
@@ -569,7 +570,7 @@ namespace boost { namespace python { namespace detail {
569570

570571
static void
571572
base_get_slice_data(
572-
Container& container, PySliceObject* slice, Index& from, Index& to)
573+
Container& container, PySliceObject* slice, Index& from_, Index& to_)
573574
{
574575
if (Py_None != slice->step) {
575576
PyErr_SetString( PyExc_IndexError, "slice step size not supported.");
@@ -579,34 +580,33 @@ namespace boost { namespace python { namespace detail {
579580
Index min_index = DerivedPolicies::get_min_index(container);
580581
Index max_index = DerivedPolicies::get_max_index(container);
581582

582-
583583
if (Py_None == slice->start) {
584-
from = min_index;
584+
from_ = min_index;
585585
}
586586
else {
587-
from = extract<long>( slice->start);
587+
long from = extract<long>( slice->start);
588588
if (from < 0) // Negative slice index
589589
from += max_index;
590590
if (from < 0) // Clip lower bounds to zero
591591
from = 0;
592592
if (from > max_index) // Clip upper bounds to max_index.
593593
from = max_index;
594-
594+
from_ = boost::numeric_cast<Index>(from);
595595
}
596596

597597
if (Py_None == slice->stop) {
598-
to = DerivedPolicies::get_max_index(container);
598+
to_ = max_index;
599599
}
600600
else {
601-
to = extract<long>( slice->stop);
601+
long to = extract<long>( slice->stop);
602602
if (to < 0)
603603
to += max_index;
604604
if (to < 0)
605605
to = 0;
606606
if (to > max_index)
607607
to = max_index;
608+
to_ = boost::numeric_cast<Index>(to);
608609
}
609-
610610
}
611611

612612
static void

0 commit comments

Comments
 (0)