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'
This commit is contained in:
Chris Peterson 2016-05-31 21:49:52 -07:00
parent ed15e4ee96
commit 553aca4e35
4 changed files with 5 additions and 4 deletions

View File

@ -548,7 +548,8 @@ WrapperAnswer::RecvClassName(const ObjectId& objId, nsCString* name)
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));

View File

@ -60,7 +60,7 @@ MIRType MIRTypeFromValue(const js::Value& vp)
case JS_UNINITIALIZED_LEXICAL:
return MIRType::MagicUninitializedLexical;
default:
MOZ_ASSERT(!"Unexpected magic constant");
MOZ_ASSERT_UNREACHABLE("Unexpected magic constant");
}
}
return MIRTypeFromValueType(vp.extractNonDoubleType());

View File

@ -1645,7 +1645,7 @@ DoCompareFallback(JSContext* cx, void* payload, ICCompare_Fallback* stub_, Handl
return false;
break;
default:
MOZ_ASSERT(!"Unhandled baseline compare op");
MOZ_ASSERT_UNREACHABLE("Unhandled baseline compare op");
return false;
}

View File

@ -7122,7 +7122,7 @@ ArenaLists::normalizeBackgroundFinalizeState(AllocKind thingKind)
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;
}
}