diff --git a/gfx/src/X11Util.h b/gfx/src/X11Util.h index 8fd42f0dd9ca..9659a0004b22 100644 --- a/gfx/src/X11Util.h +++ b/gfx/src/X11Util.h @@ -44,8 +44,8 @@ DefaultXDisplay() /** * Sets *aVisual to point to aDisplay's Visual struct corresponding to * aVisualID, and *aDepth to its depth. When aVisualID is None, these are set - * to NULL and 0 respectively. Both out-parameter pointers are assumed - * non-NULL. + * to nullptr and 0 respectively. Both out-parameter pointers are assumed + * non-nullptr. */ void FindVisualAndDepth(Display* aDisplay, VisualID aVisualID, @@ -72,8 +72,8 @@ template struct ScopedXFreePtrTraits { typedef T *type; - static T *empty() { return NULL; } - static void release(T *ptr) { if (ptr!=NULL) XFree(ptr); } + static T *empty() { return nullptr; } + static void release(T *ptr) { if (ptr != nullptr) XFree(ptr); } }; SCOPED_TEMPLATE(ScopedXFree, ScopedXFreePtrTraits) diff --git a/gfx/src/nsDeviceContext.cpp b/gfx/src/nsDeviceContext.cpp index dc917ab76d84..d81e66adacb6 100644 --- a/gfx/src/nsDeviceContext.cpp +++ b/gfx/src/nsDeviceContext.cpp @@ -276,7 +276,7 @@ nsDeviceContext::FontMetricsDeleted(const nsFontMetrics* aFontMetrics) bool nsDeviceContext::IsPrinterSurface() { - return(mPrintingSurface != NULL); + return mPrintingSurface != nullptr; } void diff --git a/gfx/src/nsDeviceContext.h b/gfx/src/nsDeviceContext.h index d94b88d14609..b97b53f56aac 100644 --- a/gfx/src/nsDeviceContext.h +++ b/gfx/src/nsDeviceContext.h @@ -163,7 +163,7 @@ public: * EndDocument() or AbortDocument(). * * @param aTitle - title of Document - * @param aPrintToFileName - name of file to print to, if NULL + * @param aPrintToFileName - name of file to print to, if nullptr * then don't print to file * @param aStartPage - starting page number (must be greater than zero) * @param aEndPage - ending page number (must be less than or diff --git a/gfx/src/nsScriptableRegion.cpp b/gfx/src/nsScriptableRegion.cpp index 806e2d9ec498..889f652204f8 100644 --- a/gfx/src/nsScriptableRegion.cpp +++ b/gfx/src/nsScriptableRegion.cpp @@ -139,10 +139,10 @@ NS_IMETHODIMP nsScriptableRegion::GetRects(JSContext* aCx, JS::Value* aRects) const nsIntRect *rect; while ((rect = iter.Next())) { - if (!JS_DefineElement(aCx, destArray, n, INT_TO_JSVAL(rect->x), NULL, NULL, JSPROP_ENUMERATE) || - !JS_DefineElement(aCx, destArray, n + 1, INT_TO_JSVAL(rect->y), NULL, NULL, JSPROP_ENUMERATE) || - !JS_DefineElement(aCx, destArray, n + 2, INT_TO_JSVAL(rect->width), NULL, NULL, JSPROP_ENUMERATE) || - !JS_DefineElement(aCx, destArray, n + 3, INT_TO_JSVAL(rect->height), NULL, NULL, JSPROP_ENUMERATE)) { + if (!JS_DefineElement(aCx, destArray, n, INT_TO_JSVAL(rect->x), nullptr, nullptr, JSPROP_ENUMERATE) || + !JS_DefineElement(aCx, destArray, n + 1, INT_TO_JSVAL(rect->y), nullptr, nullptr, JSPROP_ENUMERATE) || + !JS_DefineElement(aCx, destArray, n + 2, INT_TO_JSVAL(rect->width), nullptr, nullptr, JSPROP_ENUMERATE) || + !JS_DefineElement(aCx, destArray, n + 3, INT_TO_JSVAL(rect->height), nullptr, nullptr, JSPROP_ENUMERATE)) { return NS_ERROR_FAILURE; } n += 4; diff --git a/gfx/src/nsThebesGfxFactory.cpp b/gfx/src/nsThebesGfxFactory.cpp index 839f90424cdc..bf1bcd767452 100644 --- a/gfx/src/nsThebesGfxFactory.cpp +++ b/gfx/src/nsThebesGfxFactory.cpp @@ -51,17 +51,17 @@ NS_DEFINE_NAMED_CID(NS_SCRIPTABLE_REGION_CID); NS_DEFINE_NAMED_CID(NS_GFX_INITIALIZATION_CID); static const mozilla::Module::CIDEntry kThebesCIDs[] = { - { &kNS_FONT_ENUMERATOR_CID, false, NULL, nsThebesFontEnumeratorConstructor }, - { &kNS_SCRIPTABLE_REGION_CID, false, NULL, nsScriptableRegionConstructor }, - { &kNS_GFX_INITIALIZATION_CID, false, NULL, GfxInitializationConstructor }, - { NULL } + { &kNS_FONT_ENUMERATOR_CID, false, nullptr, nsThebesFontEnumeratorConstructor }, + { &kNS_SCRIPTABLE_REGION_CID, false, nullptr, nsScriptableRegionConstructor }, + { &kNS_GFX_INITIALIZATION_CID, false, nullptr, GfxInitializationConstructor }, + { nullptr } }; static const mozilla::Module::ContractIDEntry kThebesContracts[] = { { "@mozilla.org/gfx/fontenumerator;1", &kNS_FONT_ENUMERATOR_CID }, { "@mozilla.org/gfx/region;1", &kNS_SCRIPTABLE_REGION_CID }, { "@mozilla.org/gfx/init;1", &kNS_GFX_INITIALIZATION_CID }, - { NULL } + { nullptr } }; static void @@ -74,9 +74,9 @@ static const mozilla::Module kThebesModule = { mozilla::Module::kVersion, kThebesCIDs, kThebesContracts, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, nsThebesGfxModuleDtor };