diff --git a/src/App/Extension.cpp b/src/App/Extension.cpp index c26ba5393b4f..52756c28c56e 100644 --- a/src/App/Extension.cpp +++ b/src/App/Extension.cpp @@ -111,7 +111,7 @@ std::string Extension::name() const { throw Base::RuntimeError("Extension::name: Extension type not set"); std::string temp(m_extensionType.getName()); - std::string::size_type pos = temp.find_last_of(":"); + std::string::size_type pos = temp.find_last_of(':'); if(pos != std::string::npos) return temp.substr(pos+1); diff --git a/src/Base/Interpreter.cpp b/src/Base/Interpreter.cpp index 24202b79d183..0e0a3f100400 100644 --- a/src/Base/Interpreter.cpp +++ b/src/Base/Interpreter.cpp @@ -792,7 +792,7 @@ int getSWIGVersionFromModule(const std::string& module) Py::String file(mod.getAttr("__file__")); std::string filename = (std::string)file; // file can have the extension .py or .pyc - filename = filename.substr(0, filename.rfind(".")); + filename = filename.substr(0, filename.rfind('.')); filename += ".py"; boost::regex rx("^# Version ([1-9])\\.([0-9])\\.([0-9]+)"); boost::cmatch what; diff --git a/src/Base/Writer.cpp b/src/Base/Writer.cpp index 0f5a0c48d67d..a8340da82b8e 100644 --- a/src/Base/Writer.cpp +++ b/src/Base/Writer.cpp @@ -317,7 +317,7 @@ void FileWriter::writeFiles(void) if (shouldWrite(entry.FileName, entry.Object)) { std::string filePath = entry.FileName; std::string::size_type pos = 0; - while ((pos = filePath.find("/", pos)) != std::string::npos) { + while ((pos = filePath.find('/', pos)) != std::string::npos) { std::string dirName = DirName + "/" + filePath.substr(0, pos); pos++; Base::FileInfo fi(dirName); diff --git a/src/Gui/AutoSaver.cpp b/src/Gui/AutoSaver.cpp index 4f074db8914a..9343d9cd3573 100644 --- a/src/Gui/AutoSaver.cpp +++ b/src/Gui/AutoSaver.cpp @@ -375,7 +375,7 @@ void RecoveryWriter::writeFiles(void) if (shouldWrite(entry.FileName, entry.Object)) { std::string filePath = entry.FileName; std::string::size_type pos = 0; - while ((pos = filePath.find("/", pos)) != std::string::npos) { + while ((pos = filePath.find('/', pos)) != std::string::npos) { std::string dirName = DirName + "/" + filePath.substr(0, pos); pos++; Base::FileInfo fi(dirName); diff --git a/src/Gui/DAGView/DAGModel.cpp b/src/Gui/DAGView/DAGModel.cpp index c7be3833969a..6d56aaf83b26 100644 --- a/src/Gui/DAGView/DAGModel.cpp +++ b/src/Gui/DAGView/DAGModel.cpp @@ -893,7 +893,7 @@ void Model::updateStates() std::size_t Model::columnFromMask(const ColumnMask &maskIn) { std::string maskString = maskIn.to_string(); - return maskString.size() - maskString.find("1") - 1; + return maskString.size() - maskString.find('1') - 1; } RectItem* Model::getRectFromPosition(const QPointF& position) diff --git a/src/Mod/Fem/App/FemMesh.cpp b/src/Mod/Fem/App/FemMesh.cpp index 062dce28aefe..11e77fbdf086 100644 --- a/src/Mod/Fem/App/FemMesh.cpp +++ b/src/Mod/Fem/App/FemMesh.cpp @@ -1023,7 +1023,7 @@ void FemMesh::readNastran(const std::string &Filename) { std::getline(inputfile,line1); if (line1.size() == 0) continue; - if (!nastran_free_format && line1.find(",")!= std::string::npos) + if (!nastran_free_format && line1.find(',')!= std::string::npos) nastran_free_format = true; if (!nastran_free_format && line1.find("GRID*")!= std::string::npos ) //We found a Grid line { diff --git a/src/Mod/Mesh/App/Core/MeshIO.cpp b/src/Mod/Mesh/App/Core/MeshIO.cpp index 8f2f7a490f68..c8e18de8050a 100644 --- a/src/Mod/Mesh/App/Core/MeshIO.cpp +++ b/src/Mod/Mesh/App/Core/MeshIO.cpp @@ -1624,7 +1624,7 @@ bool MeshInput::LoadNastran (std::istream &rstrIn) if (line.find("GRID*") == 0) { assert(0); } - else if (line.find("*") == 0) { + else if (line.find('*') == 0) { assert(0); } // insert the read-in vertex into a map to preserve the order diff --git a/src/Mod/Path/App/Path.cpp b/src/Mod/Path/App/Path.cpp index a5e51efcf9ac..bf6b2af172f6 100644 --- a/src/Mod/Path/App/Path.cpp +++ b/src/Mod/Path/App/Path.cpp @@ -261,7 +261,7 @@ void Toolpath::setFromGCode(const std::string instr) } mode = "comment"; last = found; - found = str.find_first_of(")", found+1); + found = str.find_first_of(')', found+1); } else if (str[found] == ')') { // end of comment std::string gcodestr = str.substr(last, found-last+1); diff --git a/src/Mod/TechDraw/App/HatchLine.cpp b/src/Mod/TechDraw/App/HatchLine.cpp index b822e4437612..b21eb2cb723e 100644 --- a/src/Mod/TechDraw/App/HatchLine.cpp +++ b/src/Mod/TechDraw/App/HatchLine.cpp @@ -343,7 +343,7 @@ bool PATLineSpec::findPatternStart(std::ifstream& inFile, std::string& parmName (line.empty()) ) { //is cr/lf empty? continue; } else if (nameTag == "*") { - commaPos = line.find(",",1); + commaPos = line.find(',',1); if (commaPos != std::string::npos) { patternName = line.substr(1,commaPos-1); } else { @@ -396,7 +396,7 @@ std::vector PATLineSpec::getPatternList(std::string& parmFile) std::string nameTag = line.substr(0,1); //dupl code here unsigned long int commaPos; if (nameTag == "*") { //found a pattern - commaPos = line.find(",",1); + commaPos = line.find(',',1); std::string patternName; if (commaPos != std::string::npos) { patternName = line.substr(1,commaPos-1); diff --git a/src/Mod/TechDraw/App/LineGroup.cpp b/src/Mod/TechDraw/App/LineGroup.cpp index 1b4308a07822..d8f373eb7ed1 100644 --- a/src/Mod/TechDraw/App/LineGroup.cpp +++ b/src/Mod/TechDraw/App/LineGroup.cpp @@ -148,7 +148,7 @@ std::string LineGroup::getRecordFromFile(std::string parmFile, std::string group (line.empty()) ) { //is cr/lf empty? continue; } else if (nameTag == "*") { - commaPos = line.find(",",1); + commaPos = line.find(',',1); if (commaPos != std::string::npos) { foundName = line.substr(1,commaPos-1); } else {