|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r66072 - trunk/boost/regex/v4
From: john_at_[hidden]
Date: 2010-10-18 08:07:34
Author: johnmaddock
Date: 2010-10-18 08:07:14 EDT (Mon, 18 Oct 2010)
New Revision: 66072
URL: http://svn.boost.org/trac/boost/changeset/66072
Log:
Fix some compiler warnings by using "int" consistently for hash values.
Text files modified:
trunk/boost/regex/v4/basic_regex.hpp | 12 ++++++------
trunk/boost/regex/v4/basic_regex_creator.hpp | 2 +-
2 files changed, 7 insertions(+), 7 deletions(-)
Modified: trunk/boost/regex/v4/basic_regex.hpp
==============================================================================
--- trunk/boost/regex/v4/basic_regex.hpp (original)
+++ trunk/boost/regex/v4/basic_regex.hpp 2010-10-18 08:07:14 EDT (Mon, 18 Oct 2010)
@@ -62,12 +62,12 @@
}
template <class Iterator>
-inline std::size_t hash_value_from_capture_name(Iterator i, Iterator j)
+inline int hash_value_from_capture_name(Iterator i, Iterator j)
{
std::size_t r = boost::hash_range(i, j);
r %= ((std::numeric_limits<int>::max)() - 10001);
r += 10000;
- return r;
+ return static_cast<int>(r);
}
class named_subexpressions
@@ -81,12 +81,12 @@
{
hash = hash_value_from_capture_name(i, j);
}
- name(std::size_t h, int idx)
+ name(int h, int idx)
: index(idx), hash(h)
{
}
int index;
- std::size_t hash;
+ int hash;
bool operator < (const name& other)const
{
return hash < other.hash;
@@ -130,7 +130,7 @@
name t(i, j, 0);
return std::equal_range(m_sub_names.begin(), m_sub_names.end(), t);
}
- int get_id(std::size_t h)const
+ int get_id(int h)const
{
name t(h, 0);
std::vector<name>::const_iterator pos = std::lower_bound(m_sub_names.begin(), m_sub_names.end(), t);
@@ -140,7 +140,7 @@
}
return -1;
}
- range_type equal_range(std::size_t h)const
+ range_type equal_range(int h)const
{
name t(h, 0);
return std::equal_range(m_sub_names.begin(), m_sub_names.end(), t);
Modified: trunk/boost/regex/v4/basic_regex_creator.hpp
==============================================================================
--- trunk/boost/regex/v4/basic_regex_creator.hpp (original)
+++ trunk/boost/regex/v4/basic_regex_creator.hpp 2010-10-18 08:07:14 EDT (Mon, 18 Oct 2010)
@@ -811,7 +811,7 @@
// There may be more than one capture group with this hash, just do what Perl
// does and recurse to the leftmost:
//
- idx = m_pdata->get_id(idx);
+ idx = m_pdata->get_id(static_cast<int>(idx));
}
while(p)
{
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