mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-02 12:19:54 -05:00
clang-tidy: fix readability-redundant-string-cstr lints
This commit is contained in:
@@ -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";
|
||||
|
||||
@@ -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 <<
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user