From 6898582cbeae1cb4835757feb84e76855ac281b4 Mon Sep 17 00:00:00 2001 From: joerg Date: Mon, 8 Jun 2015 13:40:58 +0000 Subject: Don't use implicit casts of nullptr to bool. --- .../patch-mozilla_js_src_builtin_TypedObject.cpp | 142 +++++++++++++++++++++ ...ch-mozilla_js_src_frontend_BytecodeCompiler.cpp | 13 ++ 2 files changed, 155 insertions(+) create mode 100644 mail/thunderbird/patches/patch-mozilla_js_src_builtin_TypedObject.cpp create mode 100644 mail/thunderbird/patches/patch-mozilla_js_src_frontend_BytecodeCompiler.cpp (limited to 'mail/thunderbird/patches') diff --git a/mail/thunderbird/patches/patch-mozilla_js_src_builtin_TypedObject.cpp b/mail/thunderbird/patches/patch-mozilla_js_src_builtin_TypedObject.cpp new file mode 100644 index 00000000000..db386654165 --- /dev/null +++ b/mail/thunderbird/patches/patch-mozilla_js_src_builtin_TypedObject.cpp @@ -0,0 +1,142 @@ +$NetBSD: patch-mozilla_js_src_builtin_TypedObject.cpp,v 1.3 2015/06/08 13:40:58 joerg Exp $ + +--- mozilla/js/src/builtin/TypedObject.cpp.orig 2015-05-07 18:53:49.000000000 +0000 ++++ mozilla/js/src/builtin/TypedObject.cpp +@@ -710,12 +710,12 @@ ArrayMetaTypeDescr::construct(JSContext* + contents.append(")"); + RootedAtom stringRepr(cx, contents.finishAtom()); + if (!stringRepr) +- return nullptr; ++ return false; + + // Extract ArrayType.prototype + RootedObject arrayTypePrototype(cx, GetPrototype(cx, arrayTypeGlobal)); + if (!arrayTypePrototype) +- return nullptr; ++ return false; + + // Create the instance of ArrayType + Rooted obj(cx); +@@ -728,7 +728,7 @@ ArrayMetaTypeDescr::construct(JSContext* + if (!JSObject::defineProperty(cx, obj, cx->names().length, + UndefinedHandleValue, nullptr, nullptr, + JSPROP_READONLY | JSPROP_PERMANENT)) +- return nullptr; ++ return false; + + args.rval().setObject(*obj); + return true; +@@ -762,7 +762,7 @@ UnsizedArrayTypeDescr::dimension(JSConte + if (!size.isValid()) { + JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, + JSMSG_TYPEDOBJECT_TOO_BIG); +- return nullptr; ++ return false; + } + + // Construct a canonical string `new ArrayType().dimension(N)`: +@@ -775,7 +775,7 @@ UnsizedArrayTypeDescr::dimension(JSConte + contents.append(")"); + RootedAtom stringRepr(cx, contents.finishAtom()); + if (!stringRepr) +- return nullptr; ++ return false; + + // Create the sized type object. + Rooted obj(cx); +@@ -793,7 +793,7 @@ UnsizedArrayTypeDescr::dimension(JSConte + if (!JSObject::defineProperty(cx, obj, cx->names().length, + lengthVal, nullptr, nullptr, + JSPROP_READONLY | JSPROP_PERMANENT)) +- return nullptr; ++ return false; + + // Add `unsized` property, which is a link from the sized + // array to the unsized array. +@@ -801,7 +801,7 @@ UnsizedArrayTypeDescr::dimension(JSConte + if (!JSObject::defineProperty(cx, obj, cx->names().unsized, + unsizedTypeDescrValue, nullptr, nullptr, + JSPROP_READONLY | JSPROP_PERMANENT)) +- return nullptr; ++ return false; + + args.rval().setObject(*obj); + return true; +@@ -1253,7 +1253,7 @@ DefineSimpleTypeDescr(JSContext* cx, + Rooted proto(cx); + proto = NewObjectWithProto(cx, objProto, nullptr, TenuredObject); + if (!proto) +- return nullptr; ++ return false; + proto->initTypeDescrSlot(*descr); + descr->initReservedSlot(JS_DESCR_SLOT_TYPROTO, ObjectValue(*proto)); + +@@ -1358,14 +1358,14 @@ GlobalObject::initTypedObjectModule(JSCo + #define BINARYDATA_SCALAR_DEFINE(constant_, type_, name_) \ + if (!DefineSimpleTypeDescr(cx, global, module, constant_, \ + cx->names().name_)) \ +- return nullptr; ++ return false; + JS_FOR_EACH_SCALAR_TYPE_REPR(BINARYDATA_SCALAR_DEFINE) + #undef BINARYDATA_SCALAR_DEFINE + + #define BINARYDATA_REFERENCE_DEFINE(constant_, type_, name_) \ + if (!DefineSimpleTypeDescr(cx, global, module, constant_, \ + cx->names().name_)) \ +- return nullptr; ++ return false; + JS_FOR_EACH_REFERENCE_TYPE_REPR(BINARYDATA_REFERENCE_DEFINE) + #undef BINARYDATA_REFERENCE_DEFINE + +@@ -1375,14 +1375,14 @@ GlobalObject::initTypedObjectModule(JSCo + arrayType = DefineMetaTypeDescr( + cx, global, module, TypedObjectModuleObject::ArrayTypePrototype); + if (!arrayType) +- return nullptr; ++ return false; + + RootedValue arrayTypeValue(cx, ObjectValue(*arrayType)); + if (!JSObject::defineProperty(cx, module, cx->names().ArrayType, + arrayTypeValue, + nullptr, nullptr, + JSPROP_READONLY | JSPROP_PERMANENT)) +- return nullptr; ++ return false; + + // StructType. + +@@ -1390,14 +1390,14 @@ GlobalObject::initTypedObjectModule(JSCo + structType = DefineMetaTypeDescr( + cx, global, module, TypedObjectModuleObject::StructTypePrototype); + if (!structType) +- return nullptr; ++ return false; + + RootedValue structTypeValue(cx, ObjectValue(*structType)); + if (!JSObject::defineProperty(cx, module, cx->names().StructType, + structTypeValue, + nullptr, nullptr, + JSPROP_READONLY | JSPROP_PERMANENT)) +- return nullptr; ++ return false; + + // Everything is setup, install module on the global object: + RootedValue moduleValue(cx, ObjectValue(*module)); +@@ -1407,7 +1407,7 @@ GlobalObject::initTypedObjectModule(JSCo + nullptr, nullptr, + 0)) + { +- return nullptr; ++ return false; + } + + return module; +@@ -2466,7 +2466,7 @@ TypedObject::constructUnsized(JSContext* + if (length < 0) { + JS_ReportErrorNumber(cx, js_GetErrorMessage, + nullptr, JSMSG_TYPEDOBJECT_BAD_ARGS); +- return nullptr; ++ return false; + } + Rooted obj(cx, createZeroed(cx, callee, length)); + if (!obj) diff --git a/mail/thunderbird/patches/patch-mozilla_js_src_frontend_BytecodeCompiler.cpp b/mail/thunderbird/patches/patch-mozilla_js_src_frontend_BytecodeCompiler.cpp new file mode 100644 index 00000000000..6420c2b8152 --- /dev/null +++ b/mail/thunderbird/patches/patch-mozilla_js_src_frontend_BytecodeCompiler.cpp @@ -0,0 +1,13 @@ +$NetBSD: patch-mozilla_js_src_frontend_BytecodeCompiler.cpp,v 1.3 2015/06/08 13:40:58 joerg Exp $ + +--- mozilla/js/src/frontend/BytecodeCompiler.cpp.orig 2015-05-07 18:53:49.000000000 +0000 ++++ mozilla/js/src/frontend/BytecodeCompiler.cpp +@@ -544,7 +544,7 @@ CompileFunctionBody(JSContext* cx, Mutab + + RootedScriptSource sourceObject(cx, CreateScriptSourceObject(cx, options)); + if (!sourceObject) +- return nullptr; ++ return false; + ScriptSource* ss = sourceObject->source(); + + SourceCompressionTask sct(cx); -- cgit v1.2.3