From: Bartosz Golaszewski Date: Wed, 9 May 2018 11:19:30 +0000 (+0200) Subject: bindings: cxx: initialize the line_request flags before using them X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=3e90b5c8903743288a0a209ed5106783533f1928;p=qemu-gpiodev%2Flibgpiod.git bindings: cxx: initialize the line_request flags before using them We store the flag values in the request flags mapping before initializing them so flags don't get translated correctly in line_bulk::request(). Fix it by moving the flag definitions above the mapping initialization. Signed-off-by: Bartosz Golaszewski --- diff --git a/bindings/cxx/line_bulk.cpp b/bindings/cxx/line_bulk.cpp index fa64bea..c93f364 100644 --- a/bindings/cxx/line_bulk.cpp +++ b/bindings/cxx/line_bulk.cpp @@ -12,6 +12,10 @@ namespace gpiod { +const ::std::bitset<32> line_request::FLAG_ACTIVE_LOW("001"); +const ::std::bitset<32> line_request::FLAG_OPEN_SOURCE("010"); +const ::std::bitset<32> line_request::FLAG_OPEN_DRAIN("100"); + namespace { const ::std::map reqtype_mapping = { @@ -39,10 +43,6 @@ const ::std::map<::std::bitset<32>, int, bitset_cmp> reqflag_mapping = { } /* namespace */ -const ::std::bitset<32> line_request::FLAG_ACTIVE_LOW("001"); -const ::std::bitset<32> line_request::FLAG_OPEN_SOURCE("010"); -const ::std::bitset<32> line_request::FLAG_OPEN_DRAIN("100"); - const unsigned int line_bulk::MAX_LINES = GPIOD_LINE_BULK_MAX_LINES; line_bulk::line_bulk(const ::std::vector& lines)