From a74e6893480e491959e9165106f199a8cd0edd57 Mon Sep 17 00:00:00 2001 From: Daniel Pfeifer Date: Sat, 10 Dec 2016 14:53:06 +0100 Subject: clang-tidy: apply readability-redundant-string-init fixes --- Source/CTest/cmCTestCoverageHandler.cxx | 12 ++++++------ Source/CTest/cmCTestMultiProcessHandler.cxx | 2 +- Source/CTest/cmCTestSubmitHandler.cxx | 6 +++--- Source/CTest/cmCTestTestHandler.cxx | 4 ++-- Source/CTest/cmParseCoberturaCoverage.cxx | 2 +- Source/cmDependsJavaParserHelper.cxx | 4 ++-- Source/cmExportBuildAndroidMKGenerator.cxx | 2 +- Source/cmExportInstallAndroidMKGenerator.cxx | 4 ++-- Source/cmExtraSublimeTextGenerator.cxx | 2 +- Source/cmFLTKWrapUICommand.cxx | 2 +- Source/cmFileCommand.cxx | 2 +- Source/cmFindProgramCommand.cxx | 4 ++-- Source/cmMakefile.cxx | 4 ++-- Source/cmNinjaTargetGenerator.cxx | 2 +- Source/cmQTWrapCPPCommand.cxx | 2 +- Source/cmQTWrapUICommand.cxx | 2 +- Source/cmQtAutoGenerators.cxx | 2 +- Source/cmStringCommand.cxx | 2 +- Source/cmTimestamp.cxx | 2 +- 19 files changed, 31 insertions(+), 31 deletions(-) diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index b7ac969..989c096 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -977,7 +977,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage( std::set missingFiles; - std::string actualSourceFile = ""; + std::string actualSourceFile; cmCTestOptionalLog( this->CTest, HANDLER_OUTPUT, " Processing coverage (each . represents one file):" << std::endl, @@ -1006,8 +1006,8 @@ int cmCTestCoverageHandler::HandleGCovCoverage( cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, command << std::endl, this->Quiet); - std::string output = ""; - std::string errors = ""; + std::string output; + std::string errors; int retVal = 0; *cont->OFS << "* Run coverage for: " << fileDir << std::endl; *cont->OFS << " Command: " << command << std::endl; @@ -1344,7 +1344,7 @@ int cmCTestCoverageHandler::HandleLCovCoverage( std::set missingFiles; - std::string actualSourceFile = ""; + std::string actualSourceFile; cmCTestOptionalLog( this->CTest, HANDLER_OUTPUT, " Processing coverage (each . represents one file):" << std::endl, @@ -1371,8 +1371,8 @@ int cmCTestCoverageHandler::HandleLCovCoverage( cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, command << std::endl, this->Quiet); - std::string output = ""; - std::string errors = ""; + std::string output; + std::string errors; int retVal = 0; *cont->OFS << "* Run coverage for: " << fileDir << std::endl; *cont->OFS << " Command: " << command << std::endl; diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index 1766aef..c1724ab 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -256,7 +256,7 @@ void cmCTestMultiProcessHandler::StartNextTests() bool allTestsFailedTestLoadCheck = false; bool usedFakeLoadForTesting = false; size_t minProcessorsRequired = this->ParallelLevel; - std::string testWithMinProcessors = ""; + std::string testWithMinProcessors; cmsys::SystemInformation info; diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 0f13c1e..0a6bc33 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -388,7 +388,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix, *this->LogFile << "\tUpload file: " << local_file << " to " << remote_file << std::endl; - std::string ofile = ""; + std::string ofile; for (kk = 0; kk < remote_file.size(); kk++) { char c = remote_file[kk]; char hexCh[4] = { 0, 0, 0, 0 }; @@ -582,7 +582,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix, void cmCTestSubmitHandler::ParseResponse( cmCTestSubmitHandlerVectorOfChar chunk) { - std::string output = ""; + std::string output; output.append(chunk.begin(), chunk.end()); if (output.find("& files, ::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, (void*)&chunkDebug); std::string rfile = remoteprefix + cmSystemTools::GetFilenameName(*file); - std::string ofile = ""; + std::string ofile; std::string::iterator kk; for (kk = rfile.begin(); kk < rfile.end(); ++kk) { char c = *kk; diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 68f9a54..4e63654 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -718,7 +718,7 @@ void cmCTestTestHandler::ComputeTestList() // Now create a final list of tests to run int cnt = 0; inREcnt = 0; - std::string last_directory = ""; + std::string last_directory; ListOfTests finalList; for (it = this->TestList.begin(); it != this->TestList.end(); it++) { cnt++; @@ -1649,7 +1649,7 @@ void cmCTestTestHandler::ExpandTestsToRunInformationForRerunFailed() int numFiles = static_cast(cmsys::Directory::GetNumberOfFilesInDirectory(dirName)); std::string pattern = "LastTestsFailed"; - std::string logName = ""; + std::string logName; for (int i = 0; i < numFiles; ++i) { std::string fileName = directory.GetFile(i); diff --git a/Source/CTest/cmParseCoberturaCoverage.cxx b/Source/CTest/cmParseCoberturaCoverage.cxx index 0b6d3ce..db17748 100644 --- a/Source/CTest/cmParseCoberturaCoverage.cxx +++ b/Source/CTest/cmParseCoberturaCoverage.cxx @@ -54,7 +54,7 @@ protected: void StartElement(const std::string& name, const char** atts) CM_OVERRIDE { std::string FoundSource; - std::string finalpath = ""; + std::string finalpath; if (name == "source") { this->InSource = true; } else if (name == "sources") { diff --git a/Source/cmDependsJavaParserHelper.cxx b/Source/cmDependsJavaParserHelper.cxx index b5d68d0..f5998ef 100644 --- a/Source/cmDependsJavaParserHelper.cxx +++ b/Source/cmDependsJavaParserHelper.cxx @@ -35,7 +35,7 @@ cmDependsJavaParserHelper::~cmDependsJavaParserHelper() void cmDependsJavaParserHelper::CurrentClass::AddFileNamesForPrinting( std::vector* files, const char* prefix, const char* sep) const { - std::string rname = ""; + std::string rname; if (prefix) { rname += prefix; rname += sep; @@ -341,7 +341,7 @@ int cmDependsJavaParserHelper::ParseFile(const char* file) return 0; } - std::string fullfile = ""; + std::string fullfile; std::string line; while (cmSystemTools::GetLineFromStream(ifs, line)) { fullfile += line + "\n"; diff --git a/Source/cmExportBuildAndroidMKGenerator.cxx b/Source/cmExportBuildAndroidMKGenerator.cxx index dab0c2c..b443fb0 100644 --- a/Source/cmExportBuildAndroidMKGenerator.cxx +++ b/Source/cmExportBuildAndroidMKGenerator.cxx @@ -69,7 +69,7 @@ void cmExportBuildAndroidMKGenerator::GenerateInterfaceProperties( const cmGeneratorTarget* target, std::ostream& os, const ImportPropertyMap& properties) { - std::string config = ""; + std::string config; if (!this->Configurations.empty()) { config = this->Configurations[0]; } diff --git a/Source/cmExportInstallAndroidMKGenerator.cxx b/Source/cmExportInstallAndroidMKGenerator.cxx index 9772f49..9a1c647 100644 --- a/Source/cmExportInstallAndroidMKGenerator.cxx +++ b/Source/cmExportInstallAndroidMKGenerator.cxx @@ -67,7 +67,7 @@ void cmExportInstallAndroidMKGenerator::GenerateImportTargetCode( os << targetName << "\n"; os << "LOCAL_SRC_FILES := $(_IMPORT_PREFIX)/"; os << target->Target->GetProperty("__dest") << "/"; - std::string config = ""; + std::string config; if (!this->Configurations.empty()) { config = this->Configurations[0]; } @@ -94,7 +94,7 @@ void cmExportInstallAndroidMKGenerator::GenerateInterfaceProperties( cmGeneratorTarget const* target, std::ostream& os, const ImportPropertyMap& properties) { - std::string config = ""; + std::string config; if (!this->Configurations.empty()) { config = this->Configurations[0]; } diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx index 5712ab2..dfefefe 100644 --- a/Source/cmExtraSublimeTextGenerator.cxx +++ b/Source/cmExtraSublimeTextGenerator.cxx @@ -172,7 +172,7 @@ void cmExtraSublimeTextGenerator::AppendAllTargets( cmGeneratedFileStream& fout, MapSourceFileFlags& sourceFileFlags) { std::string make = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM"); - std::string compiler = ""; + std::string compiler; if (!lgs.empty()) { this->AppendTarget(fout, "all", lgs[0], CM_NULLPTR, make.c_str(), mf, compiler.c_str(), sourceFileFlags, true); diff --git a/Source/cmFLTKWrapUICommand.cxx b/Source/cmFLTKWrapUICommand.cxx index 1e8ca06..ff78f52 100644 --- a/Source/cmFLTKWrapUICommand.cxx +++ b/Source/cmFLTKWrapUICommand.cxx @@ -71,7 +71,7 @@ bool cmFLTKWrapUICommand::InitialPass(std::vector const& args, commandLines.push_back(commandLine); // Add command for generating the .h and .cxx files - std::string no_main_dependency = ""; + std::string no_main_dependency; const char* no_comment = CM_NULLPTR; const char* no_working_dir = CM_NULLPTR; this->Makefile->AddCustomCommandToOutput( diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 2f6238b..34b880e 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -768,7 +768,7 @@ bool cmFileCommand::HandleGlobCommand(std::vector const& args, } } - std::string output = ""; + std::string output; bool first = true; for (; i != args.end(); ++i) { if (*i == "LIST_DIRECTORIES") { diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx index 2c496ba..ea031cf 100644 --- a/Source/cmFindProgramCommand.cxx +++ b/Source/cmFindProgramCommand.cxx @@ -116,7 +116,7 @@ bool cmFindProgramCommand::InitialPass(std::vector const& argsIn, std::string cmFindProgramCommand::FindProgram() { - std::string program = ""; + std::string program; if (this->SearchAppBundleFirst || this->SearchAppBundleOnly) { program = FindAppBundle(); @@ -214,7 +214,7 @@ std::string cmFindProgramCommand::FindAppBundle() std::string cmFindProgramCommand::GetBundleExecutable(std::string bundlePath) { - std::string executable = ""; + std::string executable; (void)bundlePath; #if defined(__APPLE__) // Started with an example on developer.apple.com about finding bundles diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index f52fe26..fccb486 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -961,7 +961,7 @@ void cmMakefile::AddCustomCommandOldStyle( commandLines, comment, CM_NULLPTR); } else { // The source may not be a real file. Do not use a main dependency. - std::string no_main_dependency = ""; + std::string no_main_dependency; std::vector depends2 = depends; depends2.push_back(source); sf = this->AddCustomCommandToOutput(output, depends2, no_main_dependency, @@ -1051,7 +1051,7 @@ cmTarget* cmMakefile::AddUtilityCommand( force += utilityName; std::vector forced; forced.push_back(force); - std::string no_main_dependency = ""; + std::string no_main_dependency; bool no_replace = false; this->AddCustomCommandToOutput( forced, byproducts, depends, no_main_dependency, commandLines, comment, diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 8090542..04a46af 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -495,7 +495,7 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang) this->GetMakefile()->GetRequiredDefinition(ppVar); // Explicit preprocessing always uses a depfile. - std::string const ppDeptype = ""; // no deps= for multiple outputs + std::string const ppDeptype; // no deps= for multiple outputs std::string const ppDepfile = "$DEP_FILE"; cmRulePlaceholderExpander::RuleVariables ppVars; diff --git a/Source/cmQTWrapCPPCommand.cxx b/Source/cmQTWrapCPPCommand.cxx index b0ff68d..de9e545 100644 --- a/Source/cmQTWrapCPPCommand.cxx +++ b/Source/cmQTWrapCPPCommand.cxx @@ -77,7 +77,7 @@ bool cmQTWrapCPPCommand::InitialPass(std::vector const& args, depends.push_back(moc_exe); depends.push_back(hname); - std::string no_main_dependency = ""; + std::string no_main_dependency; const char* no_working_dir = CM_NULLPTR; this->Makefile->AddCustomCommandToOutput( newName, depends, no_main_dependency, commandLines, "Qt Wrapped File", diff --git a/Source/cmQTWrapUICommand.cxx b/Source/cmQTWrapUICommand.cxx index 052e633..d3c6631 100644 --- a/Source/cmQTWrapUICommand.cxx +++ b/Source/cmQTWrapUICommand.cxx @@ -108,7 +108,7 @@ bool cmQTWrapUICommand::InitialPass(std::vector const& args, std::vector depends; depends.push_back(uiName); - std::string no_main_dependency = ""; + std::string no_main_dependency; const char* no_comment = CM_NULLPTR; const char* no_working_dir = CM_NULLPTR; this->Makefile->AddCustomCommandToOutput( diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index eb513e5..a9a9c49 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -110,7 +110,7 @@ cmQtAutoGenerators::cmQtAutoGenerators() , GenerateAll(false) { - std::string colorEnv = ""; + std::string colorEnv; cmsys::SystemTools::GetEnv("COLOR", colorEnv); if (!colorEnv.empty()) { if (cmSystemTools::IsOn(colorEnv.c_str())) { diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index 48c086f..eb94080 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -150,7 +150,7 @@ bool cmStringCommand::HandleAsciiCommand(std::vector const& args) } std::string::size_type cc; std::string outvar = args[args.size() - 1]; - std::string output = ""; + std::string output; for (cc = 1; cc < args.size() - 1; cc++) { int ch = atoi(args[cc].c_str()); if (ch > 0 && ch < 256) { diff --git a/Source/cmTimestamp.cxx b/Source/cmTimestamp.cxx index 589f195..4a97114 100644 --- a/Source/cmTimestamp.cxx +++ b/Source/cmTimestamp.cxx @@ -82,7 +82,7 @@ time_t cmTimestamp::CreateUtcTimeTFromTm(struct tm& tm) const #else // From Linux timegm() manpage. - std::string tz_old = ""; + std::string tz_old; cmSystemTools::GetEnv("TZ", tz_old); tz_old = "TZ=" + tz_old; -- cgit v0.12