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

Unified Diff: runtime/bin/stdio_macos.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_linux.cc ('k') | runtime/bin/stdio_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/stdio_macos.cc
diff --git a/runtime/bin/stdio_macos.cc b/runtime/bin/stdio_macos.cc
index 24f0414a8f72fcc0dd754f2329b23fb99a18ee30..7dc11415f9acf3186e3ed32a4fb7b9305ddcd69b 100644
--- a/runtime/bin/stdio_macos.cc
+++ b/runtime/bin/stdio_macos.cc
@@ -5,16 +5,15 @@
#include "platform/globals.h"
#if defined(TARGET_OS_MACOS)
+#include "bin/stdio.h"
+
#include <errno.h> // NOLINT
#include <sys/ioctl.h> // NOLINT
#include <termios.h> // NOLINT
-#include "bin/stdio.h"
#include "bin/fdutils.h"
-
#include "platform/signal_blocker.h"
-
namespace dart {
namespace bin {
@@ -30,7 +29,7 @@ int Stdin::ReadByte() {
bool Stdin::GetEchoMode() {
struct termios term;
tcgetattr(STDIN_FILENO, &term);
- return (term.c_lflag & ECHO) != 0;
+ return ((term.c_lflag & ECHO) != 0);
}
@@ -38,9 +37,9 @@ void Stdin::SetEchoMode(bool enabled) {
struct termios term;
tcgetattr(STDIN_FILENO, &term);
if (enabled) {
- term.c_lflag |= ECHO|ECHONL;
+ term.c_lflag |= (ECHO | ECHONL);
} else {
- term.c_lflag &= ~(ECHO|ECHONL);
+ term.c_lflag &= ~(ECHO | ECHONL);
}
tcsetattr(STDIN_FILENO, TCSANOW, &term);
}
@@ -49,7 +48,7 @@ void Stdin::SetEchoMode(bool enabled) {
bool Stdin::GetLineMode() {
struct termios term;
tcgetattr(STDIN_FILENO, &term);
- return (term.c_lflag & ICANON) != 0;
+ return ((term.c_lflag & ICANON) != 0);
}
@@ -67,8 +66,8 @@ void Stdin::SetLineMode(bool enabled) {
bool Stdout::GetTerminalSize(intptr_t fd, int size[2]) {
struct winsize w;
- if (NO_RETRY_EXPECTED(ioctl(fd, TIOCGWINSZ, &w) == 0) &&
- (w.ws_col != 0 || w.ws_row != 0)) {
+ int status = NO_RETRY_EXPECTED(ioctl(fd, TIOCGWINSZ, &w));
+ if ((status == 0) && ((w.ws_col != 0) || (w.ws_row != 0))) {
size[0] = w.ws_col;
size[1] = w.ws_row;
return true;
« no previous file with comments | « runtime/bin/stdio_linux.cc ('k') | runtime/bin/stdio_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698