summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/OptionValueProperties.cpp
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2020-01-09 14:14:54 +0100
committerPavel Labath <pavel@labath.sk>2020-01-09 14:17:17 +0100
commit5c4661b7784115cb330996b3a6461c5927339aef (patch)
treec2102bf8d9cccecf919d1e5c6951e02825d1a421 /lldb/source/Interpreter/OptionValueProperties.cpp
parent4a83f1e171b73b819bcdb486e363b409d25fc629 (diff)
downloadbcm5719-llvm-5c4661b7784115cb330996b3a6461c5927339aef.tar.gz
bcm5719-llvm-5c4661b7784115cb330996b3a6461c5927339aef.zip
[lldb] Modernize OptionValue::SetValueChangedCallback
instead of a function pointer + void*, take a std::function. This removes a bunch of repetitive, unsafe void* casts.
Diffstat (limited to 'lldb/source/Interpreter/OptionValueProperties.cpp')
-rw-r--r--lldb/source/Interpreter/OptionValueProperties.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/Interpreter/OptionValueProperties.cpp b/lldb/source/Interpreter/OptionValueProperties.cpp
index 4dae930c3a6..21750cf1861 100644
--- a/lldb/source/Interpreter/OptionValueProperties.cpp
+++ b/lldb/source/Interpreter/OptionValueProperties.cpp
@@ -60,10 +60,10 @@ void OptionValueProperties::Initialize(const PropertyDefinitions &defs) {
}
void OptionValueProperties::SetValueChangedCallback(
- uint32_t property_idx, OptionValueChangedCallback callback, void *baton) {
+ uint32_t property_idx, std::function<void()> callback) {
Property *property = ProtectedGetPropertyAtIndex(property_idx);
if (property)
- property->SetValueChangedCallback(callback, baton);
+ property->SetValueChangedCallback(std::move(callback));
}
void OptionValueProperties::AppendProperty(ConstString name,
OpenPOWER on IntegriCloud