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

Side by Side Diff: src/platform-linux.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-freebsd.cc ('k') | src/platform-macos.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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 int n = vsnprintf(str.start(), str.length(), format, args); 173 int n = vsnprintf(str.start(), str.length(), format, args);
174 if (n < 0 || n >= str.length()) { 174 if (n < 0 || n >= str.length()) {
175 str[str.length() - 1] = '\0'; 175 str[str.length() - 1] = '\0';
176 return -1; 176 return -1;
177 } else { 177 } else {
178 return n; 178 return n;
179 } 179 }
180 } 180 }
181 181
182 182
183 char* OS::StrChr(char* str, int c) {
184 return strchr(str, c);
185 }
186
187
183 void OS::StrNCpy(Vector<char> dest, const char* src, size_t n) { 188 void OS::StrNCpy(Vector<char> dest, const char* src, size_t n) {
184 strncpy(dest.start(), src, n); 189 strncpy(dest.start(), src, n);
185 } 190 }
186 191
187 192
188 char* OS::StrDup(const char* str) { 193 char* OS::StrDup(const char* str) {
189 return strdup(str); 194 return strdup(str);
190 } 195 }
191 196
192 197
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 } 696 }
692 697
693 // This sampler is no longer the active sampler. 698 // This sampler is no longer the active sampler.
694 active_sampler_ = NULL; 699 active_sampler_ = NULL;
695 active_ = false; 700 active_ = false;
696 } 701 }
697 702
698 #endif // ENABLE_LOGGING_AND_PROFILING 703 #endif // ENABLE_LOGGING_AND_PROFILING
699 704
700 } } // namespace v8::internal 705 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/platform-freebsd.cc ('k') | src/platform-macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698