C++11: N1984 auto

This commit is contained in:
Paul Beckingham
2015-05-24 13:36:26 -04:00
parent 7bbc794d3a
commit e8d04bdce6
24 changed files with 77 additions and 77 deletions

View File

@@ -1393,7 +1393,7 @@ void Task::validate (bool applyDefault /* = true */)
if (var.first.substr (0, 4) == "uda." &&
var.first.find (".default") != std::string::npos)
{
std::string::size_type period = var.first.find ('.', 4);
auto period = var.first.find ('.', 4);
if (period != std::string::npos)
udas.push_back (var.first.substr (4, period - 4));
}
@@ -1543,9 +1543,9 @@ int Task::determineVersion (const std::string& line)
// uuid status [tags] [attributes] [annotations] description\n
//
// Scan for the number of [] pairs.
std::string::size_type tagAtts = line.find ("] [", 0);
std::string::size_type attsAnno = line.find ("] [", tagAtts + 1);
std::string::size_type annoDesc = line.find ("] ", attsAnno + 1);
auto tagAtts = line.find ("] [", 0);
auto attsAnno = line.find ("] [", tagAtts + 1);
auto annoDesc = line.find ("] ", attsAnno + 1);
if (tagAtts != std::string::npos &&
attsAnno != std::string::npos &&
annoDesc != std::string::npos)
@@ -1630,7 +1630,7 @@ float Task::urgency_c () const
if (var.first.substr (0, 13) == "urgency.user.")
{
// urgency.user.project.<project>.coefficient
std::string::size_type end = std::string::npos;
auto end = std::string::npos;
if (var.first.substr (13, 8) == "project." &&
(end = var.first.find (".coefficient")) != std::string::npos)
{
@@ -1664,11 +1664,11 @@ float Task::urgency_c () const
{
// urgency.uda.<name>.coefficient
// urgency.uda.<name>.<value>.coefficient
std::string::size_type end = var.first.find (".coefficient");
auto end = var.first.find (".coefficient");
if (end != std::string::npos)
{
const std::string uda = var.first.substr (12, end - 12);
std::string::size_type dot = uda.find (".");
auto dot = uda.find (".");
if (dot == std::string::npos)
{
// urgency.uda.<name>.coefficient