From 70d3b20ba6189093c3a18473b3376644683f729d Mon Sep 17 00:00:00 2001 From: Martin Ling Date: Sun, 17 Aug 2014 11:44:05 +0100 Subject: [PATCH] bindings: update for sr_output_options_{get,free} API change. --- bindings/cxx/classes.cpp | 15 +++++++-------- bindings/cxx/include/libsigrok/libsigrok.hpp | 4 ++-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/bindings/cxx/classes.cpp b/bindings/cxx/classes.cpp index 67d49086..8e5874ca 100644 --- a/bindings/cxx/classes.cpp +++ b/bindings/cxx/classes.cpp @@ -1160,7 +1160,7 @@ void InputFileDevice::load() } Option::Option(const struct sr_option *structure, - shared_ptr structure_array) : + shared_ptr structure_array) : structure(structure), structure_array(structure_array) { @@ -1219,14 +1219,13 @@ string OutputFormat::get_description() map> OutputFormat::get_options() { - const struct sr_option *option = sr_output_options_get(structure); - auto option_array = shared_ptr( - option, [=](const struct sr_option *) { - sr_output_options_free(structure); }); + const struct sr_option **options = sr_output_options_get(structure); + auto option_array = shared_ptr( + options, sr_output_options_free); map> result; - for (; option->id; option++) - result[option->id] = shared_ptr