mirror of
https://github.com/boostorg/ublas.git
synced 2026-02-25 16:52:09 +00:00
FIX completed ignore_unused_variable thanks to Georg Baum
This commit is contained in:
@@ -1579,6 +1579,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
size_type element (size_type i, size_type size1, size_type j, size_type size2) {
|
||||
BOOST_UBLAS_CHECK (i < size1, bad_index ());
|
||||
BOOST_UBLAS_CHECK (j < size2, bad_index ());
|
||||
detail::ignore_unused_variable_warning(size2);
|
||||
// Guard against size_type overflow
|
||||
BOOST_UBLAS_CHECK (j <= ((std::numeric_limits<size_type>::max) () - i) / size1, bad_index ());
|
||||
return i + j * size1;
|
||||
@@ -1588,6 +1589,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
size_type address (size_type i, size_type size1, size_type j, size_type size2) {
|
||||
BOOST_UBLAS_CHECK (i <= size1, bad_index ());
|
||||
BOOST_UBLAS_CHECK (j <= size2, bad_index ());
|
||||
detail::ignore_unused_variable_warning(size2);
|
||||
// Guard against size_type overflow - address may be size1 past end of storage
|
||||
BOOST_UBLAS_CHECK (size1 == 0 || j <= ((std::numeric_limits<size_type>::max) () - i) / size1, bad_index ());
|
||||
return i + j * size1;
|
||||
@@ -1668,24 +1670,28 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
BOOST_UBLAS_INLINE
|
||||
size_type element1 (size_type /* i */, size_type /* size1 */, size_type j, size_type size2) {
|
||||
BOOST_UBLAS_CHECK (j < size2, bad_index ());
|
||||
detail::ignore_unused_variable_warning(size2);
|
||||
return j;
|
||||
}
|
||||
static
|
||||
BOOST_UBLAS_INLINE
|
||||
size_type element2 (size_type i, size_type size1, size_type /* j */, size_type /* size2 */) {
|
||||
BOOST_UBLAS_CHECK (i < size1, bad_index ());
|
||||
detail::ignore_unused_variable_warning(size1);
|
||||
return i;
|
||||
}
|
||||
static
|
||||
BOOST_UBLAS_INLINE
|
||||
size_type address1 (size_type /* i */, size_type /* size1 */, size_type j, size_type size2) {
|
||||
BOOST_UBLAS_CHECK (j <= size2, bad_index ());
|
||||
detail::ignore_unused_variable_warning(size2);
|
||||
return j;
|
||||
}
|
||||
static
|
||||
BOOST_UBLAS_INLINE
|
||||
size_type address2 (size_type i, size_type size1, size_type /* j */, size_type /* size2 */) {
|
||||
BOOST_UBLAS_CHECK (i <= size1, bad_index ());
|
||||
detail::ignore_unused_variable_warning(size1);
|
||||
return i;
|
||||
}
|
||||
static
|
||||
|
||||
Reference in New Issue
Block a user