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

Unified Diff: src/prettyprinter.cc

Issue 1940: Replaced calls to functions that msvc consider deprecated. Used... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 3 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-win32.cc ('k') | src/serialize.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/prettyprinter.cc
===================================================================
--- src/prettyprinter.cc (revision 280)
+++ src/prettyprinter.cc (working copy)
@@ -448,8 +448,9 @@
for (;;) {
va_list arguments;
va_start(arguments, format);
- int available = size_ - pos_;
- int n = OS::VSNPrintF(output_ + pos_, available, format, arguments);
+ int n = OS::VSNPrintF(Vector<char>(output_, size_) + pos_,
+ format,
+ arguments);
va_end(arguments);
if (n >= 0) {
@@ -648,10 +649,10 @@
if (var == NULL) {
PrintLiteralIndented(info, value, true);
} else {
- char buf[256];
- OS::SNPrintF(buf, sizeof(buf), "%s (mode = %s)", info,
+ EmbeddedVector<char, 256> buf;
+ OS::SNPrintF(buf, "%s (mode = %s)", info,
Variable::Mode2String(var->mode()));
- PrintLiteralIndented(buf, value, true);
+ PrintLiteralIndented(buf.start(), value, true);
}
}
@@ -1019,10 +1020,10 @@
void AstPrinter::VisitCountOperation(CountOperation* node) {
- char buf[128];
- OS::SNPrintF(buf, sizeof(buf), "%s %s", (node->is_prefix() ? "PRE" : "POST"),
+ EmbeddedVector<char, 128> buf;
+ OS::SNPrintF(buf, "%s %s", (node->is_prefix() ? "PRE" : "POST"),
Token::Name(node->op()));
- PrintIndentedVisit(buf, node->expression());
+ PrintIndentedVisit(buf.start(), node->expression());
}
« no previous file with comments | « src/platform-win32.cc ('k') | src/serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698