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

Side by Side Diff: runtime/vm/os_win.cc

Issue 619723004: Fix following compiler warnings: (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/bin/file_win.cc ('k') | runtime/vm/stub_code_ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_OS_WINDOWS) 6 #if defined(TARGET_OS_WINDOWS)
7 7
8 #include "vm/os.h" 8 #include "vm/os.h"
9 9
10 #include <malloc.h> // NOLINT 10 #include <malloc.h> // NOLINT
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 va_list args_retry; 256 va_list args_retry;
257 va_copy(args_retry, args); 257 va_copy(args_retry, args);
258 written = _vscprintf(format, args_retry); 258 written = _vscprintf(format, args_retry);
259 if (written < 0) { 259 if (written < 0) {
260 FATAL1("Fatal error in OS::VSNPrint with format '%s'", format); 260 FATAL1("Fatal error in OS::VSNPrint with format '%s'", format);
261 } 261 }
262 va_end(args_retry); 262 va_end(args_retry);
263 } 263 }
264 // Make sure to zero-terminate the string if the output was 264 // Make sure to zero-terminate the string if the output was
265 // truncated or if there was an error. 265 // truncated or if there was an error.
266 if (written >= size) { 266 // The static cast is safe here as we have already determined that 'written'
267 // is >= 0.
268 if (static_cast<size_t>(written) >= size) {
267 str[size - 1] = '\0'; 269 str[size - 1] = '\0';
268 } 270 }
269 return written; 271 return written;
270 } 272 }
271 273
272 274
273 bool OS::StringToInt64(const char* str, int64_t* value) { 275 bool OS::StringToInt64(const char* str, int64_t* value) {
274 ASSERT(str != NULL && strlen(str) > 0 && value != NULL); 276 ASSERT(str != NULL && strlen(str) > 0 && value != NULL);
275 int32_t base = 10; 277 int32_t base = 10;
276 char* endptr; 278 char* endptr;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 } 329 }
328 330
329 331
330 void OS::Exit(int code) { 332 void OS::Exit(int code) {
331 exit(code); 333 exit(code);
332 } 334 }
333 335
334 } // namespace dart 336 } // namespace dart
335 337
336 #endif // defined(TARGET_OS_WINDOWS) 338 #endif // defined(TARGET_OS_WINDOWS)
OLDNEW
« no previous file with comments | « runtime/bin/file_win.cc ('k') | runtime/vm/stub_code_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698