bindings: cxx: initialize bitset with integer instead of string
authorKent Gibson <warthog618@gmail.com>
Fri, 15 Nov 2019 14:43:42 +0000 (22:43 +0800)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Mon, 18 Nov 2019 14:28:11 +0000 (15:28 +0100)
Initializing bitsets with string is inefficient and confusing.
Initialize them with the corresponding int instead.

Signed-off-by: Kent Gibson <warthog618@gmail.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
bindings/cxx/line_bulk.cpp

index 83699302d6930e20f2e9d777661638e5afa0cd2d..c708c8bb2768d7ced2fe809ac6e686e2c571c52e 100644 (file)
@@ -11,9 +11,9 @@
 
 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");
+const ::std::bitset<32> line_request::FLAG_ACTIVE_LOW(GPIOD_BIT(0));
+const ::std::bitset<32> line_request::FLAG_OPEN_SOURCE(GPIOD_BIT(1));
+const ::std::bitset<32> line_request::FLAG_OPEN_DRAIN(GPIOD_BIT(2));
 
 namespace {