Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(997)

Unified Diff: runtime/bin/stdio_win.cc

Issue 1800863002: Cleanup in //runtime/bin (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/stdio_macos.cc ('k') | runtime/bin/thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « runtime/bin/stdio_macos.cc ('k') | runtime/bin/thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698