From 7c33207a72a49eceadd557f6979da590f151dde8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Fri, 9 Feb 2018 21:43:44 +0100 Subject: [PATCH] astyle formatting [ci skip] --- lib/platform.cpp | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/lib/platform.cpp b/lib/platform.cpp index a84005b2c..8b4ba9504 100644 --- a/lib/platform.cpp +++ b/lib/platform.cpp @@ -160,30 +160,30 @@ bool cppcheck::Platform::platformFile(const char exename[], const std::string &f // open file.. tinyxml2::XMLDocument doc; if (doc.LoadFile(filename.c_str()) != tinyxml2::XML_SUCCESS) { - std::vector filenames; - filenames.push_back(filename + ".xml"); - if (exename && strchr(exename, '/')) { - filenames.push_back(Path::getPathFromFilename(Path::fromNativeSeparators(exename)) + "platforms/" + filename); - filenames.push_back(Path::getPathFromFilename(Path::fromNativeSeparators(exename)) + "platforms/" + filename + ".xml"); - } + std::vector filenames; + filenames.push_back(filename + ".xml"); + if (exename && strchr(exename, '/')) { + filenames.push_back(Path::getPathFromFilename(Path::fromNativeSeparators(exename)) + "platforms/" + filename); + filenames.push_back(Path::getPathFromFilename(Path::fromNativeSeparators(exename)) + "platforms/" + filename + ".xml"); + } #ifdef CFGDIR - std::string cfgdir = CFGDIR; - if (cfgdir[cfgdir.size()-1] != '/') - cfgdir += '/'; - filenames.push_back(CFGDIR + ("../platforms/" + filename)); - filenames.push_back(CFGDIR + ("../platforms/" + filename + ".xml")); + std::string cfgdir = CFGDIR; + if (cfgdir[cfgdir.size()-1] != '/') + cfgdir += '/'; + filenames.push_back(CFGDIR + ("../platforms/" + filename)); + filenames.push_back(CFGDIR + ("../platforms/" + filename + ".xml")); #endif - bool success = false; - for (int i = 0; i < filenames.size(); ++i) { - std::cout << "platform:" << filenames[i] << std::endl; - if (doc.LoadFile(filenames[i].c_str()) == tinyxml2::XML_SUCCESS) { - success = true; - break; - } - } - if (!success) - return false; - } + bool success = false; + for (int i = 0; i < filenames.size(); ++i) { + std::cout << "platform:" << filenames[i] << std::endl; + if (doc.LoadFile(filenames[i].c_str()) == tinyxml2::XML_SUCCESS) { + success = true; + break; + } + } + if (!success) + return false; + } const tinyxml2::XMLElement * const rootnode = doc.FirstChildElement();