From 3c455a8511f8c72552afb6ebe35a8e7c9b9af979 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 30 Jul 2022 17:21:47 +0100 Subject: Modernize various minor legacy C++isms. --- src/configparser.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/configparser.cpp') diff --git a/src/configparser.cpp b/src/configparser.cpp index fa349fbe6..7dc603569 100644 --- a/src/configparser.cpp +++ b/src/configparser.cpp @@ -57,7 +57,7 @@ struct Parser final FilePosition current; FilePosition last_tag; std::shared_ptr tag; - int ungot; + int ungot = -1; std::string mandatory_tag; Parser(ParseStack& me, int myflags, FilePtr conf, const std::string& name, const std::string& mandatorytag) @@ -66,7 +66,6 @@ struct Parser final , file(std::move(conf)) , current(name, 1, 0) , last_tag(name, 0, 0) - , ungot(-1) , mandatory_tag(mandatorytag) { } @@ -105,7 +104,7 @@ struct Parser final void comment() { - while (1) + while (true) { int ch = next(); if (ch == '\n') @@ -159,13 +158,13 @@ struct Parser final { throw CoreException("Invalid character in value of <" + tag->name + ":" + key + ">"); } - while (1) + while (true) { ch = next(); if (ch == '&') { std::string varname; - while (1) + while (true) { ch = next(); if (wordchar(ch) || (varname.empty() && ch == '#')) @@ -287,7 +286,7 @@ struct Parser final { try { - while (1) + while (true) { int ch = next(true); switch (ch) -- cgit v1.3.1-10-gc9f91