@@ -59,20 +59,20 @@ pub fn enableRawMode(in: File, out: File) !termios {
59
59
var raw = orig ;
60
60
61
61
// TODO fix hardcoding of linux
62
- raw .iflag &= ~ (@intCast (tcflag_t , std .os .linux .BRKINT ) |
63
- @intCast (tcflag_t , std .os .linux .ICRNL ) |
64
- @intCast (tcflag_t , std .os .linux .INPCK ) |
65
- @intCast (tcflag_t , std .os .linux .ISTRIP ) |
66
- @intCast (tcflag_t , std .os .linux .IXON ));
62
+ raw .iflag &= ~ (@as (tcflag_t , @intCast ( std .os .linux .BRKINT ) ) |
63
+ @as (tcflag_t , @intCast ( std .os .linux .ICRNL ) ) |
64
+ @as (tcflag_t , @intCast ( std .os .linux .INPCK ) ) |
65
+ @as (tcflag_t , @intCast ( std .os .linux .ISTRIP ) ) |
66
+ @as (tcflag_t , @intCast ( std .os .linux .IXON ) ));
67
67
68
- raw .oflag &= ~ (@intCast (tcflag_t , std .os .linux .OPOST ));
68
+ raw .oflag &= ~ (@as (tcflag_t , @intCast ( std .os .linux .OPOST ) ));
69
69
70
- raw .cflag |= (@intCast (tcflag_t , std .os .linux .CS8 ));
70
+ raw .cflag |= (@as (tcflag_t , @intCast ( std .os .linux .CS8 ) ));
71
71
72
- raw .lflag &= ~ (@intCast (tcflag_t , std .os .linux .ECHO ) |
73
- @intCast (tcflag_t , std .os .linux .ICANON ) |
74
- @intCast (tcflag_t , std .os .linux .IEXTEN ) |
75
- @intCast (tcflag_t , std .os .linux .ISIG ));
72
+ raw .lflag &= ~ (@as (tcflag_t , @intCast ( std .os .linux .ECHO ) ) |
73
+ @as (tcflag_t , @intCast ( std .os .linux .ICANON ) ) |
74
+ @as (tcflag_t , @intCast ( std .os .linux .IEXTEN ) ) |
75
+ @as (tcflag_t , @intCast ( std .os .linux .ISIG ) ));
76
76
77
77
// FIXME
78
78
// raw.cc[std.os.VMIN] = 1;
@@ -131,7 +131,7 @@ pub fn getColumns(in: File, out: File) !usize {
131
131
switch (builtin .os .tag ) {
132
132
.linux = > {
133
133
var wsz : std.os.linux.winsize = undefined ;
134
- if (std .os .linux .ioctl (in .handle , std .os .linux .T .IOCGWINSZ , @ptrToInt (& wsz )) == 0 ) {
134
+ if (std .os .linux .ioctl (in .handle , std .os .linux .T .IOCGWINSZ , @intFromPtr (& wsz )) == 0 ) {
135
135
return wsz .ws_col ;
136
136
} else {
137
137
return try getColumnsFallback (in , out );
@@ -140,7 +140,7 @@ pub fn getColumns(in: File, out: File) !usize {
140
140
.windows = > {
141
141
var csbi : w.CONSOLE_SCREEN_BUFFER_INFO = undefined ;
142
142
_ = k32 .GetConsoleScreenBufferInfo (out .handle , & csbi );
143
- return @intCast (usize , csbi .dwSize .X );
143
+ return @intCast (csbi .dwSize .X );
144
144
},
145
145
else = > return try getColumnsFallback (in , out ),
146
146
}
0 commit comments