keyfork-crossterm-ioctl-shim: use raw pointers when necessary
This commit is contained in:
parent
c15c4625a9
commit
2186c1ce86
|
@ -55,7 +55,7 @@ impl TerminalIoctl {
|
|||
|
||||
fn get_termios(&self) -> Result<Termios> {
|
||||
let mut termios = unsafe { std::mem::zeroed() };
|
||||
assert_io(unsafe { libc::tcgetattr(self.fd, &mut termios) })?;
|
||||
assert_io(unsafe { libc::tcgetattr(self.fd, &raw mut termios) })?;
|
||||
Ok(termios)
|
||||
}
|
||||
|
||||
|
@ -71,8 +71,8 @@ impl TerminalIoctl {
|
|||
let mut termios = self.get_termios()?;
|
||||
let original_mode_ios = termios;
|
||||
|
||||
unsafe { libc::cfmakeraw(&mut termios) };
|
||||
assert_io(unsafe { libc::tcsetattr(self.fd, libc::TCSANOW, &termios) })?;
|
||||
unsafe { libc::cfmakeraw(&raw mut termios) };
|
||||
assert_io(unsafe { libc::tcsetattr(self.fd, libc::TCSANOW, &raw const termios) })?;
|
||||
self.stored_termios = Some(original_mode_ios);
|
||||
}
|
||||
Ok(())
|
||||
|
@ -87,7 +87,7 @@ impl TerminalIoctl {
|
|||
/// The method may propagate errors encountered when interacting with the terminal.
|
||||
pub fn disable_raw_mode(&mut self) -> Result<()> {
|
||||
if let Some(termios) = self.stored_termios.take() {
|
||||
assert_io(unsafe { libc::tcsetattr(self.fd, libc::TCSANOW, &termios) })?;
|
||||
assert_io(unsafe { libc::tcsetattr(self.fd, libc::TCSANOW, &raw const termios) })?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ impl TerminalIoctl {
|
|||
ws_ypixel: 0,
|
||||
};
|
||||
|
||||
assert_io(unsafe { libc::ioctl(self.fd, libc::TIOCGWINSZ, &mut size) })?;
|
||||
assert_io(unsafe { libc::ioctl(self.fd, libc::TIOCGWINSZ, &raw mut size) })?;
|
||||
Ok((size.ws_col, size.ws_row))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue