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

Unified Diff: src/utils.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/utils.h ('k') | src/version.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils.cc
diff --git a/src/utils.cc b/src/utils.cc
index 00fcdb53625d4ccc8d31f212f8057e94263513eb..df1f280d787525f976c08778078dedd6b5dc5073 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -102,6 +102,25 @@ void PrintPID(const char* format, ...) {
}
+int SNPrintF(Vector<char> str, const char* format, ...) {
+ va_list args;
+ va_start(args, format);
+ int result = VSNPrintF(str, format, args);
+ va_end(args);
+ return result;
+}
+
+
+int VSNPrintF(Vector<char> str, const char* format, va_list args) {
+ return OS::VSNPrintF(str.start(), str.length(), format, args);
+}
+
+
+void StrNCpy(Vector<char> dest, const char* src, size_t n) {
+ OS::StrNCpy(dest.start(), dest.length(), src, n);
+}
+
+
void Flush(FILE* out) {
fflush(out);
}
@@ -305,7 +324,7 @@ void StringBuilder::AddFormatted(const char* format, ...) {
void StringBuilder::AddFormattedList(const char* format, va_list list) {
ASSERT(!is_finalized() && position_ <= buffer_.length());
- int n = OS::VSNPrintF(buffer_ + position_, format, list);
+ int n = VSNPrintF(buffer_ + position_, format, list);
if (n < 0 || n >= (buffer_.length() - position_)) {
position_ = buffer_.length();
} else {
« no previous file with comments | « src/utils.h ('k') | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698