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

Side by Side Diff: src/platform-win32.cc

Issue 20534: Introduced a platform independent version of strchr, as the return value is c... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 10 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 | « src/platform-macos.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 // truncated or if there was an error. 725 // truncated or if there was an error.
726 if (n < 0 || n >= str.length()) { 726 if (n < 0 || n >= str.length()) {
727 str[str.length() - 1] = '\0'; 727 str[str.length() - 1] = '\0';
728 return -1; 728 return -1;
729 } else { 729 } else {
730 return n; 730 return n;
731 } 731 }
732 } 732 }
733 733
734 734
735 char* OS::StrChr(char* str, int c) {
736 return const_cast<char*>(strchr(str, c));
737 }
738
739
735 void OS::StrNCpy(Vector<char> dest, const char* src, size_t n) { 740 void OS::StrNCpy(Vector<char> dest, const char* src, size_t n) {
736 int result = strncpy_s(dest.start(), dest.length(), src, n); 741 int result = strncpy_s(dest.start(), dest.length(), src, n);
737 USE(result); 742 USE(result);
738 ASSERT(result == 0); 743 ASSERT(result == 0);
739 } 744 }
740 745
741 746
742 char* OS::StrDup(const char* str) { 747 char* OS::StrDup(const char* str) {
743 return _strdup(str); 748 return _strdup(str);
744 } 749 }
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after
1657 1662
1658 // Release the thread handles 1663 // Release the thread handles
1659 CloseHandle(data_->sampler_thread_); 1664 CloseHandle(data_->sampler_thread_);
1660 CloseHandle(data_->profiled_thread_); 1665 CloseHandle(data_->profiled_thread_);
1661 } 1666 }
1662 1667
1663 1668
1664 #endif // ENABLE_LOGGING_AND_PROFILING 1669 #endif // ENABLE_LOGGING_AND_PROFILING
1665 1670
1666 } } // namespace v8::internal 1671 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/platform-macos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698