diff options
author | Brad King <brad.king@kitware.com> | 2019-01-30 13:10:19 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-01-30 13:10:27 (GMT) |
commit | c30f9b1cdefc2fa26d89bc692001a4f1050f6038 (patch) | |
tree | 2c862b3be88b4b600f6ac515d4c76fb039c8df2f /Source/cmake.cxx | |
parent | bcec7d0778eb87ea58d720d9e20710dc2cdfdab6 (diff) | |
parent | 8c92db829b41243790c7dcc5300227f591a727a8 (diff) | |
download | CMake-c30f9b1cdefc2fa26d89bc692001a4f1050f6038.zip CMake-c30f9b1cdefc2fa26d89bc692001a4f1050f6038.tar.gz CMake-c30f9b1cdefc2fa26d89bc692001a4f1050f6038.tar.bz2 |
Merge topic 'functional-callbacks'
8c92db829b MessageCallback: Remove unused bool& argument
bcee24aecc Use `std::function` for callbacks
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: vvs31415 <vstakhovsky@fastmail.com>
Acked-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
Merge-request: !2872
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index b03ffdb..2b627ff 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); } } |