Bug 784739 - Switch from NULL to nullptr in xpcom/ (3/3); r=ehsan

This commit is contained in:
Birunthan Mohanathas 2013-10-10 16:42:16 -04:00
parent 3926b031ae
commit 3bd29c41c6
69 changed files with 158 additions and 156 deletions

View File

@ -17,7 +17,7 @@ PrepareAndDispatch(uint32_t methodIndex, nsXPTCStubBase* self, uint32_t* args)
#define PARAM_BUFFER_COUNT 16
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
const nsXPTMethodInfo* info;
uint8_t paramCount;
uint8_t i;

View File

@ -20,7 +20,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args)
const uint8_t NUM_ARG_REGS = 6-1; // -1 for "this" pointer
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
const nsXPTMethodInfo* info;
uint8_t paramCount;
uint8_t i;

View File

@ -33,7 +33,7 @@ PrepareAndDispatch(nsXPTCStubBase * self, uint32_t methodIndex,
uint64_t * args, uint64_t * gpregs, double *fpregs)
{
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
const nsXPTMethodInfo* info;
uint32_t paramCount;
uint32_t i;

View File

@ -47,7 +47,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
#define PARAM_BUFFER_COUNT 16
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
const nsXPTMethodInfo* info;
uint8_t paramCount;
uint8_t i;

View File

@ -13,8 +13,8 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
#define PARAM_BUFFER_COUNT 16
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
nsIInterfaceInfo* iface_info = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
nsIInterfaceInfo* iface_info = nullptr;
const nsXPTMethodInfo* info;
uint8_t paramCount;
uint8_t i;

View File

@ -30,7 +30,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
#define PARAM_BUFFER_COUNT 16
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
const nsXPTMethodInfo* info;
uint8_t paramCount;
uint8_t i;

View File

@ -17,7 +17,7 @@ PrepareAndDispatch(uint32_t methodIndex, nsXPTCStubBase* self, uint32_t* args)
#define PARAM_BUFFER_COUNT 16
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
const nsXPTMethodInfo* info;
uint8_t paramCount;
uint8_t i;

View File

@ -24,7 +24,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
#define PARAM_BUFFER_COUNT 16
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
const nsXPTMethodInfo* info;
nsresult result = NS_ERROR_FAILURE;
uint64_t* iargs = intargs;

View File

@ -25,7 +25,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
#define PARAM_BUFFER_COUNT 16
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
const nsXPTMethodInfo* info;
nsresult result = NS_ERROR_FAILURE;
uint64_t* iargs = intargs;

View File

@ -20,7 +20,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args)
const uint8_t NUM_ARG_REGS = 6-1; // -1 for "this" pointer
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
const nsXPTMethodInfo* info;
uint8_t paramCount;
uint8_t i;

View File

