diff --git a/src/citeme.cpp b/src/citeme.cpp index 35ff062874..85f7f478a6 100644 --- a/src/citeme.cpp +++ b/src/citeme.cpp @@ -101,7 +101,7 @@ void CiteMe::add(const std::string &reference) if (logfile_flag == VERBOSE) logbuffer += "\n"; } - std::size_t found = reference.find_first_of("\n"); + std::size_t found = reference.find_first_of('\n'); std::string header = reference.substr(0,found+1); if (screen_flag == VERBOSE) scrbuffer += "- " + reference; if (screen_flag == TERSE) scrbuffer += "- " + header; diff --git a/src/input.cpp b/src/input.cpp index 50e0d45aa0..97757fd1f6 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -1257,7 +1257,7 @@ void Input::shell() #else if (arg[i]) { std::string vardef(arg[i]); - auto found = vardef.find_first_of("="); + auto found = vardef.find_first_of('='); if (found == std::string::npos) { rv = setenv(vardef.c_str(),"",1); } else { diff --git a/src/universe.cpp b/src/universe.cpp index fc3e79ab83..005a91fc6b 100644 --- a/src/universe.cpp +++ b/src/universe.cpp @@ -174,7 +174,7 @@ void Universe::add_world(char *str) if (part.find_first_not_of("0123456789x") != std::string::npos) valid = false; if (valid) { - std::size_t found = part.find_first_of("x"); + std::size_t found = part.find_first_of('x'); // 'x' may not be the first or last character diff --git a/src/utils.cpp b/src/utils.cpp index 654e1a5c70..7262cf8afd 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -502,7 +502,7 @@ void utils::bounds(const char *file, int line, const std::string &str, return; } - found = str.find_first_of("*"); + found = str.find_first_of('*'); if (found == std::string::npos) { // contains no '*' nlo = nhi = strtol(str.c_str(), nullptr, 10); } else if (str.size() == 1) { // is only '*' @@ -727,7 +727,7 @@ std::string utils::trim(const std::string &line) std::string utils::trim_comment(const std::string &line) { - auto end = line.find_first_of("#"); + auto end = line.find_first_of('#'); if (end != std::string::npos) { return line.substr(0, end); } return std::string(line); } @@ -1030,7 +1030,7 @@ std::string utils::path_basename(const std::string &path) #if defined(_WIN32) size_t start = path.find_last_of("/\\"); #else - size_t start = path.find_last_of("/"); + size_t start = path.find_last_of('/'); #endif if (start == std::string::npos) { @@ -1051,7 +1051,7 @@ std::string utils::path_dirname(const std::string &path) #if defined(_WIN32) size_t start = path.find_last_of("/\\"); #else - size_t start = path.find_last_of("/"); + size_t start = path.find_last_of('/'); #endif if (start == std::string::npos) return ".";