Bug 784739 - Switch from NULL to nullptr in gfx/src/; r=ehsan

--HG--
extra : rebase_source : 28d7747c0a41a87ee064129b4f06ee23f1731c12
This commit is contained in:
Birunthan Mohanathas 2013-07-20 11:48:56 +03:00
parent 90f650a127
commit ac753ddb61
5 changed files with 18 additions and 18 deletions

View File

@ -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 <typename T>
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)

View File

@ -276,7 +276,7 @@ nsDeviceContext::FontMetricsDeleted(const nsFontMetrics* aFontMetrics)
bool
nsDeviceContext::IsPrinterSurface()
{
return(mPrintingSurface != NULL);
return mPrintingSurface != nullptr;
}
void

View File

@ -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

View File

@ -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;

View File

@ -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
};