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

Unified Diff: src/string-stream.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/serialize.cc ('k') | src/top.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/string-stream.cc
===================================================================
--- src/string-stream.cc (revision 280)
+++ src/string-stream.cc (working copy)
@@ -106,11 +106,7 @@
continue;
}
// Read this formatting directive into a temporary buffer
- const int kTempSize = 24;
- char temp_buffer[kTempSize];
- // Wrap temp buffer in a vector to get bounds checking in debug
- // mode
- Vector<char> temp(temp_buffer, kTempSize);
+ EmbeddedVector<char, 24> temp;
int format_length = 0;
// Skip over the whole control character sequence until the
// format element type
@@ -140,14 +136,9 @@
}
case 'i': case 'd': case 'u': case 'x': case 'c': case 'p': {
int value = current.data_.u_int_;
- char formatted[kTempSize];
-#ifdef WIN32
- // This is not my idea of a good time.
- _snprintf(formatted, kTempSize, temp.start(), value);
-#else
- snprintf(formatted, kTempSize, temp.start(), value);
-#endif
- Add(formatted);
+ EmbeddedVector<char, 24> formatted;
+ OS::SNPrintF(formatted, temp.start(), value);
+ Add(formatted.start());
break;
}
default:
« no previous file with comments | « src/serialize.cc ('k') | src/top.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698