@ -15,7 +15,7 @@ extern "C" {
#define PARAM_BUFFER_COUNT 16
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
const nsXPTMethodInfo* info;
uint8_t paramCount;
uint8_t i;

View File

@ -16,7 +16,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
#define PARAM_BUFFER_COUNT 16
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
const nsXPTMethodInfo* info;
uint8_t paramCount;
uint8_t i;

View File

@ -16,7 +16,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
#define PARAM_BUFFER_COUNT 16
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
const nsXPTMethodInfo* info;
uint8_t paramCount;
uint8_t i;

View File

@ -23,7 +23,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
#define PARAM_BUFFER_COUNT 16
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
const nsXPTMethodInfo* info;
uint8_t paramCount;
uint8_t i;

View File

@ -29,7 +29,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
#define PARAM_FPR_COUNT 7
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
const nsXPTMethodInfo* info;
uint8_t paramCount;
uint8_t i;

View File

@ -18,8 +18,8 @@ extern "C" {
#define PARAM_BUFFER_COUNT 16
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
nsIInterfaceInfo* iface_info = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
nsIInterfaceInfo* iface_info = nullptr;
const nsXPTMethodInfo* info;
uint8_t paramCount;
uint8_t i;

View File

@ -20,8 +20,8 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
#define PARAM_BUFFER_COUNT 16
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
nsIInterfaceInfo* iface_info = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
nsIInterfaceInfo* iface_info = nullptr;
const nsXPTMethodInfo* info;
uint8_t paramCount;
uint8_t i;

View File

@ -27,8 +27,8 @@ PrepareAndDispatch(nsXPTCStubBase* self, int methodIndex, uint32_t* data,
int intCount = 0;
int floatCount = 0;
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
nsIInterfaceInfo* iface_info = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
nsIInterfaceInfo* iface_info = nullptr;
const nsXPTMethodInfo* info;
uint8_t paramCount;
uint8_t i;

View File

@ -27,7 +27,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
#define PARAM_BUFFER_COUNT 16
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
const nsXPTMethodInfo* info;
int32_t regwords = 1; /* self pointer is not in the variant records */
nsresult result = NS_ERROR_FAILURE;

View File

@ -40,7 +40,7 @@ PrepareAndDispatch(nsXPTCStubBase* self,
double *fprData)
{
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
const nsXPTMethodInfo* info;
uint32_t paramCount;
uint32_t i;

View File

@ -28,8 +28,8 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args, u
#define PARAM_GPR_COUNT 7
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
const nsXPTMethodInfo* info = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
const nsXPTMethodInfo* info = nullptr;
uint8_t paramCount;
uint8_t i;
nsresult result = NS_ERROR_FAILURE;

View File

@ -23,8 +23,8 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint64_t methodIndex, uint64_t* args, u
#define PARAM_GPR_COUNT 7
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
const nsXPTMethodInfo* info = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
const nsXPTMethodInfo* info = nullptr;
uint8_t paramCount;
uint8_t i;
nsresult result = NS_ERROR_FAILURE;

View File

@ -39,8 +39,8 @@ PrepareAndDispatch(nsXPTCStubBase* self,
double *fprData)
{
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
const nsXPTMethodInfo* info = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
const nsXPTMethodInfo* info = nullptr;
uint32_t paramCount;
uint32_t i;
nsresult result = NS_ERROR_FAILURE;

View File

@ -35,8 +35,8 @@ PrepareAndDispatch(nsXPTCStubBase* self,
double *fprData)
{
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
nsIInterfaceInfo* iface_info = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
nsIInterfaceInfo* iface_info = nullptr;
const nsXPTMethodInfo* info;
uint32_t paramCount;
uint32_t i;

View File

@ -36,8 +36,8 @@ PrepareAndDispatch(nsXPTCStubBase* self,
double *fprData)
{
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
const nsXPTMethodInfo* info = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
const nsXPTMethodInfo* info = nullptr;
uint32_t paramCount;
uint32_t i;
nsresult result = NS_ERROR_FAILURE;

View File

@ -47,7 +47,7 @@ PrepareAndDispatch(
#define PARAM_GPR_COUNT 7
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant *dispatchParams = NULL;
nsXPTCMiniVariant *dispatchParams = nullptr;
const nsXPTMethodInfo *methodInfo;
uint8_t paramCount;
uint8_t i;

View File

@ -18,7 +18,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint64_t methodIndex, uint64_t* args)
#define PARAM_BUFFER_COUNT 16
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
const nsXPTMethodInfo* info;
uint8_t paramCount;
uint8_t i;

View File

@ -22,8 +22,8 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
#define PARAM_BUFFER_COUNT 16
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
nsIInterfaceInfo* iface_info = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
nsIInterfaceInfo* iface_info = nullptr;
const nsXPTMethodInfo* info;
uint8_t paramCount;
uint8_t i;

View File

@ -22,8 +22,8 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
#define PARAM_BUFFER_COUNT 16
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
nsIInterfaceInfo* iface_info = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
nsIInterfaceInfo* iface_info = nullptr;
const nsXPTMethodInfo* info;
uint8_t paramCount;
uint8_t i;

View File

@ -23,7 +23,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
#define PARAM_BUFFER_COUNT 16
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
const nsXPTMethodInfo* info;
uint8_t paramCount;
uint8_t i;

View File

@ -18,7 +18,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint64_t methodIndex, uint64_t* args)
#define PARAM_BUFFER_COUNT 16
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
const nsXPTMethodInfo* info;
uint8_t paramCount;
uint8_t i;

View File

@ -35,7 +35,7 @@ PrepareAndDispatch(nsXPTCStubBase * self, uint32_t methodIndex,
uint64_t * args, uint64_t * gpregs, double *fpregs)
{
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
const nsXPTMethodInfo* info;
uint32_t paramCount;
uint32_t i;

View File

@ -35,7 +35,7 @@ PrepareAndDispatch(nsXPTCStubBase * self, uint32_t methodIndex,
uint64_t * args, uint64_t * gpregs, double *fpregs)
{
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
const nsXPTMethodInfo* info;
uint32_t paramCount;
uint32_t i;

View File

@ -35,7 +35,7 @@ PrepareAndDispatch(nsXPTCStubBase * self, uint32_t methodIndex,
uint64_t * args, uint64_t * gpregs, double *fpregs)
{
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
const nsXPTMethodInfo* info;
uint32_t paramCount;
uint32_t i;

View File

@ -15,7 +15,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
#define PARAM_BUFFER_COUNT 16
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
const nsXPTMethodInfo* info;
uint8_t paramCount;
uint8_t i;

View File

@ -24,8 +24,8 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
#define PARAM_BUFFER_COUNT 16
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
const nsXPTMethodInfo* info = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
const nsXPTMethodInfo* info = nullptr;
uint8_t paramCount;
uint8_t i;
nsresult result = NS_ERROR_FAILURE;

View File

@ -24,8 +24,8 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
#define PARAM_FPR_COUNT 3
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
const nsXPTMethodInfo* info = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
const nsXPTMethodInfo* info = nullptr;
uint8_t paramCount;
uint8_t i;
nsresult result = NS_ERROR_FAILURE;

View File

@ -28,8 +28,8 @@ PrepareAndDispatch(nsXPTCStubBase * self, uint32_t methodIndex,
#define PARAM_FPR_COUNT 3
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
const nsXPTMethodInfo* info = NULL;
nsXPTCMiniVariant* dispatchParams = nullptr;
const nsXPTMethodInfo* info = nullptr;
uint8_t paramCount;
uint8_t i;
nsresult result = NS_ERROR_FAILURE;

View File

@ -1132,11 +1132,11 @@ const char* FooBarImpl::ImplName()
NS_IMETHODIMP
FooBarImpl::QueryInterface(REFNSIID aIID, void** aInstancePtr)
{
if (NULL == aInstancePtr) {
if (nullptr == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
*aInstancePtr = NULL;
*aInstancePtr = nullptr;
if (aIID.Equals(NS_GET_IID(nsIFoo))) {
@ -1303,11 +1303,11 @@ NS_IMETHODIMP FooBarImpl2::BarMethod2(int32_t i)
NS_IMETHODIMP
FooBarImpl2::QueryInterface(REFNSIID aIID, void** aInstancePtr)
{
if (NULL == aInstancePtr) {
if (nullptr == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
*aInstancePtr = NULL;
*aInstancePtr = nullptr;
if (aIID.Equals(NS_GET_IID(nsIFoo))) {

View File

@ -59,8 +59,8 @@ xptiInterfaceEntry::xptiInterfaceEntry(const char* name,
, mMethodBaseIndex(0)
, mConstantBaseIndex(0)
, mTypelib(aTypelib)
, mParent(NULL)
, mInfo(NULL)
, mParent(nullptr)
, mInfo(nullptr)
, mFlags(0)
{
memcpy(mName, name, nameLength);
@ -191,7 +191,7 @@ xptiInterfaceEntry::GetMethodInfo(uint16_t index, const nsXPTMethodInfo** info)
mDescriptor->num_methods)
{
NS_ERROR("bad param");
*info = NULL;
*info = nullptr;
return NS_ERROR_INVALID_ARG;
}
@ -245,7 +245,7 @@ xptiInterfaceEntry::GetConstant(uint16_t index, const nsXPTConstant** constant)
mDescriptor->num_constants)
{
NS_PRECONDITION(0, "bad param");
*constant = NULL;
*constant = nullptr;
return NS_ERROR_INVALID_ARG;
}

View File

@ -35,8 +35,8 @@ XPTInterfaceInfoManager::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf)
ReentrantMonitorAutoEnter monitor(mWorkingSet.mTableReentrantMonitor);
// The entries themselves are allocated out of an arena accounted
// for elsewhere, so don't measure them
n += mWorkingSet.mIIDTable.SizeOfExcludingThis(NULL, aMallocSizeOf);
n += mWorkingSet.mNameTable.SizeOfExcludingThis(NULL, aMallocSizeOf);
n += mWorkingSet.mIIDTable.SizeOfExcludingThis(nullptr, aMallocSizeOf);
n += mWorkingSet.mNameTable.SizeOfExcludingThis(nullptr, aMallocSizeOf);
return n;
}

View File

@ -37,7 +37,7 @@ void
XPTInterfaceInfoManager::xptiWorkingSet::InvalidateInterfaceInfos()
{
ReentrantMonitorAutoEnter monitor(mTableReentrantMonitor);
mNameTable.EnumerateRead(xpti_Invalidator, NULL);
mNameTable.EnumerateRead(xpti_Invalidator, nullptr);
}
XPTInterfaceInfoManager::xptiWorkingSet::~xptiWorkingSet()

View File

@ -71,7 +71,7 @@ int main (int argc, char **argv) {
#endif
// XXX: nsIServiceManager is no more; what do we test with?
if (info5 == NULL) {
if (info5 == nullptr) {
fprintf(stderr, "\nNo nsIComponentManager; cannot continue.\n");
return 1;
}

View File

@ -44,7 +44,7 @@ nsSampleImpl::~nsSampleImpl()
* The _CI variant adds support for nsIClassInfo, which permits introspection
* and interface flattening.
*/
NS_IMPL_CLASSINFO(nsSampleImpl, NULL, 0, NS_SAMPLE_CID)
NS_IMPL_CLASSINFO(nsSampleImpl, nullptr, 0, NS_SAMPLE_CID)
NS_IMPL_ISUPPORTS1_CI(nsSampleImpl, nsISample)
/**
* Notice that in the protoype for this function, the NS_IMETHOD macro was

View File

@ -33,10 +33,10 @@ NS_DEFINE_NAMED_CID(NS_SAMPLE_CID);
// Build a table of ClassIDs (CIDs) which are implemented by this module. CIDs
// should be completely unique UUIDs.
// each entry has the form { CID, service, factoryproc, constructorproc }
// where factoryproc is usually NULL.
// where factoryproc is usually nullptr.
static const mozilla::Module::CIDEntry kSampleCIDs[] = {
{ &kNS_SAMPLE_CID, false, NULL, nsSampleImplConstructor },
{ NULL }
{ &kNS_SAMPLE_CID, false, nullptr, nsSampleImplConstructor },
{ nullptr }
};
// Build a table which maps contract IDs to CIDs.
@ -45,7 +45,7 @@ static const mozilla::Module::CIDEntry kSampleCIDs[] = {
// to modify or extend functionality.
static const mozilla::Module::ContractIDEntry kSampleContracts[] = {
{ NS_SAMPLE_CONTRACTID, &kNS_SAMPLE_CID },
{ NULL }
{ nullptr }
};
// Category entries are category/key/value triples which can be used
@ -55,7 +55,7 @@ static const mozilla::Module::ContractIDEntry kSampleContracts[] = {
// @see nsICategoryManager for information on retrieving category data.
static const mozilla::Module::CategoryEntry kSampleCategories[] = {
{ "my-category", "my-key", NS_SAMPLE_CONTRACTID },
{ NULL }
{ nullptr }
};
static const mozilla::Module kSampleModule = {

View File

@ -569,7 +569,7 @@ void
nsTString_CharT::AssignWithConversion( const incompatible_char_type* aData, int32_t aLength )
{
// for compatibility with the old string implementation, we need to allow
// for a NULL input buffer :-(
// for a nullptr input buffer :-(
if (!aData)
{
Truncate();

View File

@ -124,7 +124,7 @@ int main(int argc, char *argv[])
ret = ProcessArgs(registrar, argc, argv);
} // this scopes the nsCOMPtrs
// no nsCOMPtrs are allowed to be alive when you call NS_ShutdownXPCOM
rv = NS_ShutdownXPCOM( NULL );
rv = NS_ShutdownXPCOM(nullptr);
NS_ASSERTION(NS_SUCCEEDED(rv), "NS_ShutdownXPCOM failed");
return ret;
}

View File

@ -46,7 +46,7 @@ Test01_raw( nsIDOMNode* aDOMNode, nsString* aResult )
/*
This test is designed to be more like a typical large function where,
because you are working with several resources, you don't just return when
one of them is |NULL|. Similarly: |Test01_nsCOMPtr00|, and |Test01_nsIPtr00|.
one of them is |nullptr|. Similarly: |Test01_nsCOMPtr00|, and |Test01_nsIPtr00|.
*/
nsIDOMNode* node = aDOMNode;
@ -64,7 +64,7 @@ Test01_raw_optimized( nsIDOMNode* aDOMNode, nsString* aResult )
{
/*
This test simulates smaller functions where you _do_ just return
|NULL| at the first sign of trouble. Similarly: |Test01_nsCOMPtr01|,
|nullptr| at the first sign of trouble. Similarly: |Test01_nsCOMPtr01|,
and |Test01_nsIPtr01|.
*/

View File

@ -101,17 +101,17 @@ class ScopedXPCOM : public nsIDirectoryServiceProvider2
NS_DECL_ISUPPORTS
ScopedXPCOM(const char* testName,
nsIDirectoryServiceProvider *dirSvcProvider = NULL)
nsIDirectoryServiceProvider *dirSvcProvider = nullptr)
: mDirSvcProvider(dirSvcProvider)
{
mTestName = testName;
printf("Running %s tests...\n", mTestName);
nsresult rv = NS_InitXPCOM2(&mServMgr, NULL, this);
nsresult rv = NS_InitXPCOM2(&mServMgr, nullptr, this);
if (NS_FAILED(rv))
{
fail("NS_InitXPCOM2 returned failure code 0x%x", rv);
mServMgr = NULL;
mServMgr = nullptr;
return;
}
}
@ -140,7 +140,7 @@ class ScopedXPCOM : public nsIDirectoryServiceProvider2
if (mServMgr)
{
NS_RELEASE(mServMgr);
nsresult rv = NS_ShutdownXPCOM(NULL);
nsresult rv = NS_ShutdownXPCOM(nullptr);
if (NS_FAILED(rv))
{
fail("XPCOM shutdown failed with code 0x%x", rv);
@ -153,7 +153,7 @@ class ScopedXPCOM : public nsIDirectoryServiceProvider2
bool failed()
{
return mServMgr == NULL;
return mServMgr == nullptr;
}
already_AddRefed<nsIFile> GetProfileDirectory()

View File

@ -29,7 +29,7 @@ int main(int argc, char** argv)
return -1;
}
char* cp = id.ToString();
if (NULL == cp) {
if (nullptr == cp) {
fprintf(stderr, "TestID: ToString failed on test #%d\n", i);
return -1;
}

View File

@ -15,7 +15,7 @@
#include <stdio.h>
static nsIObserverService *anObserverService = NULL;
static nsIObserverService *anObserverService = nullptr;
static void testResult( nsresult rv ) {
if ( NS_SUCCEEDED( rv ) ) {

View File

@ -108,7 +108,7 @@ NS_IMETHODIMP_(void*) BackwardsAllocator::Alloc(size_t size)
if (size != mSize)
{
NS_ERROR("umm, why would this be reached for this test?");
return NULL;
return nullptr;
}
uint32_t index = mIndex;
@ -123,13 +123,13 @@ NS_IMETHODIMP_(void*) BackwardsAllocator::Alloc(size_t size)
}
NS_ERROR("shouldn't reach here in this test");
return NULL;
return nullptr;
}
NS_IMETHODIMP_(void*) BackwardsAllocator::Realloc(void* ptr, size_t newSize)
{
NS_ERROR("shouldn't reach here in this test");
return NULL;
return nullptr;
}
NS_IMETHODIMP_(void) BackwardsAllocator::Free(void* ptr)

View File

@ -448,7 +448,7 @@ main(int argc, char* argv[])
nsresult rv;
nsCOMPtr<nsIServiceManager> servMgr;
rv = NS_InitXPCOM2(getter_AddRefs(servMgr), NULL, NULL);
rv = NS_InitXPCOM2(getter_AddRefs(servMgr), nullptr, nullptr);
if (NS_FAILED(rv)) return rv;
if (argc > 1 && nsCRT::strcmp(argv[1], "-trace") == 0)
@ -460,7 +460,7 @@ main(int argc, char* argv[])
RunTests(4096, 16);
servMgr = 0;
rv = NS_ShutdownXPCOM( NULL );
rv = NS_ShutdownXPCOM(nullptr);
NS_ASSERTION(NS_SUCCEEDED(rv), "NS_ShutdownXPCOM failed");
return 0;

View File

@ -231,14 +231,14 @@ CreateFactory(const mozilla::Module& module, const mozilla::Module::CIDEntry& en
}
static const mozilla::Module::CIDEntry kLocalCIDs[] = {
{ &kFactoryCID1, false, CreateFactory, NULL },
{ &kFactoryCID2, false, CreateFactory, NULL },
{ NULL }
{ &kFactoryCID1, false, CreateFactory, nullptr },
{ &kFactoryCID2, false, CreateFactory, nullptr },
{ nullptr }
};
static const mozilla::Module::ContractIDEntry kLocalContracts[] = {
{ FACTORY_CONTRACTID, &kFactoryCID2 },
{ NULL }
{ nullptr }
};
static const mozilla::Module kLocalModule = {

View File

@ -111,7 +111,7 @@ bool TestContractFirst()
nsCOMPtr<nsIComponentRegistrar> r;
NS_GetComponentRegistrar(getter_AddRefs(r));
nsCID* cid = NULL;
nsCID* cid = nullptr;
nsresult rv = r->ContractIDToCID("@mozilla.org/RegTestOrderC;1", &cid);
if (NS_FAILED(rv)) {
fail("RegTestOrderC: contract not registered");
@ -175,7 +175,7 @@ int main(int argc, char** argv)
XRE_AddManifestLocation(NS_COMPONENT_LOCATION,
nsCOMPtr<nsIFile>(GetRegDirectory(regPath, "extension", "extComponent.manifest")));
XRE_AddJarManifestLocation(NS_COMPONENT_LOCATION,
nsCOMPtr<nsIFile>(GetRegDirectory(regPath, "extension2.jar", NULL)));
nsCOMPtr<nsIFile>(GetRegDirectory(regPath, "extension2.jar", nullptr)));
ScopedXPCOM xpcom("RegistrationOrder");
if (xpcom.failed())
return 1;

View File

@ -11,7 +11,7 @@ void main(int argc, char* argv[])
{
nsresult rv;
nsIServiceManager* servMgr;
rv = NS_InitXPCOM2(&servMgr, NULL, NULL);
rv = NS_InitXPCOM2(&servMgr, nullptr, nullptr);
NS_ASSERTION(NS_SUCCEEDED(rv), "NS_InitXPCOM failed");
// try loading a component and releasing it to see if it leaks

View File

@ -19,8 +19,8 @@ DummyConstructorFunc(nsISupports* aOuter, const nsIID& aIID, void** aResult)
}
static const mozilla::Module::CIDEntry kTestCIDs[] = {
{ &kNS_TESTING_CID, false, NULL, DummyConstructorFunc },
{ NULL }
{ &kNS_TESTING_CID, false, nullptr, DummyConstructorFunc },
{ nullptr }
};
static const mozilla::Module kTestModule = {

View File

@ -18,9 +18,9 @@ DummyConstructorFunc(nsISupports* aOuter, const nsIID& aIID, void** aResult)
}
static const mozilla::Module::CIDEntry kTestCIDs[] = {
{ &kNS_TESTING_CID, false, NULL, DummyConstructorFunc },
{ &kNS_TESTING_CID, false, NULL, DummyConstructorFunc },
{ NULL }
{ &kNS_TESTING_CID, false, nullptr, DummyConstructorFunc },
{ &kNS_TESTING_CID, false, nullptr, DummyConstructorFunc },
{ nullptr }
};
static const mozilla::Module kTestModule = {

View File

@ -18,8 +18,8 @@ DummyConstructorFunc(nsISupports* aOuter, const nsIID& aIID, void** aResult)
}
static const mozilla::Module::CIDEntry kTestCIDs[] = {
{ &kNS_TESTING_CID, false, NULL, DummyConstructorFunc },
{ NULL }
{ &kNS_TESTING_CID, false, nullptr, DummyConstructorFunc },
{ nullptr }
};
static const mozilla::Module kTestModule = {

View File

@ -93,13 +93,13 @@ nsresult nsTestComFactory::CreateInstance(nsISupports *aOuter,
const nsIID &aIID,
void **aResult)
{
if (aOuter != NULL) {
if (aOuter != nullptr) {
return NS_ERROR_NO_AGGREGATION;
}
nsTestCom *t = new nsTestCom();
if (t == NULL) {
if (t == nullptr) {
return NS_ERROR_OUT_OF_MEMORY;
}
@ -128,7 +128,7 @@ int main(int argc, char *argv[])
nsITestCom *iTestCom;
iFactory->LockServer(TRUE);
iFactory->CreateInstance(NULL, IID_IUnknown, (void **) &iUnknown);
iFactory->CreateInstance(nullptr, IID_IUnknown, (void **) &iUnknown);
iFactory->LockServer(FALSE);
GUID testGUID = NS_ITEST_COM_IID;

View File

@ -16,12 +16,12 @@ LRESULT CALLBACK WndProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam);
void ErrorBox(LPSTR text)
{
MessageBox(NULL, text, "XP Event Loop", MB_OK | MB_ICONSTOP);
MessageBox(nullptr, text, "XP Event Loop", MB_OK | MB_ICONSTOP);
}
void InfoBox(LPSTR text)
{
MessageBox(NULL, text, "XP Event Loop", MB_OK | MB_ICONINFORMATION);
MessageBox(nullptr, text, "XP Event Loop", MB_OK | MB_ICONINFORMATION);
}
int WINAPI WinMain(HINSTANCE inst,
@ -61,12 +61,12 @@ int WINAPI WinMain(HINSTANCE inst,
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = inst;
wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
wndclass.hIcon = LoadIcon(nullptr, IDI_APPLICATION);
wndclass.hCursor = LoadCursor(nullptr, IDC_ARROW);
wndclass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
wndclass.lpszMenuName = NULL;
wndclass.lpszMenuName = nullptr;
wndclass.lpszClassName = lpszAppName;
wndclass.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
wndclass.hIconSm = LoadIcon(nullptr, IDI_APPLICATION);
RegisterClassEx(&wndclass) ;
@ -74,7 +74,7 @@ int WINAPI WinMain(HINSTANCE inst,
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
NULL, NULL, inst, NULL);
nullptr, nullptr, inst, nullptr);
ShowWindow(wnd, nShowCmd);
UpdateWindow(wnd);

View File

@ -34,9 +34,9 @@ nsresult TestPermissions()
// Security variables
DWORD result;
PSID everyoneSID = NULL, adminSID = NULL;
PACL dirACL = NULL, fileACL = NULL;
PSECURITY_DESCRIPTOR dirSD = NULL, fileSD = NULL;
PSID everyoneSID = nullptr, adminSID = nullptr;
PACL dirACL = nullptr, fileACL = nullptr;
PSECURITY_DESCRIPTOR dirSD = nullptr, fileSD = nullptr;
EXPLICIT_ACCESS ea[2];
SID_IDENTIFIER_AUTHORITY SIDAuthWorld =
SECURITY_WORLD_SID_AUTHORITY;
@ -86,7 +86,7 @@ nsresult TestPermissions()
ea[1].Trustee.ptstrName = (LPTSTR) adminSID;
// Create a new ACL that contains the new ACEs.
result = SetEntriesInAcl(2, ea, NULL, &dirACL);
result = SetEntriesInAcl(2, ea, nullptr, &dirACL);
if (ERROR_SUCCESS != result)
{
fail("NTFS Permissions: SetEntriesInAcl Error");
@ -96,7 +96,7 @@ nsresult TestPermissions()
// Initialize a security descriptor.
dirSD = (PSECURITY_DESCRIPTOR) LocalAlloc(LPTR,
SECURITY_DESCRIPTOR_MIN_LENGTH);
if (NULL == dirSD)
if (nullptr == dirSD)
{
fail("NTFS Permissions: LocalAlloc Error");
return NS_ERROR_FAILURE;
@ -128,8 +128,8 @@ nsresult TestPermissions()
return NS_ERROR_FAILURE;
}
GetFullPathNameW((LPCWSTR)L".\\NTFSPERMTEMP1", MAX_PATH, dir1Path, NULL);
GetFullPathNameW((LPCWSTR)L".\\NTFSPERMTEMP1", MAX_PATH, dir1Path,
nullptr);
rv = NS_NewLocalFile(nsEmbedString(dir1Path), false,
getter_AddRefs(tempDirectory1));
@ -144,10 +144,10 @@ nsresult TestPermissions()
tempFileHandle = CreateFileW(L".\\NTFSPERMTEMP1\\NTFSPerm.tmp",
GENERIC_READ | GENERIC_WRITE,
0,
NULL, //default security
nullptr, //default security
CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
NULL);
nullptr);
if(tempFileHandle == INVALID_HANDLE_VALUE)
{
@ -158,7 +158,7 @@ nsresult TestPermissions()
CloseHandle(tempFileHandle);
GetFullPathNameW((LPCWSTR)L".\\NTFSPERMTEMP1\\NTFSPerm.tmp",
MAX_PATH, filePath, NULL);
MAX_PATH, filePath, nullptr);
rv = NS_NewLocalFile(nsEmbedString(filePath), false,
getter_AddRefs(tempFile));
@ -172,7 +172,7 @@ nsresult TestPermissions()
ea[0].grfAccessPermissions = GENERIC_ALL | STANDARD_RIGHTS_ALL;
// Update the ACL to contain the new ACEs.
result = SetEntriesInAcl(2, ea, NULL, &dirACL);
result = SetEntriesInAcl(2, ea, nullptr, &dirACL);
if (ERROR_SUCCESS != result)
{
fail("NTFS Permissions: SetEntriesInAcl 2 Error");
@ -193,8 +193,8 @@ nsresult TestPermissions()
return NS_ERROR_FAILURE;
}
GetFullPathNameW((LPCWSTR)L".\\NTFSPERMTEMP2", MAX_PATH, dir2Path, NULL);
GetFullPathNameW((LPCWSTR)L".\\NTFSPERMTEMP2", MAX_PATH, dir2Path,
nullptr);
rv = NS_NewLocalFile(nsEmbedString(dir2Path), false,
getter_AddRefs(tempDirectory2));
@ -218,7 +218,8 @@ nsresult TestPermissions()
SE_FILE_OBJECT,
DACL_SECURITY_INFORMATION |
UNPROTECTED_DACL_SECURITY_INFORMATION,
NULL, NULL, &fileACL, NULL, &fileSD);
nullptr, nullptr, &fileACL, nullptr,
&fileSD);
if (ERROR_SUCCESS != result)
{
fail("NTFS Permissions: GetNamedSecurityDescriptor Error");

View File

@ -45,10 +45,10 @@ nsresult TestWinAttribs()
hIndexed = CreateFileW(L".\\indexbit.txt",
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
nullptr,
CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL, //FILE_ATTRIBUTE_NOT_CONTENT_INDEXED, not supported by cf
NULL);
nullptr);
if(hIndexed == INVALID_HANDLE_VALUE)
{
@ -59,7 +59,7 @@ nsresult TestWinAttribs()
CloseHandle(hIndexed);
GetFullPathNameW((LPCWSTR)L".\\indexbit.txt",
MAX_PATH, filePath, NULL);
MAX_PATH, filePath, nullptr);
//wprintf(filePath);
//wprintf(L"\n");

View File

@ -59,7 +59,7 @@ volatile PRIntervalTime gTimestamp = PR_INTERVAL_NO_WAIT;
#ifdef REPORT_CHROME_HANGS
// Main thread ID used in reporting chrome hangs under Windows
static HANDLE winMainThreadHandle = NULL;
static HANDLE winMainThreadHandle = nullptr;
// Default timeout for reporting chrome hangs to Telemetry (5 seconds)
static const int32_t DEFAULT_CHROME_HANG_INTERVAL = 5;
@ -232,11 +232,11 @@ Startup()
MOZ_ASSERT(!gMonitor, "Hang monitor already initialized");
gMonitor = new Monitor("HangMonitor");
Preferences::RegisterCallback(PrefChanged, kHangMonitorPrefName, NULL);
PrefChanged(NULL, NULL);
Preferences::RegisterCallback(PrefChanged, kHangMonitorPrefName, nullptr);
PrefChanged(nullptr, nullptr);
#ifdef REPORT_CHROME_HANGS
Preferences::RegisterCallback(PrefChanged, kTelemetryPrefName, NULL);
Preferences::RegisterCallback(PrefChanged, kTelemetryPrefName, nullptr);
winMainThreadHandle =
OpenThread(THREAD_ALL_ACCESS, FALSE, GetCurrentThreadId());
if (!winMainThreadHandle)
@ -251,7 +251,7 @@ Startup()
gThread = PR_CreateThread(PR_USER_THREAD,
ThreadMain,
NULL, PR_PRIORITY_LOW, PR_GLOBAL_THREAD,
nullptr, PR_PRIORITY_LOW, PR_GLOBAL_THREAD,
PR_JOINABLE_THREAD, 0);
}
@ -272,11 +272,11 @@ Shutdown()
// thread creation could theoretically fail
if (gThread) {
PR_JoinThread(gThread);
gThread = NULL;
gThread = nullptr;
}
delete gMonitor;
gMonitor = NULL;
gMonitor = nullptr;
}
static bool
@ -289,11 +289,11 @@ IsUIMessageWaiting()
#define NS_WM_IMELAST WM_IME_KEYUP
BOOL haveUIMessageWaiting = FALSE;
MSG msg;
haveUIMessageWaiting |= ::PeekMessageW(&msg, NULL, WM_KEYFIRST,
haveUIMessageWaiting |= ::PeekMessageW(&msg, nullptr, WM_KEYFIRST,
WM_IME_KEYLAST, PM_NOREMOVE);
haveUIMessageWaiting |= ::PeekMessageW(&msg, NULL, NS_WM_IMEFIRST,
haveUIMessageWaiting |= ::PeekMessageW(&msg, nullptr, NS_WM_IMEFIRST,
NS_WM_IMELAST, PM_NOREMOVE);
haveUIMessageWaiting |= ::PeekMessageW(&msg, NULL, WM_MOUSEFIRST,
haveUIMessageWaiting |= ::PeekMessageW(&msg, nullptr, WM_MOUSEFIRST,
WM_MOUSELAST, PM_NOREMOVE);
return haveUIMessageWaiting;
#endif

View File

@ -53,8 +53,9 @@ nsEnvironment::Exists(const nsAString& aName, bool *aOutValue)
nsAutoCString nativeVal;
#if defined(XP_UNIX)
/* For Unix/Linux platforms we follow the Unix definition:
* An environment variable exists when |getenv()| returns a non-NULL value.
* An environment variable does not exist when |getenv()| returns NULL.
* An environment variable exists when |getenv()| returns a non-nullptr
* value. An environment variable does not exist when |getenv()| returns
* nullptr.
*/
const char *value = PR_GetEnv(nativeName.get());
*aOutValue = value && *value;

View File

@ -140,7 +140,7 @@ static int assembleCmdLine(char *const *argv, PRUnichar **wideCmdLine,
+ 1; /* space in between, or final null */
}
p = cmdLine = (char *) PR_MALLOC(cmdLineSize*sizeof(char));
if (p == NULL) {
if (p == nullptr) {
return -1;
}
@ -213,7 +213,7 @@ static int assembleCmdLine(char *const *argv, PRUnichar **wideCmdLine,
}
*p = '\0';
int32_t numChars = MultiByteToWideChar(codePage, 0, cmdLine, -1, NULL, 0);
int32_t numChars = MultiByteToWideChar(codePage, 0, cmdLine, -1, nullptr, 0);
*wideCmdLine = (PRUnichar *) PR_MALLOC(numChars*sizeof(PRUnichar));
MultiByteToWideChar(codePage, 0, cmdLine, -1, *wideCmdLine, numChars);
PR_Free(cmdLine);
@ -242,7 +242,7 @@ void nsProcess::Monitor(void *arg)
{
MutexAutoLock lock(process->mLock);
CloseHandle(process->mProcess);
process->mProcess = NULL;
process->mProcess = nullptr;
process->mExitValue = exitCode;
if (process->mShutdown)
return;
@ -339,8 +339,8 @@ nsProcess::CopyArgsAndRunProcess(bool blocking, const char** args,
uint32_t count, nsIObserver* observer,
bool holdWeak)
{
// Add one to the count for the program name and one for NULL termination.
char **my_argv = NULL;
// Add one to the count for the program name and one for null termination.
char **my_argv = nullptr;
my_argv = (char**)NS_Alloc(sizeof(char*) * (count + 2));
if (!my_argv) {
return NS_ERROR_OUT_OF_MEMORY;
@ -352,7 +352,7 @@ nsProcess::CopyArgsAndRunProcess(bool blocking, const char** args,
my_argv[i + 1] = const_cast<char*>(args[i]);
}
my_argv[count + 1] = NULL;
my_argv[count + 1] = nullptr;
nsresult rv = RunProcess(blocking, my_argv, observer, holdWeak, false);
@ -381,8 +381,8 @@ nsProcess::CopyArgsAndRunProcessw(bool blocking, const PRUnichar** args,
uint32_t count, nsIObserver* observer,
bool holdWeak)
{
// Add one to the count for the program name and one for NULL termination.
char **my_argv = NULL;
// Add one to the count for the program name and one for null termination.
char **my_argv = nullptr;
my_argv = (char**)NS_Alloc(sizeof(char*) * (count + 2));
if (!my_argv) {
return NS_ERROR_OUT_OF_MEMORY;
@ -394,7 +394,7 @@ nsProcess::CopyArgsAndRunProcessw(bool blocking, const PRUnichar** args,
my_argv[i + 1] = ToNewUTF8String(nsDependentString(args[i]));
}
my_argv[count + 1] = NULL;
my_argv[count + 1] = nullptr;
nsresult rv = RunProcess(blocking, my_argv, observer, holdWeak, true);
@ -428,11 +428,11 @@ nsProcess::RunProcess(bool blocking, char **my_argv, nsIObserver* observer,
#if defined(PROCESSMODEL_WINAPI)
BOOL retVal;
PRUnichar *cmdLine = NULL;
PRUnichar *cmdLine = nullptr;
// The 'argv' array is null-terminated and always starts with the program path.
// If the second slot is non-null then arguments are being passed.
if (my_argv[1] != NULL &&
if (my_argv[1] != nullptr &&
assembleCmdLine(my_argv + 1, &cmdLine, argsUTF8 ? CP_UTF8 : CP_ACP) == -1) {
return NS_ERROR_FILE_EXECUTION_FAILED;
}
@ -448,7 +448,7 @@ nsProcess::RunProcess(bool blocking, char **my_argv, nsIObserver* observer,
SHELLEXECUTEINFOW sinfo;
memset(&sinfo, 0, sizeof(SHELLEXECUTEINFOW));
sinfo.cbSize = sizeof(SHELLEXECUTEINFOW);
sinfo.hwnd = NULL;
sinfo.hwnd = nullptr;
sinfo.lpFile = wideFile.get();
sinfo.nShow = SW_SHOWNORMAL;
sinfo.fMask = SEE_MASK_FLAG_DDEWAIT |
@ -487,7 +487,7 @@ nsProcess::RunProcess(bool blocking, char **my_argv, nsIObserver* observer,
// Note that the 'argv' array is already null-terminated, which 'posix_spawnp' requires.
pid_t newPid = 0;
int result = posix_spawnp(&newPid, my_argv[0], NULL, &spawnattr, my_argv, *_NSGetEnviron());
int result = posix_spawnp(&newPid, my_argv[0], nullptr, &spawnattr, my_argv, *_NSGetEnviron());
mPid = static_cast<int32_t>(newPid);
posix_spawnattr_destroy(&spawnattr);
@ -496,7 +496,7 @@ nsProcess::RunProcess(bool blocking, char **my_argv, nsIObserver* observer,
return NS_ERROR_FAILURE;
}
#else
mProcess = PR_CreateProcess(my_argv[0], my_argv, NULL, NULL);
mProcess = PR_CreateProcess(my_argv[0], my_argv, nullptr, nullptr);
if (!mProcess)
return NS_ERROR_FAILURE;
struct MYProcess {

View File

@ -41,7 +41,7 @@ AppendAndRemoveThread(PRThread *key, nsRefPtr<nsThread> &thread, void *arg)
// statically allocated instance
NS_IMETHODIMP_(nsrefcnt) nsThreadManager::AddRef() { return 2; }
NS_IMETHODIMP_(nsrefcnt) nsThreadManager::Release() { return 1; }
NS_IMPL_CLASSINFO(nsThreadManager, NULL,
NS_IMPL_CLASSINFO(nsThreadManager, nullptr,
nsIClassInfo::THREADSAFE | nsIClassInfo::SINGLETON,
NS_THREADMANAGER_CID)
NS_IMPL_QUERY_INTERFACE1_CI(nsThreadManager, nsIThreadManager)

View File

@ -57,7 +57,7 @@ private:
NS_IMPL_ADDREF(nsThreadPool)
NS_IMPL_RELEASE(nsThreadPool)
NS_IMPL_CLASSINFO(nsThreadPool, NULL, nsIClassInfo::THREADSAFE,
NS_IMPL_CLASSINFO(nsThreadPool, nullptr, nsIClassInfo::THREADSAFE,
NS_THREADPOOL_CID)
NS_IMPL_QUERY_INTERFACE3_CI(nsThreadPool, nsIThreadPool, nsIEventTarget,
nsIRunnable)

View File

@ -115,7 +115,7 @@ wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
L"Click Ignore to continue running the Application.",
lpszCmdLine);
msg[size - 1] = L'\0';
return MessageBoxW(NULL, msg, L"NSGlue_Assertion",
return MessageBoxW(nullptr, msg, L"NSGlue_Assertion",
MB_ICONSTOP | MB_SYSTEMMODAL |
MB_ABORTRETRYIGNORE | MB_DEFBUTTON3);
}