mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-16 13:56:29 +00:00
Bug 784739 - Switch from NULL to nullptr in miscellaneous directories; r=ehsan
This commit is contained in:
parent
1e45690b3d
commit
02a1314689
@ -238,7 +238,7 @@ nsresult LoadInfo::UpdateSystemLoad()
|
||||
nsresult LoadInfo::UpdateProcessLoad() {
|
||||
#if defined(LINUX) || defined(ANDROID)
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, NULL);
|
||||
gettimeofday(&tv, nullptr);
|
||||
const uint64_t total_times = tv.tv_sec * PR_USEC_PER_SEC + tv.tv_usec;
|
||||
|
||||
rusage usage;
|
||||
|
@ -498,7 +498,7 @@ MmsMessage::GetDeliveryInfo(JSContext* aCx, JS::Value* aDeliveryInfo)
|
||||
|
||||
tmpJsVal.setString(tmpJsStr);
|
||||
if (!JS_DefineProperty(aCx, infoJsObj, "receiver", tmpJsVal,
|
||||
NULL, NULL, JSPROP_ENUMERATE)) {
|
||||
nullptr, nullptr, JSPROP_ENUMERATE)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
@ -510,14 +510,14 @@ MmsMessage::GetDeliveryInfo(JSContext* aCx, JS::Value* aDeliveryInfo)
|
||||
|
||||
tmpJsVal.setString(tmpJsStr);
|
||||
if (!JS_DefineProperty(aCx, infoJsObj, "deliveryStatus", tmpJsVal,
|
||||
NULL, NULL, JSPROP_ENUMERATE)) {
|
||||
nullptr, nullptr, JSPROP_ENUMERATE)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
// Get |info.deliveryTimestamp|.
|
||||
if (!JS_DefineProperty(aCx, infoJsObj,
|
||||
"deliveryTimestamp", info.deliveryTimestamp,
|
||||
NULL, NULL, JSPROP_ENUMERATE)) {
|
||||
nullptr, nullptr, JSPROP_ENUMERATE)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -1577,7 +1577,7 @@ TrackPropertiesForSingletonScopes(JSContext *cx, JSScript *script, BaselineFrame
|
||||
// could access are tracked. These are generally accessed through
|
||||
// ALIASEDVAR operations in baseline and will not be tracked even if they
|
||||
// have been accessed in baseline code.
|
||||
JSObject *environment = script->function() ? script->function()->environment() : NULL;
|
||||
JSObject *environment = script->function() ? script->function()->environment() : nullptr;
|
||||
|
||||
while (environment && !environment->is<GlobalObject>()) {
|
||||
if (environment->is<CallObject>() && environment->hasSingletonType())
|
||||
|
@ -8340,8 +8340,8 @@ IonBuilder::getPropTryCommonGetter(bool *emitted, PropertyName *name,
|
||||
{
|
||||
JS_ASSERT(*emitted == false);
|
||||
|
||||
Shape *lastProperty = NULL;
|
||||
JSFunction *commonGetter = NULL;
|
||||
Shape *lastProperty = nullptr;
|
||||
JSFunction *commonGetter = nullptr;
|
||||
JSObject *foundProto = inspector->commonGetPropFunction(pc, &lastProperty, &commonGetter);
|
||||
if (!foundProto)
|
||||
return true;
|
||||
@ -8619,8 +8619,8 @@ IonBuilder::setPropTryCommonSetter(bool *emitted, MDefinition *obj,
|
||||
{
|
||||
JS_ASSERT(*emitted == false);
|
||||
|
||||
Shape *lastProperty = NULL;
|
||||
JSFunction *commonSetter = NULL;
|
||||
Shape *lastProperty = nullptr;
|
||||
JSFunction *commonSetter = nullptr;
|
||||
JSObject *foundProto = inspector->commonSetPropFunction(pc, &lastProperty, &commonSetter);
|
||||
if (!foundProto)
|
||||
return true;
|
||||
|
@ -1124,7 +1124,7 @@ FormatFrame(JSContext *cx, const NonBuiltinScriptFrameIter &iter, char *buf, int
|
||||
if (i < bindings.length()) {
|
||||
name = nameBytes.encodeLatin1(cx, bindings[i].name());
|
||||
if (!buf)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (value) {
|
||||
|
@ -488,7 +488,7 @@ Options(JSContext *cx, unsigned argc, jsval *vp)
|
||||
}
|
||||
}
|
||||
|
||||
char *names = NULL;
|
||||
char *names = nullptr;
|
||||
if (oldOptions.extraWarnings()) {
|
||||
names = JS_sprintf_append(names, "%s", "strict");
|
||||
if (!names) {
|
||||
|
@ -370,7 +370,7 @@ class MutexBase
|
||||
public:
|
||||
MutexBase()
|
||||
{
|
||||
pthread_mutex_init(&mMutex, NULL);
|
||||
pthread_mutex_init(&mMutex, nullptr);
|
||||
}
|
||||
|
||||
void Lock()
|
||||
@ -1259,7 +1259,7 @@ replace_realloc(void* aOldPtr, size_t aSize)
|
||||
return InfallibleAllocPolicy::realloc_(aOldPtr, aSize);
|
||||
}
|
||||
|
||||
// If |aOldPtr| is NULL, the call is equivalent to |malloc(aSize)|.
|
||||
// If |aOldPtr| is nullptr, the call is equivalent to |malloc(aSize)|.
|
||||
if (!aOldPtr) {
|
||||
return replace_malloc(aSize);
|
||||
}
|
||||
|
@ -955,7 +955,7 @@ static const mozilla::Module::CIDEntry kNeckoCIDs[] = {
|
||||
{ &kNS_SERIALIZATION_HELPER_CID, false, nullptr, nsSerializationHelperConstructor },
|
||||
{ &kNS_REDIRECTCHANNELREGISTRAR_CID, false, nullptr, RedirectChannelRegistrarConstructor },
|
||||
{ &kNS_CACHE_STORAGE_SERVICE_CID, false, nullptr, CacheStorageServiceConstructor },
|
||||
{ &kNS_NETWORKSEER_CID, false, NULL, mozilla::net::Seer::Create },
|
||||
{ &kNS_NETWORKSEER_CID, false, nullptr, mozilla::net::Seer::Create },
|
||||
{ nullptr }
|
||||
};
|
||||
|
||||
|
@ -375,7 +375,7 @@ static bool HostIgnoredByProxy(const nsACString& aIgnore,
|
||||
nsDependentCSubstring ignoreStripped(start, slash);
|
||||
PRIPv6Addr ignoreAddr, hostAddr;
|
||||
if (!ConvertToIPV6Addr(ignoreStripped, &ignoreAddr, &mask) ||
|
||||
!ConvertToIPV6Addr(aHost, &hostAddr, NULL))
|
||||
!ConvertToIPV6Addr(aHost, &hostAddr, nullptr))
|
||||
return false;
|
||||
|
||||
proxy_MaskIPv6Addr(ignoreAddr, mask);
|
||||
|
@ -47,7 +47,7 @@ typedef NSInteger NSWindowAnimationBehavior;
|
||||
#endif
|
||||
|
||||
typedef struct _nsCocoaWindowList {
|
||||
_nsCocoaWindowList() : prev(NULL), window(NULL) {}
|
||||
_nsCocoaWindowList() : prev(nullptr), window(nullptr) {}
|
||||
struct _nsCocoaWindowList *prev;
|
||||
nsCocoaWindow *window; // Weak
|
||||
} nsCocoaWindowList;
|
||||
|
@ -162,9 +162,9 @@ Close()
|
||||
|
||||
munmap(Buffers()[0]->Data(), sMappedSize);
|
||||
delete sBuffers;
|
||||
sBuffers = NULL;
|
||||
sBuffers = nullptr;
|
||||
delete sScreenSize;
|
||||
sScreenSize = NULL;
|
||||
sScreenSize = nullptr;
|
||||
|
||||
close(sFd);
|
||||
sFd = -1;
|
||||
|
@ -146,7 +146,7 @@ WinUtils::GetWindowsServicePackVersion(UINT& aOutMajor, UINT& aOutMinor)
|
||||
void
|
||||
WinUtils::LogW(const wchar_t *fmt, ...)
|
||||
{
|
||||
va_list args = NULL;
|
||||
va_list args = nullptr;
|
||||
if(!lstrlenW(fmt)) {
|
||||
return;
|
||||
}
|
||||
@ -169,8 +169,8 @@ WinUtils::LogW(const wchar_t *fmt, ...)
|
||||
char* utf8 = new char[len+1];
|
||||
memset(utf8, 0, sizeof(utf8));
|
||||
if (WideCharToMultiByte(CP_ACP, 0, buffer,
|
||||
-1, utf8, len+1, NULL,
|
||||
NULL) > 0) {
|
||||
-1, utf8, len+1, nullptr,
|
||||
nullptr) > 0) {
|
||||
// desktop console
|
||||
printf("%s\n", utf8);
|
||||
#ifdef PR_LOGGING
|
||||
@ -188,7 +188,7 @@ WinUtils::LogW(const wchar_t *fmt, ...)
|
||||
void
|
||||
WinUtils::Log(const char *fmt, ...)
|
||||
{
|
||||
va_list args = NULL;
|
||||
va_list args = nullptr;
|
||||
if(!strlen(fmt)) {
|
||||
return;
|
||||
}
|
||||
|
@ -67,8 +67,8 @@ nsresult GetProfileHDDInfo(nsAutoCString& aModel, nsAutoCString& aRevision)
|
||||
volumeMountPoint[volumeMountPointLen - 1] = L'\0';
|
||||
}
|
||||
ScopedHandle handle(::CreateFileW(volumeMountPoint, 0,
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
|
||||
OPEN_EXISTING, 0, NULL));
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
||||
nullptr, OPEN_EXISTING, 0, nullptr));
|
||||
if (!handle.IsValid()) {
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ public:
|
||||
MozillaUnRegisterDebugFD(fd);
|
||||
fclose(mFile);
|
||||
mSHA1.finish(aHash);
|
||||
mFile = NULL;
|
||||
mFile = nullptr;
|
||||
}
|
||||
private:
|
||||
FILE *mFile;
|
||||
@ -137,8 +137,8 @@ void LateWriteObserver::Observe(IOInterposeObserver::Observation& aOb)
|
||||
do {
|
||||
// mkstemp isn't supported so keep trying until we get a file
|
||||
int result = _mktemp_s(name, strlen(name) + 1);
|
||||
hFile = CreateFileA(name, GENERIC_WRITE, 0, NULL, CREATE_NEW,
|
||||
FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
hFile = CreateFileA(name, GENERIC_WRITE, 0, nullptr, CREATE_NEW,
|
||||
FILE_ATTRIBUTE_NORMAL, nullptr);
|
||||
} while (GetLastError() == ERROR_FILE_EXISTS);
|
||||
|
||||
if (hFile == INVALID_HANDLE_VALUE) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user