summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
authorRegina Pfeifer <regina@mailbox.org>2019-01-25 20:31:33 (GMT)
committerRegina Pfeifer <regina@mailbox.org>2019-01-29 15:32:52 (GMT)
commitbcee24aecc1eaf6615eac9f24ae06acdf38845d3 (patch)
tree7a5ce493d66e1ff9a154bbd7503bd6e646624444 /Source/cmake.cxx
parent9620cb935a49e7b4955f5b1d0ffa2e93b4327591 (diff)
downloadCMake-bcee24aecc1eaf6615eac9f24ae06acdf38845d3.zip
CMake-bcee24aecc1eaf6615eac9f24ae06acdf38845d3.tar.gz
CMake-bcee24aecc1eaf6615eac9f24ae06acdf38845d3.tar.bz2
Use `std::function` for callbacks
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx10
1 files changed, 3 insertions, 7 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 70316f1..787e769 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -157,8 +157,6 @@ cmake::cmake(Role role, cmState::Mode mode)
#endif
this->GlobalGenerator = nullptr;
- this->ProgressCallback = nullptr;
- this->ProgressCallbackClientData = nullptr;
this->CurrentWorkingMode = NORMAL_MODE;
#ifdef CMAKE_BUILD_WITH_CMAKE
@@ -1922,17 +1920,15 @@ bool cmake::DeleteCache(const std::string& path)
return this->State->DeleteCache(path);
}
-void cmake::SetProgressCallback(ProgressCallbackType f, void* cd)
+void cmake::SetProgressCallback(ProgressCallbackType f)
{
- this->ProgressCallback = f;
- this->ProgressCallbackClientData = cd;
+ this->ProgressCallback = std::move(f);
}
void cmake::UpdateProgress(const char* msg, float prog)
{
if (this->ProgressCallback && !this->State->GetIsInTryCompile()) {
- (*this->ProgressCallback)(msg, prog, this->ProgressCallbackClientData);
- return;
+ this->ProgressCallback(msg, prog);
}
}