소스 검색

clang-tidy: Fix readability-redundant-string-cstr warnings

Brad King 2 년 전
부모
커밋
9ea7b4ac66
3개의 변경된 파일5개의 추가작업 그리고 6개의 파일을 삭제
  1. 1 1
      Source/cmGetTestPropertyCommand.cxx
  2. 1 1
      Source/cmMakefileLibraryTargetGenerator.cxx
  3. 3 4
      Source/cmQtAutoMocUic.cxx

+ 1 - 1
Source/cmGetTestPropertyCommand.cxx

@@ -25,7 +25,7 @@ bool cmGetTestPropertyCommand(std::vector<std::string> const& args,
       prop = test->GetProperty(args[1]);
     }
     if (prop) {
-      mf.AddDefinition(var, prop->c_str());
+      mf.AddDefinition(var, prop);
       return true;
     }
   }

+ 1 - 1
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();

+ 3 - 4
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<std::string> {