Commit 69ca85cc authored by Vitaly Stakhovsky's avatar Vitaly Stakhovsky Committed by Brad King
Browse files

Remove unnecessary c_str() in RegularExpression::find calls

parent d7a52f8c
...@@ -369,7 +369,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories( ...@@ -369,7 +369,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
inFile += '/'; inFile += '/';
} }
for (cmsys::RegularExpression& reg : ignoreFilesRegex) { for (cmsys::RegularExpression& reg : ignoreFilesRegex) {
if (reg.find(inFile.c_str())) { if (reg.find(inFile)) {
cmCPackLogger(cmCPackLog::LOG_VERBOSE, cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Ignore file: " << inFile << std::endl); "Ignore file: " << inFile << std::endl);
skip = true; skip = true;
......
...@@ -589,7 +589,7 @@ void cmCTestBuildHandler::GenerateXMLLogScraped(cmXMLWriter& xml) ...@@ -589,7 +589,7 @@ void cmCTestBuildHandler::GenerateXMLLogScraped(cmXMLWriter& xml)
for (cmCTestCompileErrorWarningRex& rit : for (cmCTestCompileErrorWarningRex& rit :
this->ErrorWarningFileLineRegex) { this->ErrorWarningFileLineRegex) {
cmsys::RegularExpression* re = &rit.RegularExpression; cmsys::RegularExpression* re = &rit.RegularExpression;
if (re->find(cm->Text.c_str())) { if (re->find(cm->Text)) {
cm->SourceFile = re->match(rit.FileIndex); cm->SourceFile = re->match(rit.FileIndex);
// At this point we need to make this->SourceFile relative to // At this point we need to make this->SourceFile relative to
// the source root of the project, so cvs links will work // the source root of the project, so cvs links will work
......
...@@ -1075,7 +1075,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage( ...@@ -1075,7 +1075,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
if (line.empty()) { if (line.empty()) {
// Ignore empty line; probably style 2 // Ignore empty line; probably style 2
} else if (st1re1.find(line.c_str())) { } else if (st1re1.find(line)) {
if (gcovStyle == 0) { if (gcovStyle == 0) {
gcovStyle = 1; gcovStyle = 1;
} }
...@@ -1088,7 +1088,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage( ...@@ -1088,7 +1088,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
actualSourceFile.clear(); actualSourceFile.clear();
sourceFile = st1re1.match(2); sourceFile = st1re1.match(2);
} else if (st1re2.find(line.c_str())) { } else if (st1re2.find(line)) {
if (gcovStyle == 0) { if (gcovStyle == 0) {
gcovStyle = 1; gcovStyle = 1;
} }
...@@ -1100,7 +1100,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage( ...@@ -1100,7 +1100,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
} }
gcovFile = st1re2.match(1); gcovFile = st1re2.match(1);
} else if (st2re1.find(line.c_str())) { } else if (st2re1.find(line)) {
if (gcovStyle == 0) { if (gcovStyle == 0) {
gcovStyle = 2; gcovStyle = 2;
} }
...@@ -1113,7 +1113,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage( ...@@ -1113,7 +1113,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
actualSourceFile.clear(); actualSourceFile.clear();
sourceFile = st2re1.match(1); sourceFile = st2re1.match(1);
} else if (st2re2.find(line.c_str())) { } else if (st2re2.find(line)) {
if (gcovStyle == 0) { if (gcovStyle == 0) {
gcovStyle = 2; gcovStyle = 2;
} }
...@@ -1123,7 +1123,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage( ...@@ -1123,7 +1123,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
cont->Error++; cont->Error++;
break; break;
} }
} else if (st2re3.find(line.c_str())) { } else if (st2re3.find(line)) {
if (gcovStyle == 0) { if (gcovStyle == 0) {
gcovStyle = 2; gcovStyle = 2;
} }
...@@ -1135,7 +1135,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage( ...@@ -1135,7 +1135,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
} }
gcovFile = st2re3.match(2); gcovFile = st2re3.match(2);
} else if (st2re4.find(line.c_str())) { } else if (st2re4.find(line)) {
if (gcovStyle == 0) { if (gcovStyle == 0) {
gcovStyle = 2; gcovStyle = 2;
} }
...@@ -1150,7 +1150,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage( ...@@ -1150,7 +1150,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
"Warning: " << st2re4.match(1) "Warning: " << st2re4.match(1)
<< " had unexpected EOF" << std::endl, << " had unexpected EOF" << std::endl,
this->Quiet); this->Quiet);
} else if (st2re5.find(line.c_str())) { } else if (st2re5.find(line)) {
if (gcovStyle == 0) { if (gcovStyle == 0) {
gcovStyle = 2; gcovStyle = 2;
} }
...@@ -1165,7 +1165,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage( ...@@ -1165,7 +1165,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
"Warning: Cannot open file: " << st2re5.match(1) "Warning: Cannot open file: " << st2re5.match(1)
<< std::endl, << std::endl,
this->Quiet); this->Quiet);
} else if (st2re6.find(line.c_str())) { } else if (st2re6.find(line)) {
if (gcovStyle == 0) { if (gcovStyle == 0) {
gcovStyle = 2; gcovStyle = 2;
} }
......
...@@ -584,7 +584,7 @@ bool cmCTestLaunch::Match(std::string const& line, ...@@ -584,7 +584,7 @@ bool cmCTestLaunch::Match(std::string const& line,
std::vector<cmsys::RegularExpression>& regexps) std::vector<cmsys::RegularExpression>& regexps)
{ {
for (cmsys::RegularExpression& r : regexps) { for (cmsys::RegularExpression& r : regexps) {
if (r.find(line.c_str())) { if (r.find(line)) {
return true; return true;
} }
} }
......
...@@ -49,7 +49,7 @@ void cmCTestRunTest::CheckOutput(std::string const& line) ...@@ -49,7 +49,7 @@ void cmCTestRunTest::CheckOutput(std::string const& line)
// Check for TIMEOUT_AFTER_MATCH property. // Check for TIMEOUT_AFTER_MATCH property.
if (!this->TestProperties->TimeoutRegularExpressions.empty()) { if (!this->TestProperties->TimeoutRegularExpressions.empty()) {
for (auto& reg : this->TestProperties->TimeoutRegularExpressions) { for (auto& reg : this->TestProperties->TimeoutRegularExpressions) {
if (reg.first.find(this->ProcessOutput.c_str())) { if (reg.first.find(this->ProcessOutput)) {
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
this->GetIndex() this->GetIndex()
<< ": " << ": "
...@@ -148,7 +148,7 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started) ...@@ -148,7 +148,7 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
this->FailedDependencies.empty()) { this->FailedDependencies.empty()) {
bool found = false; bool found = false;
for (auto& pass : this->TestProperties->RequiredRegularExpressions) { for (auto& pass : this->TestProperties->RequiredRegularExpressions) {
if (pass.first.find(this->ProcessOutput.c_str())) { if (pass.first.find(this->ProcessOutput)) {
found = true; found = true;
reason = "Required regular expression found."; reason = "Required regular expression found.";
break; break;
...@@ -168,7 +168,7 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started) ...@@ -168,7 +168,7 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
if (!this->TestProperties->ErrorRegularExpressions.empty() && if (!this->TestProperties->ErrorRegularExpressions.empty() &&
this->FailedDependencies.empty()) { this->FailedDependencies.empty()) {
for (auto& pass : this->TestProperties->ErrorRegularExpressions) { for (auto& pass : this->TestProperties->ErrorRegularExpressions) {
if (pass.first.find(this->ProcessOutput.c_str())) { if (pass.first.find(this->ProcessOutput)) {
reason = "Error regular expression found in output."; reason = "Error regular expression found in output.";
reason += " Regex=["; reason += " Regex=[";
reason += pass.second; reason += pass.second;
...@@ -616,10 +616,10 @@ void cmCTestRunTest::DartProcessing() ...@@ -616,10 +616,10 @@ void cmCTestRunTest::DartProcessing()
{ {
if (!this->ProcessOutput.empty() && if (!this->ProcessOutput.empty() &&
this->ProcessOutput.find("<DartMeasurement") != std::string::npos) { this->ProcessOutput.find("<DartMeasurement") != std::string::npos) {
if (this->TestHandler->DartStuff.find(this->ProcessOutput.c_str())) { if (this->TestHandler->DartStuff.find(this->ProcessOutput)) {
this->TestResult.DartString = this->TestHandler->DartStuff.match(1); this->TestResult.DartString = this->TestHandler->DartStuff.match(1);
// keep searching and replacing until none are left // keep searching and replacing until none are left
while (this->TestHandler->DartStuff1.find(this->ProcessOutput.c_str())) { while (this->TestHandler->DartStuff1.find(this->ProcessOutput)) {
// replace the exact match for the string // replace the exact match for the string
cmSystemTools::ReplaceString( cmSystemTools::ReplaceString(
this->ProcessOutput, this->TestHandler->DartStuff1.match(1).c_str(), this->ProcessOutput, this->TestHandler->DartStuff1.match(1).c_str(),
......
...@@ -2310,7 +2310,7 @@ bool cmCTestTestHandler::AddTest(const std::vector<std::string>& args) ...@@ -2310,7 +2310,7 @@ bool cmCTestTestHandler::AddTest(const std::vector<std::string>& args)
this->Quiet); this->Quiet);
if (this->UseExcludeRegExpFlag && this->UseExcludeRegExpFirst && if (this->UseExcludeRegExpFlag && this->UseExcludeRegExpFirst &&
this->ExcludeTestsRegularExpression.find(testname.c_str())) { this->ExcludeTestsRegularExpression.find(testname)) {
return true; return true;
} }
if (this->MemCheck) { if (this->MemCheck) {
...@@ -2365,10 +2365,10 @@ bool cmCTestTestHandler::AddTest(const std::vector<std::string>& args) ...@@ -2365,10 +2365,10 @@ bool cmCTestTestHandler::AddTest(const std::vector<std::string>& args)
test.SkipReturnCode = -1; test.SkipReturnCode = -1;
test.PreviousRuns = 0; test.PreviousRuns = 0;
if (this->UseIncludeRegExpFlag && if (this->UseIncludeRegExpFlag &&
!this->IncludeTestsRegularExpression.find(testname.c_str())) { !this->IncludeTestsRegularExpression.find(testname)) {
test.IsInBasedOnREOptions = false; test.IsInBasedOnREOptions = false;
} else if (this->UseExcludeRegExpFlag && !this->UseExcludeRegExpFirst && } else if (this->UseExcludeRegExpFlag && !this->UseExcludeRegExpFirst &&
this->ExcludeTestsRegularExpression.find(testname.c_str())) { this->ExcludeTestsRegularExpression.find(testname)) {
test.IsInBasedOnREOptions = false; test.IsInBasedOnREOptions = false;
} }
this->TestList.push_back(test); this->TestList.push_back(test);
......
...@@ -40,8 +40,8 @@ bool cmBuildNameCommand::InitialPass(std::vector<std::string> const& args, ...@@ -40,8 +40,8 @@ bool cmBuildNameCommand::InitialPass(std::vector<std::string> const& args,
cmSystemTools::RunSingleCommand("uname -a", &buildname, &buildname); cmSystemTools::RunSingleCommand("uname -a", &buildname, &buildname);
if (!buildname.empty()) { if (!buildname.empty()) {
std::string RegExp = "([^ ]*) [^ ]* ([^ ]*) "; std::string RegExp = "([^ ]*) [^ ]* ([^ ]*) ";
cmsys::RegularExpression reg(RegExp.c_str()); cmsys::RegularExpression reg(RegExp);
if (reg.find(buildname.c_str())) { if (reg.find(buildname)) {
buildname = reg.match(1) + "-" + reg.match(2); buildname = reg.match(1) + "-" + reg.match(2);
} }
} }
......
...@@ -174,7 +174,7 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources, ...@@ -174,7 +174,7 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources,
// Complain if the file cannot be found and matches the complain // Complain if the file cannot be found and matches the complain
// regex. // regex.
if (fullName.empty() && if (fullName.empty() &&
this->IncludeRegexComplain.find(current.FileName.c_str())) { this->IncludeRegexComplain.find(current.FileName)) {
cmSystemTools::Error("Cannot find file \"", current.FileName.c_str(), cmSystemTools::Error("Cannot find file \"", current.FileName.c_str(),
"\"."); "\".");
return false; return false;
...@@ -359,7 +359,7 @@ void cmDependsC::Scan(std::istream& is, const char* directory, ...@@ -359,7 +359,7 @@ void cmDependsC::Scan(std::istream& is, const char* directory,
} }
// Match include directives. // Match include directives.
if (this->IncludeRegexLine.find(line.c_str())) { if (this->IncludeRegexLine.find(line)) {
// Get the file being included. // Get the file being included.
UnscannedEntry entry; UnscannedEntry entry;
entry.FileName = this->IncludeRegexLine.match(2); entry.FileName = this->IncludeRegexLine.match(2);
...@@ -383,7 +383,7 @@ void cmDependsC::Scan(std::istream& is, const char* directory, ...@@ -383,7 +383,7 @@ void cmDependsC::Scan(std::istream& is, const char* directory,
// file their own directory by simply using "filename.h" (#12619) // file their own directory by simply using "filename.h" (#12619)
// This kind of problem will be fixed when a more // This kind of problem will be fixed when a more
// preprocessor-like implementation of this scanner is created. // preprocessor-like implementation of this scanner is created.
if (this->IncludeRegexScan.find(entry.FileName.c_str())) { if (this->IncludeRegexScan.find(entry.FileName)) {
newCacheEntry->UnscannedEntries.push_back(entry); newCacheEntry->UnscannedEntries.push_back(entry);
if (this->Encountered.find(entry.FileName) == if (this->Encountered.find(entry.FileName) ==
this->Encountered.end()) { this->Encountered.end()) {
...@@ -449,7 +449,7 @@ void cmDependsC::ParseTransform(std::string const& xform) ...@@ -449,7 +449,7 @@ void cmDependsC::ParseTransform(std::string const& xform)
void cmDependsC::TransformLine(std::string& line) void cmDependsC::TransformLine(std::string& line)
{ {
// Check for a transform rule match. Return if none. // Check for a transform rule match. Return if none.
if (!this->IncludeRegexTransform.find(line.c_str())) { if (!this->IncludeRegexTransform.find(line)) {
return; return;
} }
TransformRulesType::const_iterator tri = TransformRulesType::const_iterator tri =
......
...@@ -237,7 +237,7 @@ bool cmExportCommand::HandlePackage(std::vector<std::string> const& args) ...@@ -237,7 +237,7 @@ bool cmExportCommand::HandlePackage(std::vector<std::string> const& args)
} }
const char* packageExpr = "^[A-Za-z0-9_.-]+$"; const char* packageExpr = "^[A-Za-z0-9_.-]+$";
cmsys::RegularExpression packageRegex(packageExpr); cmsys::RegularExpression packageRegex(packageExpr);
if (!packageRegex.find(package.c_str())) { if (!packageRegex.find(package)) {
std::ostringstream e; std::ostringstream e;
e << "PACKAGE given invalid package name \"" << package << "\". " e << "PACKAGE given invalid package name \"" << package << "\". "
<< "Package names must match \"" << packageExpr << "\"."; << "Package names must match \"" << packageExpr << "\".";
......
...@@ -98,7 +98,7 @@ void cmExtraEclipseCDT4Generator::Generate() ...@@ -98,7 +98,7 @@ void cmExtraEclipseCDT4Generator::Generate()
std::string eclipseVersion = mf->GetSafeDefinition("CMAKE_ECLIPSE_VERSION"); std::string eclipseVersion = mf->GetSafeDefinition("CMAKE_ECLIPSE_VERSION");
cmsys::RegularExpression regex(".*([0-9]+\\.[0-9]+).*"); cmsys::RegularExpression regex(".*([0-9]+\\.[0-9]+).*");
if (regex.find(eclipseVersion.c_str())) { if (regex.find(eclipseVersion)) {
unsigned int majorVersion = 0; unsigned int majorVersion = 0;
unsigned int minorVersion = 0; unsigned int minorVersion = 0;
int res = int res =
...@@ -555,7 +555,7 @@ void cmExtraEclipseCDT4Generator::AppendIncludeDirectories( ...@@ -555,7 +555,7 @@ void cmExtraEclipseCDT4Generator::AppendIncludeDirectories(
// Frameworks/ part has to be stripped // Frameworks/ part has to be stripped
// /System/Library/Frameworks/GLUT.framework/Headers // /System/Library/Frameworks/GLUT.framework/Headers
cmsys::RegularExpression frameworkRx("(.+/Frameworks)/.+\\.framework/"); cmsys::RegularExpression frameworkRx("(.+/Frameworks)/.+\\.framework/");
if (frameworkRx.find(dir.c_str())) { if (frameworkRx.find(dir)) {
dir = frameworkRx.match(1); dir = frameworkRx.match(1);
} }
......
...@@ -663,7 +663,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args) ...@@ -663,7 +663,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
// The current line has been terminated. Check if the current // The current line has been terminated. Check if the current
// string matches the requirements. The length may now be as // string matches the requirements. The length may now be as
// low as zero since blank lines are allowed. // low as zero since blank lines are allowed.
if (s.length() >= minlen && (!have_regex || regex.find(s.c_str()))) { if (s.length() >= minlen && (!have_regex || regex.find(s))) {
output_size += static_cast<int>(s.size()) + 1; output_size += static_cast<int>(s.size()) + 1;
if (limit_output >= 0 && output_size >= limit_output) { if (limit_output >= 0 && output_size >= limit_output) {
s.clear(); s.clear();
...@@ -679,7 +679,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args) ...@@ -679,7 +679,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
// string matches the requirements. We require that the length // string matches the requirements. We require that the length
// be at least one no matter what the user specified. // be at least one no matter what the user specified.
if (s.length() >= minlen && !s.empty() && if (s.length() >= minlen && !s.empty() &&
(!have_regex || regex.find(s.c_str()))) { (!have_regex || regex.find(s))) {
output_size += static_cast<int>(s.size()) + 1; output_size += static_cast<int>(s.size()) + 1;
if (limit_output >= 0 && output_size >= limit_output) { if (limit_output >= 0 && output_size >= limit_output) {
s.clear(); s.clear();
...@@ -696,7 +696,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args) ...@@ -696,7 +696,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
if (maxlen > 0 && s.size() == maxlen) { if (maxlen > 0 && s.size() == maxlen) {
// Terminate a string if the maximum length is reached. // Terminate a string if the maximum length is reached.
if (s.length() >= minlen && (!have_regex || regex.find(s.c_str()))) { if (s.length() >= minlen && (!have_regex || regex.find(s))) {
output_size += static_cast<int>(s.size()) + 1; output_size += static_cast<int>(s.size()) + 1;
if (limit_output >= 0 && output_size >= limit_output) { if (limit_output >= 0 && output_size >= limit_output) {
s.clear(); s.clear();
...@@ -712,7 +712,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args) ...@@ -712,7 +712,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
// input file or the input size limit. Check if the current string // input file or the input size limit. Check if the current string
// matches the requirements. // matches the requirements.
if ((!limit_count || strings.size() < limit_count) && !s.empty() && if ((!limit_count || strings.size() < limit_count) && !s.empty() &&
s.length() >= minlen && (!have_regex || regex.find(s.c_str()))) { s.length() >= minlen && (!have_regex || regex.find(s))) {
output_size += static_cast<int>(s.size()) + 1; output_size += static_cast<int>(s.size()) + 1;
if (limit_output < 0 || output_size < limit_output) { if (limit_output < 0 || output_size < limit_output) {
strings.push_back(s); strings.push_back(s);
......
...@@ -337,7 +337,7 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args, ...@@ -337,7 +337,7 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args,
return false; return false;
} }
this->Configs.push_back(args[i]); this->Configs.push_back(args[i]);
} else if (!haveVersion && version.find(args[i].c_str())) { } else if (!haveVersion && version.find(args[i])) {
haveVersion = true; haveVersion = true;
this->Version = args[i]; this->Version = args[i];
} else { } else {
......
...@@ -1126,7 +1126,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode ...@@ -1126,7 +1126,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
std::string targetName = parameters.front(); std::string targetName = parameters.front();
propertyName = parameters[1]; propertyName = parameters[1];
if (!cmGeneratorExpression::IsValidTargetName(targetName)) { if (!cmGeneratorExpression::IsValidTargetName(targetName)) {
if (!propertyNameValidator.find(propertyName.c_str())) { if (!propertyNameValidator.find(propertyName)) {
::reportError(context, content->GetOriginalExpression(), ::reportError(context, content->GetOriginalExpression(),
"Target name and property name not supported."); "Target name and property name not supported.");
return std::string(); return std::string();
......
...@@ -1139,7 +1139,7 @@ void cmGeneratorTarget::ComputeKindedSources(KindedSources& files, ...@@ -1139,7 +1139,7 @@ void cmGeneratorTarget::ComputeKindedSources(KindedSources& files,
std::string cppFileName = xaml + ".cpp"; std::string cppFileName = xaml + ".cpp";
files.ExpectedXamlHeaders.insert(hFileName); files.ExpectedXamlHeaders.insert(hFileName);
files.ExpectedXamlSources.insert(cppFileName); files.ExpectedXamlSources.insert(cppFileName);
} else if (header_regex.find(sf->GetFullPath().c_str())) { } else if (header_regex.find(sf->GetFullPath())) {
kind = SourceKindHeader; kind = SourceKindHeader;
} else { } else {
kind = SourceKindExtra; kind = SourceKindExtra;
......
...@@ -1971,7 +1971,7 @@ void cmLocalGenerator::AppendCompileOptions( ...@@ -1971,7 +1971,7 @@ void cmLocalGenerator::AppendCompileOptions(
cmsys::RegularExpression r(regex); cmsys::RegularExpression r(regex);
for (std::string const& opt : options_vec) { for (std::string const& opt : options_vec) {
if (r.find(opt.c_str())) { if (r.find(opt)) {
this->AppendFlagEscape(options, opt); this->AppendFlagEscape(options, opt);
} }
} }
......
...@@ -356,8 +356,7 @@ protected: ...@@ -356,8 +356,7 @@ protected:
if (!found) { if (!found) {
// Couldn't find any dependency information. // Couldn't find any dependency information.
if (this->ComplainFileRegularExpression.find( if (this->ComplainFileRegularExpression.find(info->IncludeName)) {
info->IncludeName.c_str())) {
cmSystemTools::Error("error cannot find dependencies for ", path); cmSystemTools::Error("error cannot find dependencies for ", path);
} else { } else {
// Destroy the name of the file so that it won't be output as a // Destroy the name of the file so that it won't be output as a
......
...@@ -273,7 +273,7 @@ bool cmStringCommand::RegexMatch(std::vector<std::string> const& args) ...@@ -273,7 +273,7 @@ bool cmStringCommand::RegexMatch(std::vector<std::string> const& args)
// Scan through the input for all matches. // Scan through the input for all matches.
std::string output; std::string output;
if (re.find(input.c_str())) { if (re.find(input)) {
this->Makefile->StoreMatches(re); this->Makefile->StoreMatches(re);
std::string::size_type l = re.start(); std::string::size_type l = re.start();
std::string::size_type r = re.end(); std::string::size_type r = re.end();
......
...@@ -82,12 +82,12 @@ void cmUseMangledMesaCommand::CopyAndFullPathMesaHeader(const char* source, ...@@ -82,12 +82,12 @@ void cmUseMangledMesaCommand::CopyAndFullPathMesaHeader(const char* source,
// regular expression for gl GL or xmesa in a file (match(1) of above) // regular expression for gl GL or xmesa in a file (match(1) of above)
cmsys::RegularExpression glLine("(gl|GL|xmesa)"); cmsys::RegularExpression glLine("(gl|GL|xmesa)");
while (cmSystemTools::GetLineFromStream(fin, inLine)) { while (cmSystemTools::GetLineFromStream(fin, inLine)) {
if (includeLine.find(inLine.c_str())) { if (includeLine.find(inLine)) {
std::string includeFile = includeLine.match(1); std::string includeFile = includeLine.match(1);
if (glDirLine.find(includeFile.c_str())) { if (glDirLine.find(includeFile)) {
std::string gfile = glDirLine.match(3); std::string gfile = glDirLine.match(3);
fout << "#include \"" << outdir << "/" << gfile << "\"\n"; fout << "#include \"" << outdir << "/" << gfile << "\"\n";
} else if (glLine.find(includeFile.c_str())) { } else if (glLine.find(includeFile)) {
fout << "#include \"" << outdir << "/" << includeLine.match(1) fout << "#include \"" << outdir << "/" << includeLine.match(1)
<< "\"\n"; << "\"\n";
} else { } else {
......
...@@ -407,7 +407,7 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args) ...@@ -407,7 +407,7 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
for (std::string const& ck : cacheKeys) { for (std::string const& ck : cacheKeys) {
cmStateEnums::CacheEntryType t = this->State->GetCacheEntryType(ck); cmStateEnums::CacheEntryType t = this->State->GetCacheEntryType(ck);
if (t != cmStateEnums::STATIC) { if (t != cmStateEnums::STATIC) {
if (regex.find(ck.c_str())) { if (regex.find(ck)) {
entriesToDelete.push_back(ck); entriesToDelete.push_back(ck);
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment