From 9ea7b4ac66fee01a840dba9071a8bd0a4a576e8d Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 22 May 2023 14:32:45 -0400 Subject: clang-tidy: Fix readability-redundant-string-cstr warnings --- Source/cmGetTestPropertyCommand.cxx | 2 +- Source/cmMakefileLibraryTargetGenerator.cxx | 2 +- Source/cmQtAutoMocUic.cxx | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Source/cmGetTestPropertyCommand.cxx b/Source/cmGetTestPropertyCommand.cxx index a4ac9f6..36446c9 100644 --- a/Source/cmGetTestPropertyCommand.cxx +++ b/Source/cmGetTestPropertyCommand.cxx @@ -25,7 +25,7 @@ bool cmGetTestPropertyCommand(std::vector const& args, prop = test->GetProperty(args[1]); } if (prop) { - mf.AddDefinition(var, prop->c_str()); + mf.AddDefinition(var, prop); return true; } } diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index b07a74b..fc3caa1 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -785,7 +785,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( if (this->GeneratorTarget->HasSOName(this->GetConfigName())) { vars.SONameFlag = this->Makefile->GetSONameFlag(linkLanguage); targetOutSOName = this->LocalGenerator->ConvertToOutputFormat( - this->TargetNames.SharedObject.c_str(), cmOutputConverter::SHELL); + this->TargetNames.SharedObject, cmOutputConverter::SHELL); vars.TargetSOName = targetOutSOName.c_str(); } vars.LinkFlags = linkFlags.c_str(); diff --git a/Source/cmQtAutoMocUic.cxx b/Source/cmQtAutoMocUic.cxx index b7af859..a101a81 100644 --- a/Source/cmQtAutoMocUic.cxx +++ b/Source/cmQtAutoMocUic.cxx @@ -2272,10 +2272,9 @@ cmQtAutoMocUicT::JobDepFilesMergeT::initialDependencies() const void cmQtAutoMocUicT::JobDepFilesMergeT::Process() { if (this->Log().Verbose()) { - this->Log().Info( - GenT::MOC, - cmStrCat("Merging MOC dependencies into ", - this->MessagePath(this->BaseConst().DepFile.c_str()))); + this->Log().Info(GenT::MOC, + cmStrCat("Merging MOC dependencies into ", + this->MessagePath(this->BaseConst().DepFile))); } auto processDepFile = [this](const std::string& mocOutputFile) -> std::vector { -- cgit v0.12