Bug 1276567 - Fix -Wstring-conversion warnings in js/ directory. r=billm
authorChris Peterson <cpeterson@mozilla.com>
Tue, 31 May 2016 21:49:52 -0700
changeset 299935 3d71c62d3caab2611ad632fc19f23e58637f4263
parent 299934 61308d76e0121ee33b2732062b8ca31e7f0a3200
child 299936 2327aa1520508c5c0d5722916c5a5b81b32a41c1
push id19486
push usercbook@mozilla.com
push dateThu, 02 Jun 2016 10:01:49 +0000
treeherderfx-team@58ac3bd12914 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm
bugs1276567
milestone49.0a1
Bug 1276567 - Fix -Wstring-conversion warnings in js/ directory. r=billm js/ipc/WrapperAnswer.cpp:531:16 [-Wstring-conversion] implicit conversion turns string literal into bool: 'const char [12]' to 'bool' js/src/jit/MIR.h:63:25 [-Wstring-conversion] implicit conversion turns string literal into bool: 'const char [26]' to 'bool' js/src/jit/SharedIC.cpp:1648:21 [-Wstring-conversion] implicit conversion turns string literal into bool: 'const char [30]' to 'bool' js/src/jsgc.cpp:7135:21 [-Wstring-conversion] implicit conversion turns string literal into bool: 'const char [59]' to 'bool'
js/ipc/WrapperAnswer.cpp
js/src/jit/MIR.h
js/src/jit/SharedIC.cpp
js/src/jsgc.cpp
--- a/js/ipc/WrapperAnswer.cpp
+++ b/js/ipc/WrapperAnswer.cpp
@@ -543,17 +543,18 @@ WrapperAnswer::RecvClassName(const Objec
     AutoJSAPI jsapi;
     if (NS_WARN_IF(!jsapi.Init(scopeForTargetObjects())))
         return false;
     JSContext* cx = jsapi.cx();
 
     RootedObject obj(cx, findObjectById(cx, objId));
     if (!obj) {
         // This is very unfortunate, but we have no choice.
-        return "<dead CPOW>";
+        *name = "<dead CPOW>";
+        return true;
     }
 
     LOG("%s.className()", ReceiverObj(objId));
 
     *name = js::ObjectClassName(cx, obj);
     return true;
 }
 
--- a/js/src/jit/MIR.h
+++ b/js/src/jit/MIR.h
@@ -55,17 +55,17 @@ MIRType MIRTypeFromValue(const js::Value
             return MIRType::MagicOptimizedOut;
           case JS_ELEMENTS_HOLE:
             return MIRType::MagicHole;
           case JS_IS_CONSTRUCTING:
             return MIRType::MagicIsConstructing;
           case JS_UNINITIALIZED_LEXICAL:
             return MIRType::MagicUninitializedLexical;
           default:
-            MOZ_ASSERT(!"Unexpected magic constant");
+            MOZ_ASSERT_UNREACHABLE("Unexpected magic constant");
         }
     }
     return MIRTypeFromValueType(vp.extractNonDoubleType());
 }
 
 // If simdType is one of the SIMD types suported by Ion, set mirType to the
 // corresponding MIRType, and return true.
 //
--- a/js/src/jit/SharedIC.cpp
+++ b/js/src/jit/SharedIC.cpp
@@ -1640,17 +1640,17 @@ DoCompareFallback(JSContext* cx, void* p
         if (!StrictlyEqual<true>(cx, &lhsCopy, &rhsCopy, &out))
             return false;
         break;
       case JSOP_STRICTNE:
         if (!StrictlyEqual<false>(cx, &lhsCopy, &rhsCopy, &out))
             return false;
         break;
       default:
-        MOZ_ASSERT(!"Unhandled baseline compare op");
+        MOZ_ASSERT_UNREACHABLE("Unhandled baseline compare op");
         return false;
     }
 
     ret.setBoolean(out);
 
     // Check if debug mode toggling made the stub invalid.
     if (stub.invalid())
         return true;
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -7117,17 +7117,17 @@ js::PurgeJITCaches(Zone* zone)
 void
 ArenaLists::normalizeBackgroundFinalizeState(AllocKind thingKind)
 {
     ArenaLists::BackgroundFinalizeState* bfs = &backgroundFinalizeState[thingKind];
     switch (*bfs) {
       case BFS_DONE:
         break;
       default:
-        MOZ_ASSERT(!"Background finalization in progress, but it should not be.");
+        MOZ_ASSERT_UNREACHABLE("Background finalization in progress, but it should not be.");
         break;
     }
 }
 
 void
 ArenaLists::adoptArenas(JSRuntime* rt, ArenaLists* fromArenaLists)
 {
     // GC should be inactive, but still take the lock as a kind of read fence.