Reviewers: dcarney_chromium.org,

Description:
Fix build warnings.


TBR=dcar...@chromium.org
BUG=


Please review this at https://chromiumcodereview.appspot.com/11669020/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/objects.cc
  M src/string-stream.cc


Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 4f2cc96a0914573b374bf1e3702401951bdb5cb4..20553eb64bc94889c24418fab89dca2eeadf3346 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -1068,7 +1068,7 @@ void String::StringShortPrint(StringStream* accumulator) {
   if (ascii) {
     accumulator->Add("<String[%u]: ", length());
     for (int i = 0; i < len; i++) {
-      accumulator->Put(stream.GetNext());
+      accumulator->Put(static_cast<char>(stream.GetNext()));
     }
     accumulator->Put('>');
   } else {
@@ -1086,7 +1086,7 @@ void String::StringShortPrint(StringStream* accumulator) {
       } else if (c < 32 || c > 126) {
         accumulator->Add("\\x%02x", c);
       } else {
-        accumulator->Put(c);
+        accumulator->Put(static_cast<char>(c));
       }
     }
     if (truncated) {
@@ -7533,7 +7533,7 @@ class StringComparator {
   class State {
    public:
     explicit inline State(ConsStringIteratorOp* op)
-      : op_(op) {}
+      : op_(op), is_one_byte_(true), length_(0), buffer8_(NULL) {}

     inline void Init(String* string, unsigned len) {
       op_->Reset();
@@ -7567,8 +7567,8 @@ class StringComparator {
       }
       // Advance state.
       ASSERT(op_->HasMore());
-      int32_t type;
-      unsigned length;
+      int32_t type = 0;
+      unsigned length = 0;
       String* next = op_->ContinueOperation(&type, &length);
       ASSERT(next != NULL);
       ConsStringNullOp null_op;
@@ -7577,7 +7577,6 @@ class StringComparator {

     ConsStringIteratorOp* const op_;
     bool is_one_byte_;
-    unsigned offset_;
     unsigned length_;
     union {
       const uint8_t* buffer8_;
Index: src/string-stream.cc
diff --git a/src/string-stream.cc b/src/string-stream.cc
index 7d89bcf15f4c2b9aa743c0c7ab8f0febc31137ad..fc07d94ded237ee4ca79ebde48fe036680de6910 100644
--- a/src/string-stream.cc
+++ b/src/string-stream.cc
@@ -318,7 +318,7 @@ bool StringStream::Put(String* str, int start, int end) {
     if (c >= 127 || c < 32) {
       c = '?';
     }
-    if (!Put(c)) {
+    if (!Put(static_cast<char>(c))) {
       return false;  // Output was truncated.
     }
   }


--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev

Reply via email to