Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Unify termios types for actions & flags #1600

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

tomaskallup
Copy link
Contributor

@tomaskallup tomaskallup commented Nov 4, 2024

The type for Tcflags was used instead of the CInt (now Tcactions) and vice versa.

This required some explicit casts when working with termios:

termios.c_lflag &= (Tcflags)~(termios::ICANON | termios::ECHO);
termios.setAttr(self.fd, (int)termios::TCSANOW);

With this PR, it can just be:

termios.c_lflag &= ~(termios::ICANON | termios::ECHO);
termios.setAttr(self.fd, termios::TCSANOW);

It should also reflect what the C implementation has.

The type for `Tcflags` was used instead of the CInt (now `Tcactions`)
and vice versa.
@lerno
Copy link
Collaborator

lerno commented Nov 4, 2024

Looks correct. Can you add a test too?

@lerno
Copy link
Collaborator

lerno commented Nov 4, 2024

Nevermind, it would only be run on some platforms.

@lerno lerno merged commit bdd6ed0 into c3lang:master Nov 4, 2024
42 checks passed
@lerno
Copy link
Collaborator

lerno commented Nov 4, 2024

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants