bindings: cxx: initialize the line_request flags before using them
authorBartosz Golaszewski <bartekgola@gmail.com>
Wed, 9 May 2018 11:19:30 +0000 (13:19 +0200)
committerBartosz Golaszewski <bartekgola@gmail.com>
Wed, 9 May 2018 16:00:39 +0000 (18:00 +0200)
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 <bartekgola@gmail.com>
bindings/cxx/line_bulk.cpp

index fa64bea7e44d9c12a74db45fdd490f7a6c68ca5d..c93f364b47f30b828a368d59c1d69e67e4dc731e 100644 (file)
 
 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<int, int> 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<line>& lines)