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

Side by Side Diff: runtime/bin/process_win.cc

Issue 23578046: Replace the memcpy macro with a lint check. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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/eventhandler_win.cc ('k') | runtime/platform/globals.h » ('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 "platform/globals.h" 5 #include "platform/globals.h"
6 #if defined(TARGET_OS_WINDOWS) 6 #if defined(TARGET_OS_WINDOWS)
7 7
8 #include <process.h> // NOLINT 8 #include <process.h> // NOLINT
9 9
10 #include "bin/builtin.h" 10 #include "bin/builtin.h"
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 } 820 }
821 } 821 }
822 822
823 // All handles closed and all data read. 823 // All handles closed and all data read.
824 result->set_stdout_data(oh[0].GetData()); 824 result->set_stdout_data(oh[0].GetData());
825 result->set_stderr_data(oh[1].GetData()); 825 result->set_stderr_data(oh[1].GetData());
826 826
827 // Calculate the exit code. 827 // Calculate the exit code.
828 ASSERT(oh[2].GetDataSize() == 8); 828 ASSERT(oh[2].GetDataSize() == 8);
829 uint32_t exit[2]; 829 uint32_t exit[2];
830 memcpy(&exit, oh[2].GetFirstDataBuffer(), sizeof(exit)); 830 memmove(&exit, oh[2].GetFirstDataBuffer(), sizeof(exit));
831 oh[2].FreeDataBuffer(); 831 oh[2].FreeDataBuffer();
832 intptr_t exit_code = exit[0]; 832 intptr_t exit_code = exit[0];
833 intptr_t negative = exit[1]; 833 intptr_t negative = exit[1];
834 if (negative) exit_code = -exit_code; 834 if (negative) exit_code = -exit_code;
835 result->set_exit_code(exit_code); 835 result->set_exit_code(exit_code);
836 return true; 836 return true;
837 } 837 }
838 838
839 839
840 bool Process::Kill(intptr_t id, int signal) { 840 bool Process::Kill(intptr_t id, int signal) {
(...skipping 18 matching lines...) Expand all
859 859
860 860
861 intptr_t Process::CurrentProcessId() { 861 intptr_t Process::CurrentProcessId() {
862 return static_cast<intptr_t>(GetCurrentProcessId()); 862 return static_cast<intptr_t>(GetCurrentProcessId());
863 } 863 }
864 864
865 } // namespace bin 865 } // namespace bin
866 } // namespace dart 866 } // namespace dart
867 867
868 #endif // defined(TARGET_OS_WINDOWS) 868 #endif // defined(TARGET_OS_WINDOWS)
OLDNEW
« no previous file with comments | « runtime/bin/eventhandler_win.cc ('k') | runtime/platform/globals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698