bindings: cxx: examples: consistently use () for functions taking no args
PATCH 1/2 bindings: cxx: examples: consistently use () for functions taking no args
From: Bartosz Golaszewski <[email protected]>
While () and (void) are synonymous in C++, we use () everywhere else so stick to that pattern in examples.
Signed-off-by Bartosz Golaszewski <[email protected]>
--- bindings/cxx/examples/async_watch_line_value.cpp | 2 +- bindings/cxx/examples/find_line_by_name.cpp | 2 +- bindings/cxx/examples/get_chip_info.cpp | 2 +- bindings/cxx/examples/get_line_info.cpp | 2 +- bindings/cxx/examples/get_line_value.cpp | 2 +- bindings/cxx/examples/get_multiple_line_values.cpp | 2 +- bindings/cxx/examples/reconfigure_input_to_output.cpp | 2 +- bindings/cxx/examples/toggle_line_value.cpp | 2 +- bindings/cxx/examples/toggle_multiple_line_values.cpp | 2 +- bindings/cxx/examples/watch_line_info.cpp | 2 +- bindings/cxx/examples/watch_line_rising.cpp | 2 +- bindings/cxx/examples/watch_line_value.cpp | 2 +- bindings/cxx/examples/watch_multiple_line_values.cpp | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-)
bindings/cxx/examples/async_watch_line_value.cpp +1 -1
@@ -31,7 +31,7 @@ const char* edge_event_type_str(const ::gpiod::edge_event &event) } /* namespace */ -int main(void) +int main() { /* * Assume a button connecting the pin to ground, so pull it up and
bindings/cxx/examples/find_line_by_name.cpp +1 -1
@@ -15,7 +15,7 @@ const ::std::string line_name = "GPIO19"; } /* namespace */ -int main(void) +int main() { /* * Names are not guaranteed unique, so this finds the first line with
bindings/cxx/examples/get_chip_info.cpp +1 -1
@@ -15,7 +15,7 @@ const ::std::filesystem::path chip_path("/dev/gpiochip0"); } /* namespace */ -int main(void) +int main() { ::gpiod::chip chip(chip_path); auto info = chip.get_info();
bindings/cxx/examples/get_line_info.cpp +1 -1
@@ -17,7 +17,7 @@ const ::gpiod::line::offset line_offset = 3; } /* namespace */ -int main(void) +int main() { auto chip = ::gpiod::chip(chip_path); auto info = chip.get_line_info(line_offset);
bindings/cxx/examples/get_line_value.cpp +1 -1
@@ -16,7 +16,7 @@ const ::gpiod::line::offset line_offset = 5; } /* namespace */ -int main(void) +int main() { auto request = ::gpiod::chip(chip_path) .prepare_request()
bindings/cxx/examples/get_multiple_line_values.cpp +1 -1
@@ -15,7 +15,7 @@ const ::gpiod::line::offsets line_offsets = { 5, 3, 7 }; } /* namespace */ -int main(void) +int main() { auto request = ::gpiod::chip(chip_path) .prepare_request()
bindings/cxx/examples/reconfigure_input_to_output.cpp +1 -1
@@ -19,7 +19,7 @@ const ::gpiod::line::offset line_offset = 5; } /* namespace */ -int main(void) +int main() { /* request the line initially as an input */ auto request = ::gpiod::chip(chip_path)
bindings/cxx/examples/toggle_line_value.cpp +1 -1
@@ -25,7 +25,7 @@ const ::gpiod::line::offset line_offset = 5; } /* namespace */ -int main(void) +int main() { ::gpiod::line::value value = ::gpiod::line::value::ACTIVE;
bindings/cxx/examples/toggle_multiple_line_values.cpp +1 -1
@@ -37,7 +37,7 @@ void print_values(::gpiod::line::offsets const &offsets, } /* namespace */ -int main(void) +int main() { ::gpiod::line::values values = { ::gpiod::line::value::ACTIVE, ::gpiod::line::value::ACTIVE,
bindings/cxx/examples/watch_line_info.cpp +1 -1
@@ -30,7 +30,7 @@ const char *event_type(const ::gpiod::info_event &event) } /* namespace */ -int main(void) +int main() { ::gpiod::chip chip(chip_path);
bindings/cxx/examples/watch_line_rising.cpp +1 -1
@@ -29,7 +29,7 @@ const char *edge_event_type_str(const ::gpiod::edge_event &event) } /* namespace */ -int main(void) +int main() { auto request = ::gpiod::chip(chip_path)
bindings/cxx/examples/watch_line_value.cpp +1 -1
@@ -29,7 +29,7 @@ const char *edge_event_type_str(const ::gpiod::edge_event &event) } /* namespace */ -int main(void) +int main() { /* * Assume a button connecting the pin to ground, so pull it up and
bindings/cxx/examples/watch_multiple_line_values.cpp +1 -1
@@ -28,7 +28,7 @@ const char *edge_event_type_str(const ::gpiod::edge_event &event) } /* namespace */ -int main(void) +int main() { auto request = ::gpiod::chip(chip_path)
Signature · 1 line
2.39.2
PATCH 2/2 bindings: cxx: use () instead of (void) in line_settings::reset()
From: Bartosz Golaszewski <[email protected]>
While () and (void) are synonymous in C++, we use () everywhere else so fix the only exception. This DOES NOT change the ABI as the generated symbol is the same (at least as verified on gcc and clang).
Signed-off-by Bartosz Golaszewski <[email protected]>
--- bindings/cxx/gpiodcxx/line-settings.hpp | 2 +- bindings/cxx/line-settings.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
bindings/cxx/gpiodcxx/line-settings.hpp +1 -1
@@ -70,7 +70,7 @@ public: * @brief Reset the line settings to default values. * @return Reference to self. */ - line_settings& reset(void) noexcept; + line_settings& reset() noexcept; /** * @brief Set direction.
bindings/cxx/line-settings.cpp +1 -1
@@ -179,7 +179,7 @@ GPIOD_CXX_API line_settings& line_settings::operator=(line_settings&& other) return *this; } -GPIOD_CXX_API line_settings& line_settings::reset(void) noexcept +GPIOD_CXX_API line_settings& line_settings::reset() noexcept { ::gpiod_line_settings_reset(this->_m_priv->settings.get());
Signature · 1 line
2.39.2