Index: runtime/bin/stdio_win.cc |
diff --git a/runtime/bin/stdio_win.cc b/runtime/bin/stdio_win.cc |
index ec479c08719367e8c543ed6dc9e5296e0857d052..1cb6a52735dbce7b9cec206153a3ec483d758e60 100644 |
--- a/runtime/bin/stdio_win.cc |
+++ b/runtime/bin/stdio_win.cc |
@@ -7,7 +7,6 @@ |
#include "bin/stdio.h" |
- |
namespace dart { |
namespace bin { |
@@ -16,7 +15,7 @@ int Stdin::ReadByte() { |
uint8_t buffer[1]; |
DWORD read = 0; |
int c = -1; |
- if (ReadFile(h, buffer, 1, &read, NULL) && read == 1) { |
+ if (ReadFile(h, buffer, 1, &read, NULL) && (read == 1)) { |
c = buffer[0]; |
} |
return c; |
@@ -26,15 +25,19 @@ int Stdin::ReadByte() { |
bool Stdin::GetEchoMode() { |
HANDLE h = GetStdHandle(STD_INPUT_HANDLE); |
DWORD mode; |
- if (!GetConsoleMode(h, &mode)) return false; |
- return (mode & ENABLE_ECHO_INPUT) != 0; |
+ if (!GetConsoleMode(h, &mode)) { |
+ return false; |
+ } |
+ return ((mode & ENABLE_ECHO_INPUT) != 0); |
} |
void Stdin::SetEchoMode(bool enabled) { |
HANDLE h = GetStdHandle(STD_INPUT_HANDLE); |
DWORD mode; |
- if (!GetConsoleMode(h, &mode)) return; |
+ if (!GetConsoleMode(h, &mode)) { |
+ return; |
+ } |
if (enabled) { |
mode |= ENABLE_ECHO_INPUT; |
} else { |
@@ -47,7 +50,9 @@ void Stdin::SetEchoMode(bool enabled) { |
bool Stdin::GetLineMode() { |
HANDLE h = GetStdHandle(STD_INPUT_HANDLE); |
DWORD mode; |
- if (!GetConsoleMode(h, &mode)) return false; |
+ if (!GetConsoleMode(h, &mode)) { |
+ return false; |
+ } |
return (mode & ENABLE_LINE_INPUT) != 0; |
} |
@@ -55,7 +60,9 @@ bool Stdin::GetLineMode() { |
void Stdin::SetLineMode(bool enabled) { |
HANDLE h = GetStdHandle(STD_INPUT_HANDLE); |
DWORD mode; |
- if (!GetConsoleMode(h, &mode)) return; |
+ if (!GetConsoleMode(h, &mode)) { |
+ return; |
+ } |
if (enabled) { |
mode |= ENABLE_LINE_INPUT; |
} else { |
@@ -73,7 +80,9 @@ bool Stdout::GetTerminalSize(intptr_t fd, int size[2]) { |
h = GetStdHandle(STD_ERROR_HANDLE); |
} |
CONSOLE_SCREEN_BUFFER_INFO info; |
- if (!GetConsoleScreenBufferInfo(h, &info)) return false; |
+ if (!GetConsoleScreenBufferInfo(h, &info)) { |
+ return false; |
+ } |
size[0] = info.srWindow.Right - info.srWindow.Left + 1; |
size[1] = info.srWindow.Bottom - info.srWindow.Top + 1; |
return true; |