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

Unified Diff: src/platform-posix.cc

Issue 328343003: Remove dependency on Vector from platform files (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/platform.h ('k') | src/platform-solaris.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform-posix.cc
diff --git a/src/platform-posix.cc b/src/platform-posix.cc
index 87b96e2aae77de139d934fa7d6b7490980439ce3..c963fb1797a77ce40ea0a2e8c97083b16a5087fe 100644
--- a/src/platform-posix.cc
+++ b/src/platform-posix.cc
@@ -422,23 +422,24 @@ void OS::VPrintError(const char* format, va_list args) {
}
-int OS::SNPrintF(Vector<char> str, const char* format, ...) {
+int OS::SNPrintF(char* str, int length, const char* format, ...) {
va_list args;
va_start(args, format);
- int result = VSNPrintF(str, format, args);
+ int result = VSNPrintF(str, length, format, args);
va_end(args);
return result;
}
-int OS::VSNPrintF(Vector<char> str,
+int OS::VSNPrintF(char* str,
+ int length,
const char* format,
va_list args) {
- int n = vsnprintf(str.start(), str.length(), format, args);
- if (n < 0 || n >= str.length()) {
+ int n = vsnprintf(str, length, format, args);
+ if (n < 0 || n >= length) {
// If the length is zero, the assignment fails.
- if (str.length() > 0)
- str[str.length() - 1] = '\0';
+ if (length > 0)
+ str[length - 1] = '\0';
return -1;
} else {
return n;
@@ -455,8 +456,8 @@ char* OS::StrChr(char* str, int c) {
}
-void OS::StrNCpy(Vector<char> dest, const char* src, size_t n) {
- strncpy(dest.start(), src, n);
+void OS::StrNCpy(char* dest, int length, const char* src, size_t n) {
+ strncpy(dest, src, n);
}
« no previous file with comments | « src/platform.h ('k') | src/platform-solaris.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698