]> sigrok.org Git - libsigrok.git/commitdiff
C++: Update InputFormat::get_options for latest version of input API.
authorMartin Ling <redacted>
Sun, 24 Aug 2014 19:11:35 +0000 (20:11 +0100)
committerBert Vermeulen <redacted>
Mon, 25 Aug 2014 23:55:41 +0000 (01:55 +0200)
bindings/cxx/classes.cpp

index ed89b8bd60f55d16378e5b0e8cfd6916e3e33e44..ce458eeb6c61255b1904d4824b10cc491ddb4bd9 100644 (file)
@@ -1130,14 +1130,13 @@ string InputFormat::get_description()
 
 map<string, shared_ptr<Option>> InputFormat::get_options()
 {
-       const struct sr_option *option = sr_input_options_get(structure);
-       auto option_array = shared_ptr<const struct sr_option>(
-               option, [=](const struct sr_option *) {
-                       sr_input_options_free(structure); });
+       const struct sr_option **options = sr_input_options_get(structure);
+       auto option_array = shared_ptr<const struct sr_option *>(
+               options, sr_input_options_free);
        map<string, shared_ptr<Option>> result;
-       for (; option->id; option++)
-               result[option->id] = shared_ptr<Option>(
-                       new Option(option, option_array), Option::Deleter());
+       for (int i = 0; options[i]; i++)
+               result[options[i]->id] = shared_ptr<Option>(
+                       new Option(options[i], option_array), Option::Deleter());
        return result;
 }