From a2172120ff378a62e335ababcd32904cb1fcdaef Mon Sep 17 00:00:00 2001 From: Zac Berkowitz Date: Sun, 19 Feb 2017 12:10:01 +0000 Subject: Corrected linux baud constants to octals --- src/sys/termios.rs | 64 +++++++++++++++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/src/sys/termios.rs b/src/sys/termios.rs index c45627b3..29ed513c 100644 --- a/src/sys/termios.rs +++ b/src/sys/termios.rs @@ -398,38 +398,38 @@ mod ffi { impl From for BaudRate { fn from(s: speed_t) -> BaudRate { match s { - 0 => BaudRate::B0, - 1 => BaudRate::B50, - 2 => BaudRate::B75, - 3 => BaudRate::B110, - 4 => BaudRate::B130, - 5 => BaudRate::B150, - 6 => BaudRate::B200, - 7 => BaudRate::B300, - 10 => BaudRate::B600, - 11 => BaudRate::B1200, - 12 => BaudRate::B1800, - 13 => BaudRate::B2400, - 14 => BaudRate::B4800, - 15 => BaudRate::B9600, - 16 => BaudRate::B19200, - 17 => BaudRate::B38400, - 10000 => BaudRate::BOTHER, - 10001 => BaudRate::B57600, - 10002 => BaudRate::B115200, - 10003 => BaudRate::B230400, - 10004 => BaudRate::B460800, - 10005 => BaudRate::B500000, - 10006 => BaudRate::B576000, - 10007 => BaudRate::B921600, - 10010 => BaudRate::B1000000, - 10011 => BaudRate::B1152000, - 10012 => BaudRate::B1500000, - 10013 => BaudRate::B2000000, - 10014 => BaudRate::B2500000, - 10015 => BaudRate::B3000000, - 10016 => BaudRate::B3500000, - 10017 => BaudRate::B4000000, + 0o0 => BaudRate::B0, + 0o1 => BaudRate::B50, + 0o2 => BaudRate::B75, + 0o3 => BaudRate::B110, + 0o4 => BaudRate::B130, + 0o5 => BaudRate::B150, + 0o6 => BaudRate::B200, + 0o7 => BaudRate::B300, + 0o10 => BaudRate::B600, + 0o11 => BaudRate::B1200, + 0o12 => BaudRate::B1800, + 0o13 => BaudRate::B2400, + 0o14 => BaudRate::B4800, + 0o15 => BaudRate::B9600, + 0o16 => BaudRate::B19200, + 0o17 => BaudRate::B38400, + 0o10000 => BaudRate::BOTHER, + 0o10001 => BaudRate::B57600, + 0o10002 => BaudRate::B115200, + 0o10003 => BaudRate::B230400, + 0o10004 => BaudRate::B460800, + 0o10005 => BaudRate::B500000, + 0o10006 => BaudRate::B576000, + 0o10007 => BaudRate::B921600, + 0o10010 => BaudRate::B1000000, + 0o10011 => BaudRate::B1152000, + 0o10012 => BaudRate::B1500000, + 0o10013 => BaudRate::B2000000, + 0o10014 => BaudRate::B2500000, + 0o10015 => BaudRate::B3000000, + 0o10016 => BaudRate::B3500000, + 0o10017 => BaudRate::B4000000, b @ _ => unreachable!("Invalid baud constant: {}", b), } } -- cgit v1.2.3