From 5c4661b7784115cb330996b3a6461c5927339aef Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Thu, 9 Jan 2020 14:14:54 +0100 Subject: [lldb] Modernize OptionValue::SetValueChangedCallback instead of a function pointer + void*, take a std::function. This removes a bunch of repetitive, unsafe void* casts. --- lldb/source/Interpreter/OptionValueProperties.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lldb/source/Interpreter/OptionValueProperties.cpp') 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 callback) { Property *property = ProtectedGetPropertyAtIndex(property_idx); if (property) - property->SetValueChangedCallback(callback, baton); + property->SetValueChangedCallback(std::move(callback)); } void OptionValueProperties::AppendProperty(ConstString name, -- cgit v1.2.3