Use BOOST_OVERRIDE to fix GCC -Wsuggest-override and Clang-tidy modernize-use-override warnings.

Also fixed Clang-tidy modernize-redundant-void-arg, readability-container-size-empty, and some readability-simplify-boolean-expr warnings.
Alphabetical order of STL headers.
Fix some misspellings.
This commit is contained in:
Eugene Zelenko
2020-05-25 17:04:15 -07:00
parent d961318aa2
commit c9d33026f3
16 changed files with 65 additions and 102 deletions

View File

@ -172,7 +172,7 @@ void basic_regex_parser<charT, traits>::parse(const charT* p1, const charT* p2,
m_parser_proc = &basic_regex_parser<charT, traits>::parse_literal;
break;
default:
// Ooops, someone has managed to set more than one of the main option flags,
// Oops, someone has managed to set more than one of the main option flags,
// so this must be an error:
fail(regex_constants::error_unknown, 0, "An invalid combination of regular expression syntax flags was used.");
return;
@ -981,7 +981,7 @@ template <class charT, class traits>
bool basic_regex_parser<charT, traits>::parse_repeat(std::size_t low, std::size_t high)
{
bool greedy = true;
bool pocessive = false;
bool possessive = false;
std::size_t insert_point;
//
// when we get to here we may have a non-greedy ? mark still to come:
@ -1005,12 +1005,12 @@ bool basic_regex_parser<charT, traits>::parse_repeat(std::size_t low, std::size_
greedy = false;
++m_position;
}
// for perl regexes only check for pocessive ++ repeats.
// for perl regexes only check for possessive ++ repeats.
if((m_position != m_end)
&& (0 == (this->flags() & regbase::main_option_type))
&& (this->m_traits.syntax_type(*m_position) == regex_constants::syntax_plus))
{
pocessive = true;
possessive = true;
++m_position;
}
}
@ -1082,10 +1082,10 @@ bool basic_regex_parser<charT, traits>::parse_repeat(std::size_t low, std::size_
rep = static_cast<re_repeat*>(this->getaddress(rep_off));
rep->alt.i = this->m_pdata->m_data.size() - rep_off;
//
// If the repeat is pocessive then bracket the repeat with a (?>...)
// If the repeat is possessive then bracket the repeat with a (?>...)
// independent sub-expression construct:
//
if(pocessive)
if(possessive)
{
if(m_position != m_end)
{
@ -1542,7 +1542,7 @@ bool basic_regex_parser<charT, traits>::parse_inner_set(basic_char_set<charT, tr
fail(regex_constants::error_ctype, name_first - m_base);
return false;
}
if(negated == false)
if(!negated)
char_set.add_class(m);
else
char_set.add_negated_class(m);
@ -1580,7 +1580,7 @@ bool basic_regex_parser<charT, traits>::parse_inner_set(basic_char_set<charT, tr
return false;
}
string_type m = this->m_traits.lookup_collatename(name_first, name_last);
if((0 == m.size()) || (m.size() > 2))
if(m.empty() || (m.size() > 2))
{
fail(regex_constants::error_collate, name_first - m_base);
return false;
@ -3112,7 +3112,7 @@ bool basic_regex_parser<charT, traits>::unwind_alts(std::ptrdiff_t last_paren_st
// alternative then that's an error:
//
if((this->m_alt_insert_point == static_cast<std::ptrdiff_t>(this->m_pdata->m_data.size()))
&& m_alt_jumps.size() && (m_alt_jumps.back() > last_paren_start)
&& (!m_alt_jumps.empty()) && (m_alt_jumps.back() > last_paren_start)
&&
!(
((this->flags() & regbase::main_option_type) == regbase::perl_syntax_group)
@ -3127,7 +3127,7 @@ bool basic_regex_parser<charT, traits>::unwind_alts(std::ptrdiff_t last_paren_st
//
// Fix up our alternatives:
//
while(m_alt_jumps.size() && (m_alt_jumps.back() > last_paren_start))
while((!m_alt_jumps.empty()) && (m_alt_jumps.back() > last_paren_start))
{
//
// fix up the jump to point to the end of the states