bindings: cxx: fix std namespace resolution
authorBartosz Golaszewski <bgolaszewski@baylibre.com>
Mon, 3 Feb 2020 10:24:03 +0000 (11:24 +0100)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Mon, 3 Feb 2020 10:24:03 +0000 (11:24 +0100)
We try to always resolve symbols from std starting from the global
namespace by using the '::' prefix but there are a couple places where
this was missed. This patch makes the resolution consistent treewide.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
bindings/cxx/gpiod.hpp
bindings/cxx/line_bulk.cpp
bindings/cxx/tests/gpio-mockup.cpp

index f5df18e566e4fe5094ff96236d8107fb256525e1..07f465fc7969d9ee827caccf14a18a3a944a23c9 100644 (file)
@@ -660,7 +660,7 @@ public:
         *                     output direction requests.
         */
        GPIOD_API void request(const line_request& config,
-                              const std::vector<int> default_vals = std::vector<int>()) const;
+                              const ::std::vector<int> default_vals = ::std::vector<int>()) const;
 
        /**
         * @brief Release all lines held by this object.
@@ -690,7 +690,7 @@ public:
         *               Only relevant for output direction requests.
         */
        GPIOD_API void set_config(int direction, ::std::bitset<32> flags,
-                                 const ::std::vector<int> values = std::vector<int>()) const;
+                                 const ::std::vector<int> values = ::std::vector<int>()) const;
 
        /**
         * @brief Set configuration flags of all lines held by this object.
index b8f5eb77d8f6ed6abbc54a8982fe0e51ba4901b2..e77baa286cc621cbcea66be292b99ea7d6f6dbfc 100644 (file)
@@ -68,7 +68,7 @@ void line_bulk::append(const line& new_line)
                throw ::std::logic_error("maximum number of lines reached");
 
        if (this->_m_bulk.size() >= 1 && this->_m_bulk.begin()->get_chip() != new_line.get_chip())
-               throw std::logic_error("line_bulk cannot hold GPIO lines from different chips");
+               throw ::std::logic_error("line_bulk cannot hold GPIO lines from different chips");
 
        this->_m_bulk.push_back(new_line);
 }
@@ -98,7 +98,7 @@ void line_bulk::clear(void)
        this->_m_bulk.clear();
 }
 
-void line_bulk::request(const line_request& config, const std::vector<int> default_vals) const
+void line_bulk::request(const line_request& config, const ::std::vector<int> default_vals) const
 {
        this->throw_if_empty();
 
@@ -345,7 +345,7 @@ line_bulk::iterator line_bulk::end(void) noexcept
 void line_bulk::throw_if_empty(void) const
 {
        if (this->_m_bulk.empty())
-               throw std::logic_error("line_bulk not holding any GPIO lines");
+               throw ::std::logic_error("line_bulk not holding any GPIO lines");
 }
 
 void line_bulk::to_line_bulk(::gpiod_line_bulk *bulk) const
index 64333f74ce28c4c35f9a276f6029d910b1045bee..0005d3fa5f94510c4eea26e399440b4c510ce1c4 100644 (file)
@@ -56,7 +56,7 @@ void mockup::remove(void)
                                          "unable to remove gpio-mockup module");
 }
 
-std::string mockup::chip_name(unsigned int idx) const
+::std::string mockup::chip_name(unsigned int idx) const
 {
        const char *name = ::gpio_mockup_chip_name(this->_m_mockup, idx);
        if (!name)
@@ -66,7 +66,7 @@ std::string mockup::chip_name(unsigned int idx) const
        return ::std::string(name);
 }
 
-std::string mockup::chip_path(unsigned int idx) const
+::std::string mockup::chip_path(unsigned int idx) const
 {
        const char *path = ::gpio_mockup_chip_path(this->_m_mockup, idx);
        if (!path)