Revision: 9141
Author:   [email protected]
Date:     Tue Sep  6 00:41:45 2011
Log:      Fix a few clang warnings (which -Werror treats as errors)

Review URL: http://codereview.chromium.org/7779033
http://code.google.com/p/v8/source/detail?r=9141

Modified:
 /branches/bleeding_edge/src/conversions.h
 /branches/bleeding_edge/src/ia32/lithium-codegen-ia32.cc
 /branches/bleeding_edge/src/jsregexp.cc
 /branches/bleeding_edge/src/jsregexp.h
 /branches/bleeding_edge/test/cctest/test-api.cc
 /branches/bleeding_edge/test/cctest/test-compiler.cc

=======================================
--- /branches/bleeding_edge/src/conversions.h   Thu Jul  7 06:57:58 2011
+++ /branches/bleeding_edge/src/conversions.h   Tue Sep  6 00:41:45 2011
@@ -45,14 +45,14 @@
 const int kMaxSignificantDigits = 772;


-static bool isDigit(int x, int radix) {
+static inline bool isDigit(int x, int radix) {
   return (x >= '0' && x <= '9' && x < '0' + radix)
       || (radix > 10 && x >= 'a' && x < 'a' + radix - 10)
       || (radix > 10 && x >= 'A' && x < 'A' + radix - 10);
 }


-static double SignedZero(bool negative) {
+static inline double SignedZero(bool negative) {
   return negative ? -0.0 : 0.0;
 }

=======================================
--- /branches/bleeding_edge/src/ia32/lithium-codegen-ia32.cc Thu Sep 1 08:24:26 2011 +++ /branches/bleeding_edge/src/ia32/lithium-codegen-ia32.cc Tue Sep 6 00:41:45 2011
@@ -3175,7 +3175,6 @@
 void LCodeGen::DoStoreKeyedFastDoubleElement(
     LStoreKeyedFastDoubleElement* instr) {
   XMMRegister value = ToDoubleRegister(instr->value());
- Register key = instr->key()->IsRegister() ? ToRegister(instr->key()) : no_reg;
   Label have_value;

   __ ucomisd(value, value);
=======================================
--- /branches/bleeding_edge/src/jsregexp.cc     Mon Aug 29 07:04:01 2011
+++ /branches/bleeding_edge/src/jsregexp.cc     Tue Sep  6 00:41:45 2011
@@ -2661,7 +2661,8 @@
 // this alternative and back to this choice node.  If there are variable
 // length nodes or other complications in the way then return a sentinel
 // value indicating that a greedy loop cannot be constructed.
-int ChoiceNode::GreedyLoopTextLength(GuardedAlternative* alternative) {
+int ChoiceNode::GreedyLoopTextLengthForAlternative(
+    GuardedAlternative* alternative) {
   int length = 0;
   RegExpNode* node = alternative->node();
   // Later we will generate code for all these text nodes using recursion
@@ -2700,7 +2701,8 @@
 void LoopChoiceNode::Emit(RegExpCompiler* compiler, Trace* trace) {
   RegExpMacroAssembler* macro_assembler = compiler->macro_assembler();
   if (trace->stop_node() == this) {
-    int text_length = GreedyLoopTextLength(&(alternatives_->at(0)));
+    int text_length =
+        GreedyLoopTextLengthForAlternative(&(alternatives_->at(0)));
     ASSERT(text_length != kNodeIsTooComplexForGreedyLoops);
     // Update the counter-based backtracking info on the stack.  This is an
     // optimization for greedy loops (see below).
@@ -2893,7 +2895,7 @@

   Trace* current_trace = trace;

-  int text_length = GreedyLoopTextLength(&(alternatives_->at(0)));
+ int text_length = GreedyLoopTextLengthForAlternative(&(alternatives_->at(0)));
   bool greedy_loop = false;
   Label greedy_loop_label;
   Trace counter_backtrack_trace;
=======================================
--- /branches/bleeding_edge/src/jsregexp.h      Mon Jul 11 02:12:17 2011
+++ /branches/bleeding_edge/src/jsregexp.h      Tue Sep  6 00:41:45 2011
@@ -1071,7 +1071,7 @@
virtual bool try_to_emit_quick_check_for_alternative(int i) { return true; }

  protected:
-  int GreedyLoopTextLength(GuardedAlternative* alternative);
+  int GreedyLoopTextLengthForAlternative(GuardedAlternative* alternative);
   ZoneList<GuardedAlternative>* alternatives_;

  private:
=======================================
--- /branches/bleeding_edge/test/cctest/test-api.cc     Tue Aug 30 11:45:48 2011
+++ /branches/bleeding_edge/test/cctest/test-api.cc     Tue Sep  6 00:41:45 2011
@@ -4226,7 +4226,7 @@


 // This test is not intended to be run, just type checked.
-static void PersistentHandles() {
+static inline void PersistentHandles() {
   USE(PersistentHandles);
   Local<String> str = v8_str("foo");
   v8::Persistent<String> p_str = v8::Persistent<String>::New(str);
@@ -11793,14 +11793,21 @@
   CHECK_EQ(28, result->Int32Value());

   i::Handle<i::Smi> value(i::Smi::FromInt(2));
-  i::SetElement(jsobj, 1, value, i::kNonStrictMode);
+  i::Handle<i::Object> no_failure;
+  no_failure = i::SetElement(jsobj, 1, value, i::kNonStrictMode);
+  ASSERT(!no_failure.is_null());
+  i::USE(no_failure);
CHECK_EQ(2, i::Smi::cast(jsobj->GetElement(1)->ToObjectChecked())->value());
   *value.location() = i::Smi::FromInt(256);
-  i::SetElement(jsobj, 1, value, i::kNonStrictMode);
+  no_failure = i::SetElement(jsobj, 1, value, i::kNonStrictMode);
+  ASSERT(!no_failure.is_null());
+  i::USE(no_failure);
   CHECK_EQ(255,
            i::Smi::cast(jsobj->GetElement(1)->ToObjectChecked())->value());
   *value.location() = i::Smi::FromInt(-1);
-  i::SetElement(jsobj, 1, value, i::kNonStrictMode);
+  no_failure = i::SetElement(jsobj, 1, value, i::kNonStrictMode);
+  ASSERT(!no_failure.is_null());
+  i::USE(no_failure);
CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(1)->ToObjectChecked())->value());

   result = CompileRun("for (var i = 0; i < 8; i++) {"
=======================================
--- /branches/bleeding_edge/test/cctest/test-compiler.cc Fri Jul 22 02:03:55 2011 +++ /branches/bleeding_edge/test/cctest/test-compiler.cc Tue Sep 6 00:41:45 2011
@@ -26,7 +26,7 @@
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

 #include <stdlib.h>
-#include <wchar.h>  // wint_t
+#include <wchar.h>

 #include "v8.h"

@@ -75,7 +75,7 @@
     uint16_t* string = NewArray<uint16_t>(length + 1);
     string_obj->Write(string);
     for (int j = 0; j < length; j++)
-      printf("%lc", static_cast<wint_t>(string[j]));
+      printf("%lc", static_cast<wchar_t>(string[j]));
     DeleteArray(string);
   }
   printf("\n");

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to