mirror of
https://github.com/boostorg/regex.git
synced 2025-07-20 15:52:09 +02:00
Fix integer types and signedness:
Fixes https://svn.boost.org/trac10/ticket/13034
This commit is contained in:
@ -122,7 +122,7 @@ inline int string_compare(const Seq& s, const C* p)
|
|||||||
{
|
{
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
return (i == s.size()) ? -p[i] : s[i] - p[i];
|
return (i == s.size()) ? -(int)p[i] : (int)s[i] - (int)p[i];
|
||||||
}
|
}
|
||||||
# define STR_COMP(s,p) string_compare(s,p)
|
# define STR_COMP(s,p) string_compare(s,p)
|
||||||
|
|
||||||
|
@ -688,7 +688,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_rep()
|
|||||||
template <class BidiIterator, class Allocator, class traits>
|
template <class BidiIterator, class Allocator, class traits>
|
||||||
bool perl_matcher<BidiIterator, Allocator, traits>::match_dot_repeat_slow()
|
bool perl_matcher<BidiIterator, Allocator, traits>::match_dot_repeat_slow()
|
||||||
{
|
{
|
||||||
unsigned count = 0;
|
std::size_t count = 0;
|
||||||
const re_repeat* rep = static_cast<const re_repeat*>(pstate);
|
const re_repeat* rep = static_cast<const re_repeat*>(pstate);
|
||||||
re_syntax_base* psingle = rep->next.p;
|
re_syntax_base* psingle = rep->next.p;
|
||||||
// match compulsary repeats first:
|
// match compulsary repeats first:
|
||||||
@ -740,7 +740,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_dot_repeat_fast()
|
|||||||
|
|
||||||
const re_repeat* rep = static_cast<const re_repeat*>(pstate);
|
const re_repeat* rep = static_cast<const re_repeat*>(pstate);
|
||||||
bool greedy = (rep->greedy) && (!(m_match_flags & regex_constants::match_any) || m_independent);
|
bool greedy = (rep->greedy) && (!(m_match_flags & regex_constants::match_any) || m_independent);
|
||||||
unsigned count = static_cast<unsigned>((std::min)(static_cast<unsigned>(::boost::BOOST_REGEX_DETAIL_NS::distance(position, last)), static_cast<unsigned>(greedy ? rep->max : rep->min)));
|
std::size_t count = static_cast<std::size_t>((std::min)(static_cast<std::size_t>(::boost::BOOST_REGEX_DETAIL_NS::distance(position, last)), greedy ? rep->max : rep->min));
|
||||||
if(rep->min > count)
|
if(rep->min > count)
|
||||||
{
|
{
|
||||||
position = last;
|
position = last;
|
||||||
|
@ -423,7 +423,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_dot_repeat_slow()
|
|||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable:4127)
|
#pragma warning(disable:4127)
|
||||||
#endif
|
#endif
|
||||||
unsigned count = 0;
|
std::size_t count = 0;
|
||||||
const re_repeat* rep = static_cast<const re_repeat*>(pstate);
|
const re_repeat* rep = static_cast<const re_repeat*>(pstate);
|
||||||
re_syntax_base* psingle = rep->next.p;
|
re_syntax_base* psingle = rep->next.p;
|
||||||
// match compulsary repeats first:
|
// match compulsary repeats first:
|
||||||
@ -497,7 +497,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_dot_repeat_fast()
|
|||||||
#pragma warning(disable:4267)
|
#pragma warning(disable:4267)
|
||||||
#endif
|
#endif
|
||||||
bool greedy = (rep->greedy) && (!(m_match_flags & regex_constants::match_any) || m_independent);
|
bool greedy = (rep->greedy) && (!(m_match_flags & regex_constants::match_any) || m_independent);
|
||||||
std::size_t count = (std::min)(static_cast<std::size_t>(::boost::BOOST_REGEX_DETAIL_NS::distance(position, last)), static_cast<std::size_t>(greedy ? rep->max : rep->min));
|
std::size_t count = (std::min)(static_cast<std::size_t>(::boost::BOOST_REGEX_DETAIL_NS::distance(position, last)), greedy ? rep->max : rep->min);
|
||||||
if(rep->min > count)
|
if(rep->min > count)
|
||||||
{
|
{
|
||||||
position = last;
|
position = last;
|
||||||
@ -657,7 +657,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_set_repeat()
|
|||||||
#endif
|
#endif
|
||||||
const re_repeat* rep = static_cast<const re_repeat*>(pstate);
|
const re_repeat* rep = static_cast<const re_repeat*>(pstate);
|
||||||
const unsigned char* map = static_cast<const re_set*>(rep->next.p)->_map;
|
const unsigned char* map = static_cast<const re_set*>(rep->next.p)->_map;
|
||||||
unsigned count = 0;
|
std::size_t count = 0;
|
||||||
//
|
//
|
||||||
// start by working out how much we can skip:
|
// start by working out how much we can skip:
|
||||||
//
|
//
|
||||||
@ -753,7 +753,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_long_set_repeat()
|
|||||||
typedef typename traits::char_class_type char_class_type;
|
typedef typename traits::char_class_type char_class_type;
|
||||||
const re_repeat* rep = static_cast<const re_repeat*>(pstate);
|
const re_repeat* rep = static_cast<const re_repeat*>(pstate);
|
||||||
const re_set_long<char_class_type>* set = static_cast<const re_set_long<char_class_type>*>(pstate->next.p);
|
const re_set_long<char_class_type>* set = static_cast<const re_set_long<char_class_type>*>(pstate->next.p);
|
||||||
unsigned count = 0;
|
std::size_t count = 0;
|
||||||
//
|
//
|
||||||
// start by working out how much we can skip:
|
// start by working out how much we can skip:
|
||||||
//
|
//
|
||||||
|
Reference in New Issue
Block a user