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

Unified Diff: src/string-stream.cc

Issue 10294: * Added d8 flag "--" (alias "--js-arguments") (Closed)
Patch Set: Addressed review comments Created 12 years, 1 month 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/string-stream.h ('k') | test/cctest/test-flags.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/string-stream.cc
diff --git a/src/string-stream.cc b/src/string-stream.cc
index 81cbea51bd4e79d9c02a79d3a8a9c0a34ab4db04..6a3737b404330e2baed361cae4a135d9076073b6 100644
--- a/src/string-stream.cc
+++ b/src/string-stream.cc
@@ -141,6 +141,13 @@ void StringStream::Add(const char* format, Vector<FmtElm> elms) {
Add(formatted.start());
break;
}
+ case 'f': case 'g': case 'G': case 'e': case 'E': {
+ double value = current.data_.u_double_;
+ EmbeddedVector<char, 28> formatted;
+ OS::SNPrintF(formatted, temp.start(), value);
+ Add(formatted.start());
+ break;
+ }
default:
UNREACHABLE();
break;
@@ -207,11 +214,11 @@ void StringStream::Add(const char* format, FmtElm arg0, FmtElm arg1,
}
-SmartPointer<char> StringStream::ToCString() {
+SmartPointer<const char> StringStream::ToCString() {
char* str = NewArray<char>(length_ + 1);
memcpy(str, buffer_, length_);
str[length_] = '\0';
- return SmartPointer<char>(str);
+ return SmartPointer<const char>(str);
}
« no previous file with comments | « src/string-stream.h ('k') | test/cctest/test-flags.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698