From: Bartosz Golaszewski Date: Mon, 19 Feb 2018 09:40:35 +0000 (+0100) Subject: bindings: cxx: constify default_vals in line_bulk::request() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=5def18b0d95925ac2224062dda4df1b296b94e2e;p=qemu-gpiodev%2Flibgpiod.git bindings: cxx: constify default_vals in line_bulk::request() The default values should be passed by const reference similarly to how it's done in line_bulk::set_values(). Signed-off-by: Bartosz Golaszewski --- diff --git a/bindings/cxx/gpiod.hpp b/bindings/cxx/gpiod.hpp index da3747a..5710d36 100644 --- a/bindings/cxx/gpiod.hpp +++ b/bindings/cxx/gpiod.hpp @@ -590,7 +590,7 @@ public: * output direction requests. */ GPIOD_API void request(const line_request& config, - std::vector default_vals = std::vector()) const; + const std::vector default_vals = std::vector()) const; /** * @brief Read values from all lines held by this object. diff --git a/bindings/cxx/line_bulk.cpp b/bindings/cxx/line_bulk.cpp index 72dd7d4..ec0d724 100644 --- a/bindings/cxx/line_bulk.cpp +++ b/bindings/cxx/line_bulk.cpp @@ -97,7 +97,7 @@ void line_bulk::clear(void) this->_m_bulk.clear(); } -void line_bulk::request(const line_request& config, std::vector default_vals) const +void line_bulk::request(const line_request& config, const std::vector default_vals) const { this->throw_if_empty();