Reviewers: Sven,

Message:
PTAL. No intended functionality changes.

Description:
Fix a few clang warnings (which -Werror treats as errors)


Please review this at http://codereview.chromium.org/7779033/

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

Affected files:
  M src/conversions.h
  M src/ia32/lithium-codegen-ia32.cc
  M src/jsregexp.h
  M src/jsregexp.cc
  M test/cctest/test-api.cc
  M test/cctest/test-compiler.cc


Index: src/conversions.h
diff --git a/src/conversions.h b/src/conversions.h
index 7b02c47f6a0feeec3e960ebc29967274e58eb14d..0f8d5da8ee67568a828820321e6e5a403c00c6c4 100644
--- a/src/conversions.h
+++ b/src/conversions.h
@@ -45,14 +45,14 @@ namespace internal {
 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;
 }

Index: src/ia32/lithium-codegen-ia32.cc
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc index 7136105806c548426fc7e98c6bacc1e2c29f4ee3..8b3cb47b4a525b936cd51d41853bfd3a163b1786 100644
--- a/src/ia32/lithium-codegen-ia32.cc
+++ b/src/ia32/lithium-codegen-ia32.cc
@@ -3175,7 +3175,6 @@ void LCodeGen::DoStoreKeyedFastElement(LStoreKeyedFastElement* instr) {
 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);
Index: src/jsregexp.cc
diff --git a/src/jsregexp.cc b/src/jsregexp.cc
index 4ca83a47691cf25d4b56a71493ff59c9dd35a98b..3ebfbdfc986cb823291fb08dd94f4372bdc92922 100644
--- a/src/jsregexp.cc
+++ b/src/jsregexp.cc
@@ -2661,7 +2661,8 @@ int TextNode::GreedyLoopTextLength() {
 // 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::AddContinueAlternative(GuardedAlternative alt) {
 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 @@ void ChoiceNode::Emit(RegExpCompiler* compiler, Trace* trace) {

   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;
Index: src/jsregexp.h
diff --git a/src/jsregexp.h b/src/jsregexp.h
index 13f9e2ea06bfd777801d09b05a207560c0cad51a..3bd5e0089393631eeca7c7ca8aa54d5e89f506f2 100644
--- a/src/jsregexp.h
+++ b/src/jsregexp.h
@@ -1071,7 +1071,7 @@ class ChoiceNode: public RegExpNode {
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:
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index c0b8a4e01129e96545414606b84f0b3057dc8e49..f9f08a66417f8d9d416af7f685e52a65398feee8 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -4226,7 +4226,7 @@ template <typename T> static void USE(T) { }


 // 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 @@ THREADED_TEST(PixelArray) {
   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++) {"
Index: test/cctest/test-compiler.cc
diff --git a/test/cctest/test-compiler.cc b/test/cctest/test-compiler.cc
index 8f226f6cde8b40f6ca24ebd5e44928d2d8c6c2d4..ac2203c8263b50465c7ffcf26084659667882c15 100644
--- a/test/cctest/test-compiler.cc
+++ b/test/cctest/test-compiler.cc
@@ -75,7 +75,7 @@ v8::Handle<v8::Value> PrintExtension::Print(const v8::Arguments& args) {
     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("%u", static_cast<wint_t>(string[j]));
     DeleteArray(string);
   }
   printf("\n");


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

Reply via email to