clang-tidy: fix modernize-raw-string-literal lints

This commit is contained in:
Ben Boeckel 2022-11-22 14:42:31 -05:00
parent d64adb9267
commit 362d6cd234
9 changed files with 20 additions and 20 deletions

View File

@ -774,7 +774,7 @@ std::string cmGlobalVisualStudio10Generator::FindMSBuildCommand()
// Search in standard location.
mskey = cmStrCat(
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\",
R"(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\)",
this->GetToolsVersion(), ";MSBuildToolsPath");
if (cmSystemTools::ReadRegistryValue(mskey, msbuild,
cmSystemTools::KeyWOW64_32)) {

View File

@ -101,14 +101,14 @@ void cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout,
// check to see if this is a fortran build
std::string ext = ".vcproj";
const char* project =
"Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"";
R"(Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = ")";
if (this->TargetIsFortranOnly(t)) {
ext = ".vfproj";
project = "Project(\"{6989167D-11E4-40FE-8C1A-2192A86A7E90}\") = \"";
project = R"(Project("{6989167D-11E4-40FE-8C1A-2192A86A7E90}") = ")";
}
if (t->IsCSharpOnly()) {
ext = ".csproj";
project = "Project(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"";
project = R"(Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = ")";
}
cmValue targetExt = t->GetProperty("GENERATOR_FILE_NAME_EXT");
if (targetExt) {
@ -129,7 +129,7 @@ void cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout,
if (ui != this->UtilityDepends.end()) {
const char* uname = ui->second.c_str();
/* clang-format off */
fout << "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \""
fout << R"(Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = ")"
<< uname << "\", \""
<< this->ConvertToSolutionPath(dir) << (dir[0]? "\\":"")
<< uname << ".vcproj" << "\", \"{"

View File

@ -169,7 +169,7 @@ std::string cmGlobalVisualStudio7Generator::FindDevEnvCommand()
// Search where VS15Preview places it.
vskey = cmStrCat(
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VS7;",
R"(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\SxS\VS7;)",
this->GetIDEVersion());
if (cmSystemTools::ReadRegistryValue(vskey, vscmd,
cmSystemTools::KeyWOW64_32)) {
@ -614,7 +614,7 @@ std::string cmGlobalVisualStudio7Generator::WriteUtilityDepend(
/* clang-format off */
fout <<
"<?xml version=\"1.0\" encoding = \""
R"(<?xml version="1.0" encoding = ")"
<< this->Encoding() << "\"?>\n"
"<VisualStudioProject\n"
"\tProjectType=\"Visual C++\"\n"

View File

@ -53,7 +53,7 @@ std::string cmGlobalVisualStudio8Generator::FindDevEnvCommand()
// First look for VCExpress.
std::string vsxcmd;
std::string vsxkey =
cmStrCat("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\",
cmStrCat(R"(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VCExpress\)",
this->GetIDEVersion(), ";InstallDir");
if (cmSystemTools::ReadRegistryValue(vsxkey, vsxcmd,
cmSystemTools::KeyWOW64_32)) {

View File

@ -158,5 +158,5 @@ std::string cmGlobalVisualStudio9Generator::GetUserMacrosDirectory()
std::string cmGlobalVisualStudio9Generator::GetUserMacrosRegKeyBase()
{
return "Software\\Microsoft\\VisualStudio\\9.0\\vsmacros";
return R"(Software\Microsoft\VisualStudio\9.0\vsmacros)";
}

View File

@ -186,7 +186,7 @@ std::string cmGlobalVisualStudioGenerator::GetRegistryBase()
std::string cmGlobalVisualStudioGenerator::GetRegistryBase(const char* version)
{
std::string key = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\";
std::string key = R"(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\)";
return key + version;
}

View File

@ -65,7 +65,7 @@ static bool VSHasDotNETFrameworkArm64()
{
std::string dotNetArm64;
return cmSystemTools::ReadRegistryValue(
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\.NETFramework;InstallRootArm64",
R"(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework;InstallRootArm64)",
dotNetArm64, cmSystemTools::KeyWOW64_64);
}
@ -530,7 +530,7 @@ bool cmGlobalVisualStudioVersionedGenerator::SetGeneratorInstance(
if (!this->GeneratorInstanceVersion.empty()) {
std::string const majorStr = VSVersionToMajorString(this->Version);
cmsys::RegularExpression versionRegex(
cmStrCat("^", majorStr, "\\.[0-9]+\\.[0-9]+\\.[0-9]+$"));
cmStrCat("^", majorStr, R"(\.[0-9]+\.[0-9]+\.[0-9]+$)"));
if (!versionRegex.find(this->GeneratorInstanceVersion)) {
std::ostringstream e;
/* clang-format off */

View File

@ -1980,7 +1980,7 @@ void cmLocalVisualStudio7Generator::WriteProjectStartFortran(
cmGlobalVisualStudio7Generator* gg =
static_cast<cmGlobalVisualStudio7Generator*>(this->GlobalGenerator);
/* clang-format off */
fout << "<?xml version=\"1.0\" encoding = \""
fout << R"(<?xml version="1.0" encoding = ")"
<< gg->Encoding() << "\"?>\n"
<< "<VisualStudioProject\n"
<< "\tProjectCreator=\"Intel Fortran\"\n"
@ -2042,7 +2042,7 @@ void cmLocalVisualStudio7Generator::WriteProjectStart(
static_cast<cmGlobalVisualStudio7Generator*>(this->GlobalGenerator);
/* clang-format off */
fout << "<?xml version=\"1.0\" encoding = \""
fout << R"(<?xml version="1.0" encoding = ")"
<< gg->Encoding() << "\"?>\n"
<< "<VisualStudioProject\n"
<< "\tProjectType=\"Visual C++\"\n";

View File

@ -454,7 +454,7 @@ void cmVisualStudio10TargetGenerator::Generate()
void cmVisualStudio10TargetGenerator::WriteClassicMsBuildProjectFile(
cmGeneratedFileStream& BuildFileStream)
{
BuildFileStream << "<?xml version=\"1.0\" encoding=\""
BuildFileStream << R"(<?xml version="1.0" encoding=")"
<< this->GlobalGenerator->Encoding() << "\"?>";
{
Elem e0(BuildFileStream, "Project");
@ -726,7 +726,7 @@ void cmVisualStudio10TargetGenerator::WriteClassicMsBuildProjectFile(
: customDir +
this->GlobalGenerator
->GetPlatformToolsetCudaVSIntegrationSubdirString() +
"extras\\visual_studio_integration\\MSBuildExtensions\\";
R"(extras\visual_studio_integration\MSBuildExtensions\)";
Elem(e1, "Import")
.Attribute("Project",
std::move(cudaPath) + "CUDA " +
@ -829,7 +829,7 @@ void cmVisualStudio10TargetGenerator::WriteClassicMsBuildProjectFile(
: customDir +
this->GlobalGenerator
->GetPlatformToolsetCudaVSIntegrationSubdirString() +
"extras\\visual_studio_integration\\MSBuildExtensions\\";
R"(extras\visual_studio_integration\MSBuildExtensions\)";
Elem(e1, "Import")
.Attribute("Project",
std::move(cudaPath) + "CUDA " +
@ -1925,7 +1925,7 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
char magic[] = { char(0xEF), char(0xBB), char(0xBF) };
fout.write(magic, 3);
fout << "<?xml version=\"1.0\" encoding=\""
fout << R"(<?xml version="1.0" encoding=")"
<< this->GlobalGenerator->Encoding() << "\"?>";
{
Elem e0(fout, "Project");
@ -2905,7 +2905,7 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions(
if (ttype >= cmStateEnums::UTILITY) {
e1.WritePlatformConfigTag(
"IntDir", cond, "$(Platform)\\$(Configuration)\\$(ProjectName)\\");
"IntDir", cond, R"($(Platform)\$(Configuration)\$(ProjectName)\)");
} else {
std::string intermediateDir = cmStrCat(
this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget), '/',
@ -3594,7 +3594,7 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaOptions(
// limitation by creating the directory and passing the flag ourselves.
pdb = this->ConvertPath(pdb, true);
ConvertToWindowsSlash(pdb);
std::string const clFd = "-Xcompiler=\"-Fd\\\"" + pdb + "\\\"\"";
std::string const clFd = R"(-Xcompiler="-Fd\")" + pdb + R"(\"")";
cudaOptions.AppendFlagString("AdditionalOptions", clFd);
}
}