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

Side by Side Diff: src/platform-macos.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-linux.cc ('k') | src/platform-win32.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 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 int n = vsnprintf(str.start(), str.length(), format, args); 178 int n = vsnprintf(str.start(), str.length(), format, args);
179 if (n < 0 || n >= str.length()) { 179 if (n < 0 || n >= str.length()) {
180 str[str.length() - 1] = '\0'; 180 str[str.length() - 1] = '\0';
181 return -1; 181 return -1;
182 } else { 182 } else {
183 return n; 183 return n;
184 } 184 }
185 } 185 }
186 186
187 187
188 char* OS::StrChr(char* str, int c) {
189 return strchr(str, c);
190 }
191
192
188 void OS::StrNCpy(Vector<char> dest, const char* src, size_t n) { 193 void OS::StrNCpy(Vector<char> dest, const char* src, size_t n) {
189 strncpy(dest.start(), src, n); 194 strncpy(dest.start(), src, n);
190 } 195 }
191 196
192 197
193 char* OS::StrDup(const char* str) { 198 char* OS::StrDup(const char* str) {
194 return strdup(str); 199 return strdup(str);
195 } 200 }
196 201
197 202
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 } 662 }
658 663
659 // This sampler is no longer the active sampler. 664 // This sampler is no longer the active sampler.
660 active_sampler_ = NULL; 665 active_sampler_ = NULL;
661 active_ = false; 666 active_ = false;
662 } 667 }
663 668
664 #endif // ENABLE_LOGGING_AND_PROFILING 669 #endif // ENABLE_LOGGING_AND_PROFILING
665 670
666 } } // namespace v8::internal 671 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/platform-linux.cc ('k') | src/platform-win32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698