This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake".
The branch, master has been updated via ca7ec2e188a6f66546a0f5dc9e76a6f24c22bfa6 (commit) via da79075c4de45095d8f9eca5d2cc76711b79341e (commit) via f79e684678fb481c91586bd015d03bfb9e1a019b (commit) via a2daa3ef2706bf3d0436d5d6ef91d263cd98bf6c (commit) via 37b998dd3e8f2b64baaa1cd714b6a7878d3d72c3 (commit) via dcdeade5ee2c1410563fc1bd422ea3a3acc2febc (commit) via 6618cbf38aa8298a5881669d8b095a4110f102f6 (commit) via 8d2299975393bb341d7afe8bdd200b8dbe3010e3 (commit) via 282d9f31685906cd45b27961ea013edab8bacd6b (commit) via d96bc3cf048756695a651a8561b763cfc5cead86 (commit) via c1fc6c80c777172139e67753530f610d642a4656 (commit) via 3bed969dace917e5bf551c6783da425f5e2217c7 (commit) via faacb90a13f87d32aaf3e5c45cfd48af7e84b733 (commit) via 8738e2584a111de065341296dcfa1f4ac9c68346 (commit) from 1bdb5a3b5113a075393a0760888604684c43c64b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ca7ec2e188a6f66546a0f5dc9e76a6f24c22bfa6 commit ca7ec2e188a6f66546a0f5dc9e76a6f24c22bfa6 Merge: f79e684 da79075 Author: Brad King <brad.k...@kitware.com> AuthorDate: Fri Jul 19 16:02:44 2019 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Fri Jul 19 12:02:53 2019 -0400 Merge topic 'ctest-done-hash' da79075c4d CTest: Generate Done.xml before calculating its hash Acked-by: Kitware Robot <kwro...@kitware.com> Merge-request: !3563 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=da79075c4de45095d8f9eca5d2cc76711b79341e commit da79075c4de45095d8f9eca5d2cc76711b79341e Author: Betsy McPhail <betsy.mcph...@kitware.com> AuthorDate: Wed Jul 17 10:02:02 2019 -0400 Commit: Brad King <brad.k...@kitware.com> CommitDate: Fri Jul 19 12:00:30 2019 -0400 CTest: Generate Done.xml before calculating its hash Fixes: #19489 diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 1fa7988..54c4bae 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -266,15 +266,6 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP( } } - upload_as += "&MD5="; - - if (cmSystemTools::IsOn(this->GetOption("InternalTest"))) { - upload_as += "bad_md5sum"; - } else { - upload_as += - cmSystemTools::ComputeFileHash(local_file, cmCryptoHash::AlgoMD5); - } - // Generate Done.xml right before it is submitted. // The reason for this is two-fold: // 1) It must be generated after some other part has been submitted @@ -286,6 +277,15 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP( this->CTest->GenerateDoneFile(); } + upload_as += "&MD5="; + + if (cmSystemTools::IsOn(this->GetOption("InternalTest"))) { + upload_as += "bad_md5sum"; + } else { + upload_as += + cmSystemTools::ComputeFileHash(local_file, cmCryptoHash::AlgoMD5); + } + if (!cmSystemTools::FileExists(local_file)) { cmCTestLog(this->CTest, ERROR_MESSAGE, " Cannot find file: " << local_file << std::endl); https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f79e684678fb481c91586bd015d03bfb9e1a019b commit f79e684678fb481c91586bd015d03bfb9e1a019b Merge: a2daa3e 8738e25 Author: Brad King <brad.k...@kitware.com> AuthorDate: Fri Jul 19 15:59:05 2019 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Fri Jul 19 12:00:12 2019 -0400 Merge topic 'QCC-ninja-support' 8738e2584a cmGlobalNinjaGenerator: Use gnu compatible paths with QCC Acked-by: Kitware Robot <kwro...@kitware.com> Merge-request: !3567 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a2daa3ef2706bf3d0436d5d6ef91d263cd98bf6c commit a2daa3ef2706bf3d0436d5d6ef91d263cd98bf6c Merge: 37b998d 3bed969 Author: Brad King <brad.k...@kitware.com> AuthorDate: Fri Jul 19 15:58:51 2019 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Fri Jul 19 11:59:04 2019 -0400 Merge topic 'modernize_std_unique_ptr' 3bed969dac cmMakefile: Modernize AddFunctionBlocker method to accept a std::unique_ptr faacb90a13 cmELF: Modernize to use std::unique_ptr instead of new/delete Acked-by: Kitware Robot <kwro...@kitware.com> Merge-request: !3548 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=37b998dd3e8f2b64baaa1cd714b6a7878d3d72c3 commit 37b998dd3e8f2b64baaa1cd714b6a7878d3d72c3 Merge: dcdeade 8d22999 Author: Brad King <brad.k...@kitware.com> AuthorDate: Fri Jul 19 11:57:30 2019 -0400 Commit: Brad King <brad.k...@kitware.com> CommitDate: Fri Jul 19 11:57:30 2019 -0400 Merge branch 'release-3.15' https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dcdeade5ee2c1410563fc1bd422ea3a3acc2febc commit dcdeade5ee2c1410563fc1bd422ea3a3acc2febc Merge: 6618cbf 282d9f3 Author: Brad King <brad.k...@kitware.com> AuthorDate: Fri Jul 19 15:55:51 2019 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Fri Jul 19 11:57:10 2019 -0400 Merge topic 'msvc-runtime-library-doc' 282d9f3168 MSVC: Document behavior when MSVC_RUNTIME_LIBRARY is not set Acked-by: Kitware Robot <kwro...@kitware.com> Merge-request: !3573 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6618cbf38aa8298a5881669d8b095a4110f102f6 commit 6618cbf38aa8298a5881669d8b095a4110f102f6 Merge: 1bdb5a3 c1fc6c8 Author: Brad King <brad.k...@kitware.com> AuthorDate: Fri Jul 19 15:55:37 2019 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Fri Jul 19 11:55:48 2019 -0400 Merge topic 'vs-asmlist-dir' c1fc6c80c7 VS: Place intermediate files in the "ASM List Location" next to objects Acked-by: Kitware Robot <kwro...@kitware.com> Merge-request: !3569 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3bed969dace917e5bf551c6783da425f5e2217c7 commit 3bed969dace917e5bf551c6783da425f5e2217c7 Author: Sebastian Holtermann <sebh...@xwmw.org> AuthorDate: Fri Jul 12 12:15:21 2019 +0200 Commit: Sebastian Holtermann <sebh...@xwmw.org> CommitDate: Wed Jul 17 14:58:27 2019 +0200 cmMakefile: Modernize AddFunctionBlocker method to accept a std::unique_ptr diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index 861bd06..85040dd 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -4,13 +4,6 @@ #include "cmsys/Directory.hxx" #include "cmsys/Process.h" -#include <map> -#include <ratio> -#include <sstream> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <utility> #include "cm_memory.hxx" @@ -41,6 +34,15 @@ #include "cmSystemTools.h" #include "cmake.h" +#include <map> +#include <memory> +#include <ratio> +#include <sstream> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <utility> + #ifdef _WIN32 # include <windows.h> #else @@ -372,9 +374,11 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg) #endif // always add a function blocker to update the elapsed time - cmCTestScriptFunctionBlocker* f = new cmCTestScriptFunctionBlocker(); - f->CTestScriptHandler = this; - this->Makefile->AddFunctionBlocker(f); + { + auto fb = cm::make_unique<cmCTestScriptFunctionBlocker>(); + fb->CTestScriptHandler = this; + this->Makefile->AddFunctionBlocker(std::move(fb)); + } /* Execute CTestScriptMode.cmake, which loads CMakeDetermineSystem and CMakeSystemSpecificInformation, so diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx index 94c1b1a..a30ebe1 100644 --- a/Source/cmForEachCommand.cxx +++ b/Source/cmForEachCommand.cxx @@ -5,6 +5,7 @@ #include <sstream> #include <stdio.h> #include <stdlib.h> +#include <utility> #include "cm_memory.hxx" @@ -121,7 +122,7 @@ bool cmForEachCommand::InitialPass(std::vector<std::string> const& args, } // create a function blocker - auto f = cm::make_unique<cmForEachFunctionBlocker>(this->Makefile); + auto fb = cm::make_unique<cmForEachFunctionBlocker>(this->Makefile); if (args.size() > 1) { if (args[1] == "RANGE") { int start = 0; @@ -168,23 +169,22 @@ bool cmForEachCommand::InitialPass(std::vector<std::string> const& args, break; } } - f->Args = range; + fb->Args = range; } else { - f->Args = args; + fb->Args = args; } } else { - f->Args = args; + fb->Args = args; } - this->Makefile->AddFunctionBlocker(f.release()); + this->Makefile->AddFunctionBlocker(std::move(fb)); return true; } bool cmForEachCommand::HandleInMode(std::vector<std::string> const& args) { - std::unique_ptr<cmForEachFunctionBlocker> f( - new cmForEachFunctionBlocker(this->Makefile)); - f->Args.push_back(args[0]); + auto fb = cm::make_unique<cmForEachFunctionBlocker>(this->Makefile); + fb->Args.push_back(args[0]); enum Doing { @@ -195,7 +195,7 @@ bool cmForEachCommand::HandleInMode(std::vector<std::string> const& args) Doing doing = DoingNone; for (unsigned int i = 2; i < args.size(); ++i) { if (doing == DoingItems) { - f->Args.push_back(args[i]); + fb->Args.push_back(args[i]); } else if (args[i] == "LISTS") { doing = DoingLists; } else if (args[i] == "ITEMS") { @@ -203,7 +203,7 @@ bool cmForEachCommand::HandleInMode(std::vector<std::string> const& args) } else if (doing == DoingLists) { const char* value = this->Makefile->GetDefinition(args[i]); if (value && *value) { - cmSystemTools::ExpandListArgument(value, f->Args, true); + cmSystemTools::ExpandListArgument(value, fb->Args, true); } } else { std::ostringstream e; @@ -214,7 +214,7 @@ bool cmForEachCommand::HandleInMode(std::vector<std::string> const& args) } } - this->Makefile->AddFunctionBlocker(f.release()); // TODO: pass unique_ptr + this->Makefile->AddFunctionBlocker(std::move(fb)); return true; } diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx index 8e003ad..6d06531 100644 --- a/Source/cmFunctionCommand.cxx +++ b/Source/cmFunctionCommand.cxx @@ -179,8 +179,10 @@ bool cmFunctionCommand::InitialPass(std::vector<std::string> const& args, } // create a function blocker - cmFunctionFunctionBlocker* f = new cmFunctionFunctionBlocker(); - cmAppend(f->Args, args); - this->Makefile->AddFunctionBlocker(f); + { + auto fb = cm::make_unique<cmFunctionFunctionBlocker>(); + cmAppend(fb->Args, args); + this->Makefile->AddFunctionBlocker(std::move(fb)); + } return true; } diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx index c58ad06..625dd45 100644 --- a/Source/cmIfCommand.cxx +++ b/Source/cmIfCommand.cxx @@ -2,6 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmIfCommand.h" +#include "cm_memory.hxx" + #include "cmConditionEvaluator.h" #include "cmExecutionStatus.h" #include "cmExpandedCommandArgument.h" @@ -11,6 +13,8 @@ #include "cmSystemTools.h" #include "cmake.h" +#include <utility> + static std::string cmIfCommandError( std::vector<cmExpandedCommandArgument> const& args) { @@ -200,15 +204,17 @@ bool cmIfCommand::InvokeInitialPass( this->Makefile->IssueMessage(status, err); } - cmIfFunctionBlocker* f = new cmIfFunctionBlocker(); - // if is isn't true block the commands - f->ScopeDepth = 1; - f->IsBlocking = !isTrue; - if (isTrue) { - f->HasRun = true; + { + auto fb = cm::make_unique<cmIfFunctionBlocker>(); + // if is isn't true block the commands + fb->ScopeDepth = 1; + fb->IsBlocking = !isTrue; + if (isTrue) { + fb->HasRun = true; + } + fb->Args = args; + this->Makefile->AddFunctionBlocker(std::move(fb)); } - f->Args = args; - this->Makefile->AddFunctionBlocker(f); return true; } diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx index 3d553b7..6e65c6b 100644 --- a/Source/cmMacroCommand.cxx +++ b/Source/cmMacroCommand.cxx @@ -213,8 +213,10 @@ bool cmMacroCommand::InitialPass(std::vector<std::string> const& args, } // create a function blocker - cmMacroFunctionBlocker* f = new cmMacroFunctionBlocker(); - cmAppend(f->Args, args); - this->Makefile->AddFunctionBlocker(f); + { + auto fb = cm::make_unique<cmMacroFunctionBlocker>(); + cmAppend(fb->Args, args); + this->Makefile->AddFunctionBlocker(std::move(fb)); + } return true; } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 501ea69..5ae3a29 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -118,7 +118,6 @@ cmMakefile::~cmMakefile() cmDeleteAll(this->SourceFiles); cmDeleteAll(this->Tests); cmDeleteAll(this->ImportedTargetsOwned); - cmDeleteAll(this->FunctionBlockers); cmDeleteAll(this->EvaluationFiles); } @@ -3076,13 +3075,13 @@ bool cmMakefile::IsFunctionBlocked(const cmListFileFunction& lff, cmExecutionStatus& status) { // if there are no blockers get out of here - if (this->FunctionBlockers.begin() == this->FunctionBlockers.end()) { + if (this->FunctionBlockers.empty()) { return false; } // loop over all function blockers to see if any block this command // evaluate in reverse, this is critical for balanced IF statements etc - for (cmFunctionBlocker* pos : cmReverseRange(this->FunctionBlockers)) { + for (auto const& pos : cmReverseRange(this->FunctionBlockers)) { if (pos->IsFunctionBlocked(lff, *this, status)) { return true; } @@ -3102,7 +3101,8 @@ void cmMakefile::PopFunctionBlockerBarrier(bool reportError) FunctionBlockersType::size_type barrier = this->FunctionBlockerBarriers.back(); while (this->FunctionBlockers.size() > barrier) { - std::unique_ptr<cmFunctionBlocker> fb(this->FunctionBlockers.back()); + std::unique_ptr<cmFunctionBlocker> fb( + std::move(this->FunctionBlockers.back())); this->FunctionBlockers.pop_back(); if (reportError) { // Report the context in which the unclosed block was opened. @@ -3227,14 +3227,14 @@ bool cmMakefile::ExpandArguments( return !cmSystemTools::GetFatalErrorOccured(); } -void cmMakefile::AddFunctionBlocker(cmFunctionBlocker* fb) +void cmMakefile::AddFunctionBlocker(std::unique_ptr<cmFunctionBlocker> fb) { if (!this->ExecutionStatusStack.empty()) { // Record the context in which the blocker is created. fb->SetStartingContext(this->GetExecutionContext()); } - this->FunctionBlockers.push_back(fb); + this->FunctionBlockers.push_back(std::move(fb)); } std::unique_ptr<cmFunctionBlocker> cmMakefile::RemoveFunctionBlocker( @@ -3250,9 +3250,8 @@ std::unique_ptr<cmFunctionBlocker> cmMakefile::RemoveFunctionBlocker( // Search for the function blocker whose scope this command ends. for (FunctionBlockersType::size_type i = this->FunctionBlockers.size(); i > barrier; --i) { - std::vector<cmFunctionBlocker*>::iterator pos = - this->FunctionBlockers.begin() + (i - 1); - if (*pos == fb) { + auto pos = this->FunctionBlockers.begin() + (i - 1); + if (pos->get() == fb) { // Warn if the arguments do not match, but always remove. if (!(*pos)->ShouldRemove(lff, *this)) { cmListFileContext const& lfc = fb->GetStartingContext(); @@ -3268,9 +3267,9 @@ std::unique_ptr<cmFunctionBlocker> cmMakefile::RemoveFunctionBlocker( /* clang-format on */ this->IssueMessage(MessageType::AUTHOR_WARNING, e.str()); } - cmFunctionBlocker* b = *pos; + std::unique_ptr<cmFunctionBlocker> b = std::move(*pos); this->FunctionBlockers.erase(pos); - return std::unique_ptr<cmFunctionBlocker>(b); + return b; } } diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 1b4ead7..924cf24 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -17,6 +17,7 @@ #include <vector> #include "cmAlgorithms.h" +#include "cmFunctionBlocker.h" #include "cmListFileCache.h" #include "cmMessageType.h" #include "cmNewLineStyle.h" @@ -36,7 +37,6 @@ class cmCustomCommandLines; class cmExecutionStatus; class cmExpandedCommandArgument; class cmExportBuildFileGenerator; -class cmFunctionBlocker; class cmGeneratorExpressionEvaluationFile; class cmGlobalGenerator; class cmInstallGenerator; @@ -95,7 +95,7 @@ public: /** * Add a function blocker to this makefile */ - void AddFunctionBlocker(cmFunctionBlocker* fb); + void AddFunctionBlocker(std::unique_ptr<cmFunctionBlocker> fb); /// @return whether we are processing the top CMakeLists.txt file. bool IsRootMakefile() const; @@ -955,7 +955,7 @@ private: bool EnforceUniqueDir(const std::string& srcPath, const std::string& binPath) const; - typedef std::vector<cmFunctionBlocker*> FunctionBlockersType; + typedef std::vector<std::unique_ptr<cmFunctionBlocker>> FunctionBlockersType; FunctionBlockersType FunctionBlockers; std::vector<FunctionBlockersType::size_type> FunctionBlockerBarriers; void PushFunctionBlockerBarrier(); diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx index 31a878d..a902964 100644 --- a/Source/cmWhileCommand.cxx +++ b/Source/cmWhileCommand.cxx @@ -2,6 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmWhileCommand.h" +#include "cm_memory.hxx" + #include "cmConditionEvaluator.h" #include "cmExecutionStatus.h" #include "cmExpandedCommandArgument.h" @@ -9,6 +11,8 @@ #include "cmMessageType.h" #include "cmSystemTools.h" +#include <utility> + cmWhileFunctionBlocker::cmWhileFunctionBlocker(cmMakefile* mf) : Makefile(mf) , Depth(0) @@ -134,9 +138,10 @@ bool cmWhileCommand::InvokeInitialPass( } // create a function blocker - cmWhileFunctionBlocker* f = new cmWhileFunctionBlocker(this->Makefile); - f->Args = args; - this->Makefile->AddFunctionBlocker(f); - + { + auto fb = cm::make_unique<cmWhileFunctionBlocker>(this->Makefile); + fb->Args = args; + this->Makefile->AddFunctionBlocker(std::move(fb)); + } return true; } https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=faacb90a13f87d32aaf3e5c45cfd48af7e84b733 commit faacb90a13f87d32aaf3e5c45cfd48af7e84b733 Author: Sebastian Holtermann <sebh...@xwmw.org> AuthorDate: Sun Jul 14 18:20:53 2019 +0200 Commit: Sebastian Holtermann <sebh...@xwmw.org> CommitDate: Wed Jul 17 14:58:27 2019 +0200 cmELF: Modernize to use std::unique_ptr instead of new/delete diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx index 51eb814..096016d 100644 --- a/Source/cmELF.cxx +++ b/Source/cmELF.cxx @@ -4,6 +4,7 @@ #include "cmAlgorithms.h" #include "cm_kwiml.h" +#include "cm_memory.hxx" #include "cmsys/FStream.hxx" #include <map> #include <memory> @@ -109,10 +110,10 @@ public: }; // Construct and take ownership of the file stream object. - cmELFInternal(cmELF* external, std::unique_ptr<cmsys::ifstream>& fin, + cmELFInternal(cmELF* external, std::unique_ptr<std::istream> fin, ByteOrderType order) : External(external) - , Stream(*fin.release()) + , Stream(std::move(fin)) , ByteOrder(order) , ELFType(cmELF::FileTypeInvalid) { @@ -132,7 +133,7 @@ public: } // Destruct and delete the file stream object. - virtual ~cmELFInternal() { delete &this->Stream; } + virtual ~cmELFInternal() = default; // Forward to the per-class implementation. virtual unsigned int GetNumberOfSections() const = 0; @@ -171,7 +172,7 @@ protected: cmELF* External; // The stream from which to read. - std::istream& Stream; + std::unique_ptr<std::istream> Stream; // The byte order of the ELF file. ByteOrderType ByteOrder; @@ -233,7 +234,7 @@ public: typedef typename Types::tagtype tagtype; // Construct with a stream and byte swap indicator. - cmELFInternalImpl(cmELF* external, std::unique_ptr<cmsys::ifstream>& fin, + cmELFInternalImpl(cmELF* external, std::unique_ptr<std::istream> fin, ByteOrderType order); // Return the number of sections as specified by the ELF header. @@ -352,7 +353,7 @@ private: bool Read(ELF_Ehdr& x) { // Read the header from the file. - if (!this->Stream.read(reinterpret_cast<char*>(&x), sizeof(x))) { + if (!this->Stream->read(reinterpret_cast<char*>(&x), sizeof(x))) { return false; } @@ -382,26 +383,26 @@ private: } bool Read(ELF_Shdr& x) { - if (this->Stream.read(reinterpret_cast<char*>(&x), sizeof(x)) && + if (this->Stream->read(reinterpret_cast<char*>(&x), sizeof(x)) && this->NeedSwap) { ByteSwap(x); } - return !this->Stream.fail(); + return !this->Stream->fail(); } bool Read(ELF_Dyn& x) { - if (this->Stream.read(reinterpret_cast<char*>(&x), sizeof(x)) && + if (this->Stream->read(reinterpret_cast<char*>(&x), sizeof(x)) && this->NeedSwap) { ByteSwap(x); } - return !this->Stream.fail(); + return !this->Stream->fail(); } bool LoadSectionHeader(ELF_Half i) { // Read the section header from the file. - this->Stream.seekg(this->ELFHeader.e_shoff + - this->ELFHeader.e_shentsize * i); + this->Stream->seekg(this->ELFHeader.e_shoff + + this->ELFHeader.e_shentsize * i); if (!this->Read(this->SectionHeaders[i])) { return false; } @@ -426,9 +427,10 @@ private: }; template <class Types> -cmELFInternalImpl<Types>::cmELFInternalImpl( - cmELF* external, std::unique_ptr<cmsys::ifstream>& fin, ByteOrderType order) - : cmELFInternal(external, fin, order) +cmELFInternalImpl<Types>::cmELFInternalImpl(cmELF* external, + std::unique_ptr<std::istream> fin, + ByteOrderType order) + : cmELFInternal(external, std::move(fin), order) { // Read the main header. if (!this->Read(this->ELFHeader)) { @@ -510,7 +512,7 @@ bool cmELFInternalImpl<Types>::LoadDynamicSection() // Read each entry. for (int j = 0; j < n; ++j) { // Seek to the beginning of the section entry. - this->Stream.seekg(sec.sh_offset + sec.sh_entsize * j); + this->Stream->seekg(sec.sh_offset + sec.sh_entsize * j); ELF_Dyn& dyn = this->DynamicSectionEntries[j]; // Try reading the entry. @@ -630,7 +632,7 @@ cmELF::StringEntry const* cmELFInternalImpl<Types>::GetDynamicSectionString( unsigned long first = static_cast<unsigned long>(dyn.d_un.d_val); unsigned long last = first; unsigned long end = static_cast<unsigned long>(strtab.sh_size); - this->Stream.seekg(strtab.sh_offset + first); + this->Stream->seekg(strtab.sh_offset + first); // Read the string. It may be followed by more than one NULL // terminator. Count the total size of the region allocated to @@ -639,7 +641,7 @@ cmELF::StringEntry const* cmELFInternalImpl<Types>::GetDynamicSectionString( // assumption. bool terminated = false; char c; - while (last != end && this->Stream.get(c) && !(terminated && c)) { + while (last != end && this->Stream->get(c) && !(terminated && c)) { ++last; if (c) { se.Value += c; @@ -649,7 +651,7 @@ cmELF::StringEntry const* cmELFInternalImpl<Types>::GetDynamicSectionString( } // Make sure the whole value was read. - if (!this->Stream) { + if (!(*this->Stream)) { this->SetErrorMessage("Dynamic section specifies unreadable RPATH."); se.Value = ""; return nullptr; @@ -679,10 +681,9 @@ const long cmELF::TagMipsRldMapRel = 0; #endif cmELF::cmELF(const char* fname) - : Internal(nullptr) { // Try to open the file. - std::unique_ptr<cmsys::ifstream> fin(new cmsys::ifstream(fname)); + auto fin = cm::make_unique<cmsys::ifstream>(fname); // Quit now if the file could not be opened. if (!fin || !*fin) { @@ -725,12 +726,14 @@ cmELF::cmELF(const char* fname) // parser implementation. if (ident[EI_CLASS] == ELFCLASS32) { // 32-bit ELF - this->Internal = new cmELFInternalImpl<cmELFTypes32>(this, fin, order); + this->Internal = cm::make_unique<cmELFInternalImpl<cmELFTypes32>>( + this, std::move(fin), order); } #ifndef _SCO_DS else if (ident[EI_CLASS] == ELFCLASS64) { // 64-bit ELF - this->Internal = new cmELFInternalImpl<cmELFTypes64>(this, fin, order); + this->Internal = cm::make_unique<cmELFInternalImpl<cmELFTypes64>>( + this, std::move(fin), order); } #endif else { @@ -739,10 +742,7 @@ cmELF::cmELF(const char* fname) } } -cmELF::~cmELF() -{ - delete this->Internal; -} +cmELF::~cmELF() = default; bool cmELF::Valid() const { diff --git a/Source/cmELF.h b/Source/cmELF.h index 987f0c3..afef654 100644 --- a/Source/cmELF.h +++ b/Source/cmELF.h @@ -6,6 +6,7 @@ #include "cmConfigure.h" // IWYU pragma: keep #include <iosfwd> +#include <memory> #include <string> #include <utility> #include <vector> @@ -108,7 +109,7 @@ public: private: friend class cmELFInternal; bool Valid() const; - cmELFInternal* Internal; + std::unique_ptr<cmELFInternal> Internal; std::string ErrorMessage; }; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8738e2584a111de065341296dcfa1f4ac9c68346 commit 8738e2584a111de065341296dcfa1f4ac9c68346 Author: Samuel Ostlund <samostl...@gmail.com> AuthorDate: Tue Jul 16 14:06:34 2019 -0700 Commit: Samuel Ostlund <samostl...@gmail.com> CommitDate: Tue Jul 16 14:06:34 2019 -0700 cmGlobalNinjaGenerator: Use gnu compatible paths with QCC diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 69a7da9..7e81a54 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -639,7 +639,9 @@ void cmGlobalNinjaGenerator::EnableLanguage( (mf->GetSafeDefinition("CMAKE_C_COMPILER_ID") == "GNU") || (mf->GetSafeDefinition("CMAKE_CXX_COMPILER_ID") == "GNU") || (mf->GetSafeDefinition("CMAKE_C_COMPILER_ID") == "Clang") || - (mf->GetSafeDefinition("CMAKE_CXX_COMPILER_ID") == "Clang")))) { + (mf->GetSafeDefinition("CMAKE_CXX_COMPILER_ID") == "Clang") || + (mf->GetSafeDefinition("CMAKE_C_COMPILER_ID") == "QCC") || + (mf->GetSafeDefinition("CMAKE_CXX_COMPILER_ID") == "QCC")))) { this->UsingGCCOnWindows = true; } #endif ----------------------------------------------------------------------- Summary of changes: Help/policy/CMP0091.rst | 4 ++- Help/prop_tgt/MSVC_RUNTIME_LIBRARY.rst | 3 ++ Help/variable/CMAKE_MSVC_RUNTIME_LIBRARY.rst | 5 +++ Source/CTest/cmCTestScriptHandler.cxx | 24 +++++++------ Source/CTest/cmCTestSubmitHandler.cxx | 18 +++++----- Source/cmELF.cxx | 54 ++++++++++++++-------------- Source/cmELF.h | 3 +- Source/cmForEachCommand.cxx | 22 ++++++------ Source/cmFunctionCommand.cxx | 8 +++-- Source/cmGlobalNinjaGenerator.cxx | 4 ++- Source/cmIfCommand.cxx | 22 +++++++----- Source/cmLocalVisualStudio7Generator.cxx | 3 +- Source/cmMacroCommand.cxx | 8 +++-- Source/cmMakefile.cxx | 21 ++++++----- Source/cmMakefile.h | 6 ++-- Source/cmVisualStudio10TargetGenerator.cxx | 3 +- Source/cmWhileCommand.cxx | 13 ++++--- 17 files changed, 125 insertions(+), 96 deletions(-) hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org https://cmake.org/mailman/listinfo/cmake-commits