diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2026-06-18 09:05:34 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2026-06-18 09:05:34 +0200 |
| commit | 4a365d974b17f71914909df8fe532edc929f3cad (patch) | |
| tree | 148f33e962bdd17e1dda3ba7a88d17e778e9f9a0 /ttwhy | |
| parent | 6dc9508bf13d78a990a36b2b43e9fa498ddbe228 (diff) | |
| download | ttwhy-4a365d974b17f71914909df8fe532edc929f3cad.tar.xz ttwhy-4a365d974b17f71914909df8fe532edc929f3cad.zip | |
chore: clean up code
Diffstat (limited to 'ttwhy')
| -rw-r--r-- | ttwhy/io.cppm | 1 | ||||
| -rw-r--r-- | ttwhy/main.cpp | 2 | ||||
| -rw-r--r-- | ttwhy/scoped_attributes.cppm | 10 |
3 files changed, 6 insertions, 7 deletions
diff --git a/ttwhy/io.cppm b/ttwhy/io.cppm index 353bdfa..230f180 100644 --- a/ttwhy/io.cppm +++ b/ttwhy/io.cppm @@ -4,7 +4,6 @@ module; #include <expected> #include <format> -#include <string> export module ttwhy:io; diff --git a/ttwhy/main.cpp b/ttwhy/main.cpp index 649d01d..94c1330 100644 --- a/ttwhy/main.cpp +++ b/ttwhy/main.cpp @@ -35,7 +35,7 @@ auto main() -> int .echo(false); auto context = asio::io_context{}; - asio::co_spawn(context, app(fileno(stdin), fileno(stdout), fileno(stderr)), asio::detached); + asio::co_spawn(context, app(::fileno(::stdin), ::fileno(::stdout), ::fileno(::stderr)), asio::detached); context.run(); } diff --git a/ttwhy/scoped_attributes.cppm b/ttwhy/scoped_attributes.cppm index 243d4ac..c68ab01 100644 --- a/ttwhy/scoped_attributes.cppm +++ b/ttwhy/scoped_attributes.cppm @@ -15,7 +15,7 @@ namespace ttwhy auto static read_attributes(int file_descriptor) -> termios { auto active_attributes = termios{}; - if (tcgetattr(file_descriptor, &active_attributes)) + if (::tcgetattr(file_descriptor, &active_attributes)) { throw std::system_error(errno, std::system_category(), "failed to read termios attributes"); } @@ -46,7 +46,7 @@ namespace ttwhy active_attributes.c_lflag = active_attributes.c_lflag & ~flag; } - if (tcsetattr(file_descriptor, TCSANOW, &active_attributes)) + if (::tcsetattr(file_descriptor, TCSANOW, &active_attributes)) { throw std::system_error(errno, std::system_category(), "failed to write termios attributes"); } @@ -56,7 +56,7 @@ namespace ttwhy export struct scoped_attributes { explicit scoped_attributes(int file_descriptor) - : m_file_descriptor{dup(file_descriptor)} + : m_file_descriptor{::dup(file_descriptor)} , m_attributes{read_attributes(file_descriptor)} {} @@ -71,8 +71,8 @@ namespace ttwhy { if (m_file_descriptor > 0) { - tcsetattr(m_file_descriptor, TCSANOW, &m_attributes); - close(m_file_descriptor); + ::tcsetattr(m_file_descriptor, TCSANOW, &m_attributes); + ::close(m_file_descriptor); } } |
