Bug 784739 - Switch from NULL to nullptr in miscellaneous directories; r=ehsan

This commit is contained in:
Birunthan Mohanathas 2013-11-11 14:17:14 -05:00
Родитель 1e45690b3d
Коммит 02a1314689
14 изменённых файлов: 27 добавлений и 27 удалений

Просмотреть файл

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