From 07172aa31ec468baea0dc3e52ce6f706f55d6f12 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 22 Nov 2022 13:57:41 -0500 Subject: clang-tidy: fix `readability-redundant-string-cstr` lints --- Source/cmGlobalVisualStudio10Generator.cxx | 2 +- Source/cmGlobalVisualStudio7Generator.cxx | 10 +++++----- Source/cmGlobalVisualStudio8Generator.cxx | 4 ++-- Source/cmLocalVisualStudio7Generator.cxx | 2 +- Source/cmVisualStudioWCEPlatformParser.cxx | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 969b801..ecf6539 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -776,7 +776,7 @@ std::string cmGlobalVisualStudio10Generator::FindMSBuildCommand() mskey = cmStrCat( "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\", this->GetToolsVersion(), ";MSBuildToolsPath"); - if (cmSystemTools::ReadRegistryValue(mskey.c_str(), msbuild, + if (cmSystemTools::ReadRegistryValue(mskey, msbuild, cmSystemTools::KeyWOW64_32)) { cmSystemTools::ConvertToUnixSlashes(msbuild); msbuild += "/MSBuild.exe"; diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index df212cb..f9bf044 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -158,7 +158,7 @@ std::string cmGlobalVisualStudio7Generator::FindDevEnvCommand() // Search in standard location. vskey = this->GetRegistryBase() + ";InstallDir"; - if (cmSystemTools::ReadRegistryValue(vskey.c_str(), vscmd, + if (cmSystemTools::ReadRegistryValue(vskey, vscmd, cmSystemTools::KeyWOW64_32)) { cmSystemTools::ConvertToUnixSlashes(vscmd); vscmd += "/devenv.com"; @@ -171,7 +171,7 @@ std::string cmGlobalVisualStudio7Generator::FindDevEnvCommand() vskey = cmStrCat( "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VS7;", this->GetIDEVersion()); - if (cmSystemTools::ReadRegistryValue(vskey.c_str(), vscmd, + if (cmSystemTools::ReadRegistryValue(vskey, vscmd, cmSystemTools::KeyWOW64_32)) { cmSystemTools::ConvertToUnixSlashes(vscmd); vscmd += "/Common7/IDE/devenv.com"; @@ -332,7 +332,7 @@ void cmGlobalVisualStudio7Generator::OutputSLNFile( } this->CurrentProject = root->GetProjectName(); std::string fname = GetSLNFile(root); - cmGeneratedFileStream fout(fname.c_str()); + cmGeneratedFileStream fout(fname); fout.SetCopyIfDifferent(true); if (!fout) { return; @@ -600,9 +600,9 @@ std::string cmGlobalVisualStudio7Generator::WriteUtilityDepend( std::string fname = cmStrCat(target->GetLocalGenerator()->GetCurrentBinaryDirectory(), '/', pname, ".vcproj"); - cmGeneratedFileStream fout(fname.c_str()); + cmGeneratedFileStream fout(fname); fout.SetCopyIfDifferent(true); - std::string guid = this->GetGUID(pname.c_str()); + std::string guid = this->GetGUID(pname); /* clang-format off */ fout << diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index 1e810b4..bc04d4c 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -55,7 +55,7 @@ std::string cmGlobalVisualStudio8Generator::FindDevEnvCommand() std::string vsxkey = cmStrCat("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\", this->GetIDEVersion(), ";InstallDir"); - if (cmSystemTools::ReadRegistryValue(vsxkey.c_str(), vsxcmd, + if (cmSystemTools::ReadRegistryValue(vsxkey, vsxcmd, cmSystemTools::KeyWOW64_32)) { cmSystemTools::ConvertToUnixSlashes(vsxcmd); vsxcmd += "/VCExpress.exe"; @@ -191,7 +191,7 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget() cmStrCat(generators[0]->GetMakefile()->GetCurrentBinaryDirectory(), '/', stampList); std::string stampFile; - cmGeneratedFileStream fout(stampListFile.c_str()); + cmGeneratedFileStream fout(stampListFile); for (const auto& gi : generators) { stampFile = cmStrCat(gi->GetMakefile()->GetCurrentBinaryDirectory(), "/CMakeFiles/generate.stamp"); diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index c3b5dfc..1cceefa 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -216,7 +216,7 @@ void cmLocalVisualStudio7Generator::GenerateTarget(cmGeneratorTarget* target) // Generate the project file and replace it atomically with // copy-if-different. We use a separate timestamp so that the IDE // does not reload project files unnecessarily. - cmGeneratedFileStream fout(fname.c_str()); + cmGeneratedFileStream fout(fname); fout.SetCopyIfDifferent(true); this->WriteVCProjFile(fout, lname, target); if (fout.Close()) { diff --git a/Source/cmVisualStudioWCEPlatformParser.cxx b/Source/cmVisualStudioWCEPlatformParser.cxx index 7be1f45..d8d0da9 100644 --- a/Source/cmVisualStudioWCEPlatformParser.cxx +++ b/Source/cmVisualStudioWCEPlatformParser.cxx @@ -16,9 +16,9 @@ int cmVisualStudioWCEPlatformParser::ParseVersion(const char* version) const std::string vckey = registryBase + "\\Setup\\VC;ProductDir"; const std::string vskey = registryBase + "\\Setup\\VS;ProductDir"; - if (!cmSystemTools::ReadRegistryValue(vckey.c_str(), this->VcInstallDir, + if (!cmSystemTools::ReadRegistryValue(vckey, this->VcInstallDir, cmSystemTools::KeyWOW64_32) || - !cmSystemTools::ReadRegistryValue(vskey.c_str(), this->VsInstallDir, + !cmSystemTools::ReadRegistryValue(vskey, this->VsInstallDir, cmSystemTools::KeyWOW64_32)) { return 0; } -- cgit v0.12