OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "tools/gn/standard_out.h" | 5 #include "tools/gn/standard_out.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/strings/string_split.h" | 9 #include "base/strings/string_split.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 FOREGROUND_BLUE | FOREGROUND_INTENSITY); | 67 FOREGROUND_BLUE | FOREGROUND_INTENSITY); |
68 break; | 68 break; |
69 case DECORATION_YELLOW: | 69 case DECORATION_YELLOW: |
70 ::SetConsoleTextAttribute(hstdout, | 70 ::SetConsoleTextAttribute(hstdout, |
71 FOREGROUND_RED | FOREGROUND_GREEN); | 71 FOREGROUND_RED | FOREGROUND_GREEN); |
72 break; | 72 break; |
73 } | 73 } |
74 } | 74 } |
75 | 75 |
76 DWORD written = 0; | 76 DWORD written = 0; |
77 ::WriteFile(hstdout, output.c_str(), output.size(), &written, NULL); | 77 ::WriteFile(hstdout, output.c_str(), static_cast<DWORD>(output.size()), |
| 78 &written, NULL); |
78 | 79 |
79 if (is_console) | 80 if (is_console) |
80 ::SetConsoleTextAttribute(hstdout, default_attributes); | 81 ::SetConsoleTextAttribute(hstdout, default_attributes); |
81 } | 82 } |
82 | 83 |
83 #else | 84 #else |
84 | 85 |
85 void OutputString(const std::string& output, TextDecoration dec) { | 86 void OutputString(const std::string& output, TextDecoration dec) { |
86 EnsureInitialized(); | 87 EnsureInitialized(); |
87 if (is_console) { | 88 if (is_console) { |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 break; | 168 break; |
168 } else if (line[char_i] != ' ') { | 169 } else if (line[char_i] != ' ') { |
169 break; | 170 break; |
170 } | 171 } |
171 } | 172 } |
172 | 173 |
173 OutputString(line + "\n", dec); | 174 OutputString(line + "\n", dec); |
174 } | 175 } |
175 } | 176 } |
176 | 177 |
OLD | NEW |