restyle remaining modules to match project style

For this change I decided to bundle the remaining modules that need to be
resytyled because only two were large enough to warrant doing on their own.

Reduces lint errors from 225 to 162 (-28%). Line count from 3073 to 2465 (-20%).

Another step in resolving issue #2902.
This commit is contained in:
Kurtis Rader
2016-05-03 15:18:24 -07:00
parent ee44879d4d
commit 5c8763be0e
10 changed files with 1248 additions and 1856 deletions

View File

@@ -1,24 +1,18 @@
/** \file wcstringutil.cpp
Helper functions for working with wcstring
*/
#include "common.h"
// Helper functions for working with wcstring.
#include "wcstringutil.h"
#include "common.h"
typedef wcstring::size_type size_type;
wcstring_range wcstring_tok(wcstring& str, const wcstring &needle, wcstring_range last)
{
wcstring_range wcstring_tok(wcstring& str, const wcstring& needle, wcstring_range last) {
size_type pos = last.second == wcstring::npos ? wcstring::npos : last.first;
if (pos != wcstring::npos && last.second != wcstring::npos) pos += last.second;
if (pos != wcstring::npos && pos != 0) ++pos;
if (pos == wcstring::npos || pos >= str.size())
{
if (pos == wcstring::npos || pos >= str.size()) {
return std::make_pair(wcstring::npos, wcstring::npos);
}
if (needle.empty())
{
if (needle.empty()) {
return std::make_pair(pos, wcstring::npos);
}
@@ -26,12 +20,9 @@ wcstring_range wcstring_tok(wcstring& str, const wcstring &needle, wcstring_rang
if (pos == wcstring::npos) return std::make_pair(wcstring::npos, wcstring::npos);
size_type next_pos = str.find_first_of(needle, pos);
if (next_pos == wcstring::npos)
{
if (next_pos == wcstring::npos) {
return std::make_pair(pos, wcstring::npos);
}
else
{
} else {
str[next_pos] = L'\0';
return std::make_pair(pos, next_pos - pos);
}