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

--HG--
extra : rebase_source : 8ace754e117a12e2599f5a90030f13a3a7064fed
This commit is contained in:
Birunthan Mohanathas 2013-11-25 14:02:47 -05:00
parent 46363842f7
commit 1e8f99fd01
16 changed files with 72 additions and 64 deletions

View File

@ -185,7 +185,7 @@ private:
{ {
D2D1_RECT_F mBounds; D2D1_RECT_F mBounds;
union { union {
// If mPath is non-NULL, the mTransform member will be used, otherwise // If mPath is non-null, the mTransform member will be used, otherwise
// the mIsPixelAligned member is valid. // the mIsPixelAligned member is valid.
D2D1_MATRIX_3X2_F mTransform; D2D1_MATRIX_3X2_F mTransform;
bool mIsPixelAligned; bool mIsPixelAligned;

View File

@ -122,7 +122,7 @@ struct TestEntry {
isRTL = true; isRTL = true;
} }
// empty/NULL fontName means ignore font name // Empty/nullptr fontName means ignore font name
void Expect (const char *platform, void Expect (const char *platform,
const char *fontName, const char *fontName,
const LiteralArray& glyphs) const LiteralArray& glyphs)

View File

@ -343,8 +343,9 @@ NS_GFX_(void) ScaleYCbCrToRGB565(const uint8_t *y_buf,
that would require the mis-alignment to be the same for the U and V that would require the mis-alignment to be the same for the U and V
planes.*/ planes.*/
NS_ASSERTION((y_pitch&15) == 0 && (uv_pitch&15) == 0 && NS_ASSERTION((y_pitch&15) == 0 && (uv_pitch&15) == 0 &&
((y_buf-(uint8_t *)NULL)&15) == 0 && ((y_buf-(uint8_t *)nullptr)&15) == 0 &&
((u_buf-(uint8_t *)NULL)&15) == 0 && ((v_buf-(uint8_t *)NULL)&15) == 0, ((u_buf-(uint8_t *)nullptr)&15) == 0 &&
((v_buf-(uint8_t *)nullptr)&15) == 0,
"ScaleYCbCrToRGB565 source image unaligned"); "ScaleYCbCrToRGB565 source image unaligned");
/*We take an area-based approach to pixel coverage to avoid shifting by small /*We take an area-based approach to pixel coverage to avoid shifting by small
amounts (or not so small, when up-scaling or down-scaling by a large amounts (or not so small, when up-scaling or down-scaling by a large

View File

@ -21,7 +21,10 @@ NS_GetComplexLineBreaks(const PRUnichar* aText, uint32_t aLength,
return; return;
} }
CFStringTokenizerRef st = ::CFStringTokenizerCreate(kCFAllocatorDefault, str, ::CFRangeMake(0, aLength), kCFStringTokenizerUnitLineBreak, NULL); CFStringTokenizerRef st = ::CFStringTokenizerCreate(kCFAllocatorDefault, str,
::CFRangeMake(0, aLength),
kCFStringTokenizerUnitLineBreak,
nullptr);
if (!st) { if (!st) {
::CFRelease(str); ::CFRelease(str);
return; return;

View File

@ -703,7 +703,7 @@ CountHeap(JSContext *cx, unsigned argc, jsval *vp)
RootedValue traceValue(cx); RootedValue traceValue(cx);
int32_t traceKind = -1; int32_t traceKind = -1;
void *traceThing = NULL; void *traceThing = nullptr;
if (args.length() > 1) { if (args.length() > 1) {
JSString *str = ToString(cx, args[1]); JSString *str = ToString(cx, args[1]);
if (!str) if (!str)

View File

@ -517,7 +517,7 @@ GlobalObject::warnOnceAboutWatch(JSContext *cx, HandleObject obj)
HeapSlot &v = global->getSlotRef(WARNED_WATCH_DEPRECATED); HeapSlot &v = global->getSlotRef(WARNED_WATCH_DEPRECATED);
if (v.isUndefined()) { if (v.isUndefined()) {
// Warn only once per global object. // Warn only once per global object.
if (!JS_ReportErrorFlagsAndNumber(cx, JSREPORT_WARNING, js_GetErrorMessage, NULL, if (!JS_ReportErrorFlagsAndNumber(cx, JSREPORT_WARNING, js_GetErrorMessage, nullptr,
JSMSG_OBJECT_WATCH_DEPRECATED)) JSMSG_OBJECT_WATCH_DEPRECATED))
{ {
return false; return false;

View File

@ -3,6 +3,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file, * License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */ * You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <stagefright/ColorConverter.h> #include <stagefright/ColorConverter.h>
#include <stagefright/DataSource.h> #include <stagefright/DataSource.h>
#include <stagefright/MediaExtractor.h> #include <stagefright/MediaExtractor.h>
@ -117,11 +118,11 @@ public:
} }
bool HasVideo() { bool HasVideo() {
return mVideoSource != NULL; return mVideoSource != nullptr;
} }
bool HasAudio() { bool HasAudio() {
return mAudioSource != NULL; return mAudioSource != nullptr;
} }
bool ReadVideo(VideoFrame *aFrame, int64_t aSeekTimeUs, BufferCallback *aBufferCallback); bool ReadVideo(VideoFrame *aFrame, int64_t aSeekTimeUs, BufferCallback *aBufferCallback);
@ -142,9 +143,9 @@ OmxDecoder::OmxDecoder(PluginHost *aPluginHost, Decoder *aDecoder) :
mAudioChannels(-1), mAudioChannels(-1),
mAudioSampleRate(-1), mAudioSampleRate(-1),
mDurationUs(-1), mDurationUs(-1),
mVideoBuffer(NULL), mVideoBuffer(nullptr),
mAudioBuffer(NULL), mAudioBuffer(nullptr),
mColorConverter(NULL), mColorConverter(nullptr),
mAudioMetadataRead(false) mAudioMetadataRead(false)
{ {
} }
@ -184,9 +185,9 @@ public:
}; };
#ifdef MOZ_WIDGET_GONK #ifdef MOZ_WIDGET_GONK
static sp<IOMX> sOMX = NULL; static sp<IOMX> sOMX = nullptr;
static sp<IOMX> GetOMX() { static sp<IOMX> GetOMX() {
if(sOMX.get() == NULL) { if(sOMX.get() == nullptr) {
sOMX = reinterpret_cast<IOMX*>(new OMX); sOMX = reinterpret_cast<IOMX*>(new OMX);
} }
return sOMX; return sOMX;
@ -233,9 +234,9 @@ static sp<MediaSource> CreateVideoSource(PluginHost* aPluginHost,
if (flags == DEFAULT_STAGEFRIGHT_FLAGS) { if (flags == DEFAULT_STAGEFRIGHT_FLAGS) {
// Let Stagefright choose hardware or software decoder. // Let Stagefright choose hardware or software decoder.
sp<MediaSource> videoSource = OMXCodec::Create(aOmx, aVideoTrack->getFormat(), sp<MediaSource> videoSource = OMXCodec::Create(aOmx, aVideoTrack->getFormat(),
false, aVideoTrack, NULL, flags); false, aVideoTrack, nullptr, flags);
if (videoSource == NULL) if (videoSource == nullptr)
return NULL; return nullptr;
// Now that OMXCodec has parsed the video's AVCDecoderConfigurationRecord, // Now that OMXCodec has parsed the video's AVCDecoderConfigurationRecord,
// check whether we know how to decode this video. // check whether we know how to decode this video.
@ -281,7 +282,7 @@ static sp<MediaSource> CreateVideoSource(PluginHost* aPluginHost,
MOZ_ASSERT(flags != DEFAULT_STAGEFRIGHT_FLAGS); MOZ_ASSERT(flags != DEFAULT_STAGEFRIGHT_FLAGS);
return OMXCodec::Create(aOmx, aVideoTrack->getFormat(), false, aVideoTrack, return OMXCodec::Create(aOmx, aVideoTrack->getFormat(), false, aVideoTrack,
NULL, flags); nullptr, flags);
} }
bool OmxDecoder::Init() { bool OmxDecoder::Init() {
@ -295,14 +296,14 @@ bool OmxDecoder::Init() {
} }
sp<MediaExtractor> extractor = MediaExtractor::Create(dataSource); sp<MediaExtractor> extractor = MediaExtractor::Create(dataSource);
if (extractor == NULL) { if (extractor == nullptr) {
return false; return false;
} }
ssize_t audioTrackIndex = -1; ssize_t audioTrackIndex = -1;
ssize_t videoTrackIndex = -1; ssize_t videoTrackIndex = -1;
const char *audioMime = NULL; const char *audioMime = nullptr;
const char *videoMime = NULL; const char *videoMime = nullptr;
for (size_t i = 0; i < extractor->countTracks(); ++i) { for (size_t i = 0; i < extractor->countTracks(); ++i) {
sp<MetaData> meta = extractor->getTrackMetaData(i); sp<MetaData> meta = extractor->getTrackMetaData(i);
@ -341,14 +342,14 @@ bool OmxDecoder::Init() {
sp<MediaSource> videoTrack; sp<MediaSource> videoTrack;
sp<MediaSource> videoSource; sp<MediaSource> videoSource;
if (videoTrackIndex != -1 && (videoTrack = extractor->getTrack(videoTrackIndex)) != NULL) { if (videoTrackIndex != -1 && (videoTrack = extractor->getTrack(videoTrackIndex)) != nullptr) {
#if defined(MOZ_ANDROID_FROYO) #if defined(MOZ_ANDROID_FROYO)
// Allow up to 720P video. // Allow up to 720P video.
sp<MetaData> meta = extractor->getTrackMetaData(videoTrackIndex); sp<MetaData> meta = extractor->getTrackMetaData(videoTrackIndex);
meta->setInt32(kKeyMaxInputSize, (1280 * 720 * 3) / 2); meta->setInt32(kKeyMaxInputSize, (1280 * 720 * 3) / 2);
#endif #endif
videoSource = CreateVideoSource(mPluginHost, omx, videoTrack); videoSource = CreateVideoSource(mPluginHost, omx, videoTrack);
if (videoSource == NULL) { if (videoSource == nullptr) {
LOG("OMXCodec failed to initialize video decoder for \"%s\"", videoMime); LOG("OMXCodec failed to initialize video decoder for \"%s\"", videoMime);
return false; return false;
} }
@ -368,7 +369,7 @@ bool OmxDecoder::Init() {
sp<MediaSource> audioTrack; sp<MediaSource> audioTrack;
sp<MediaSource> audioSource; sp<MediaSource> audioSource;
if (audioTrackIndex != -1 && (audioTrack = extractor->getTrack(audioTrackIndex)) != NULL) if (audioTrackIndex != -1 && (audioTrack = extractor->getTrack(audioTrackIndex)) != nullptr)
{ {
if (!strcasecmp(audioMime, "audio/raw")) { if (!strcasecmp(audioMime, "audio/raw")) {
audioSource = audioTrack; audioSource = audioTrack;
@ -379,7 +380,7 @@ bool OmxDecoder::Init() {
audioTrack); audioTrack);
} }
if (audioSource == NULL) { if (audioSource == nullptr) {
LOG("OMXCodec failed to initialize audio decoder for \"%s\"", audioMime); LOG("OMXCodec failed to initialize audio decoder for \"%s\"", audioMime);
return false; return false;
} }
@ -544,14 +545,14 @@ bool OmxDecoder::SetAudioFormat() {
void OmxDecoder::ReleaseVideoBuffer() { void OmxDecoder::ReleaseVideoBuffer() {
if (mVideoBuffer) { if (mVideoBuffer) {
mVideoBuffer->release(); mVideoBuffer->release();
mVideoBuffer = NULL; mVideoBuffer = nullptr;
} }
} }
void OmxDecoder::ReleaseAudioBuffer() { void OmxDecoder::ReleaseAudioBuffer() {
if (mAudioBuffer) { if (mAudioBuffer) {
mAudioBuffer->release(); mAudioBuffer->release();
mAudioBuffer = NULL; mAudioBuffer = nullptr;
} }
} }
@ -899,7 +900,7 @@ static const char* const gCodecs[] = {
"avc1.4D401E", // H.264 Main Profile Level 3.0 "avc1.4D401E", // H.264 Main Profile Level 3.0
"avc1.4D401F", // H.264 Main Profile Level 3.1 "avc1.4D401F", // H.264 Main Profile Level 3.1
"mp4a.40.2", // AAC-LC "mp4a.40.2", // AAC-LC
NULL nullptr
}; };
static bool CanDecode(const char *aMimeChars, size_t aMimeLen, const char* const**aCodecs) static bool CanDecode(const char *aMimeChars, size_t aMimeLen, const char* const**aCodecs)

View File

@ -645,7 +645,7 @@ DataChannelConnection::SctpDtlsInput(TransportFlow *flow,
if (PR_LOG_TEST(GetSCTPLog(), PR_LOG_DEBUG)) { if (PR_LOG_TEST(GetSCTPLog(), PR_LOG_DEBUG)) {
char *buf; char *buf;
if ((buf = usrsctp_dumppacket((void *)data, len, SCTP_DUMP_INBOUND)) != NULL) { if ((buf = usrsctp_dumppacket((void *)data, len, SCTP_DUMP_INBOUND)) != nullptr) {
PR_LogPrint("%s", buf); PR_LogPrint("%s", buf);
usrsctp_freedumpbuffer(buf); usrsctp_freedumpbuffer(buf);
} }
@ -677,7 +677,7 @@ DataChannelConnection::SctpDtlsOutput(void *addr, void *buffer, size_t length,
if (PR_LOG_TEST(GetSCTPLog(), PR_LOG_DEBUG)) { if (PR_LOG_TEST(GetSCTPLog(), PR_LOG_DEBUG)) {
char *buf; char *buf;
if ((buf = usrsctp_dumppacket(buffer, length, SCTP_DUMP_OUTBOUND)) != NULL) { if ((buf = usrsctp_dumppacket(buffer, length, SCTP_DUMP_OUTBOUND)) != nullptr) {
PR_LogPrint("%s", buf); PR_LogPrint("%s", buf);
usrsctp_freedumpbuffer(buf); usrsctp_freedumpbuffer(buf);
} }

View File

@ -111,7 +111,7 @@ int RunGTestFunc()
} }
// We use a static var 'RunGTest' defined in nsAppRunner.cpp. // We use a static var 'RunGTest' defined in nsAppRunner.cpp.
// RunGTest is initialized to NULL but if GTest (this file) // RunGTest is initialized to nullptr but if GTest (this file)
// is linked in then RunGTest will be set here indicating // is linked in then RunGTest will be set here indicating
// GTest is supported. // GTest is supported.
class _InitRunGTest { class _InitRunGTest {

View File

@ -134,7 +134,7 @@ char* strtok2(char* string, const char* delims, char* *newStr)
} }
*newStr = str; *newStr = str;
return str == result ? NULL : result; return str == result ? nullptr : result;
} }
@ -218,9 +218,9 @@ string nssconfigdir;
vector<server_info_t> servers; vector<server_info_t> servers;
PRNetAddr remote_addr; PRNetAddr remote_addr;
PRNetAddr websocket_server; PRNetAddr websocket_server;
PRThreadPool* threads = NULL; PRThreadPool* threads = nullptr;
PRLock* shutdown_lock = NULL; PRLock* shutdown_lock = nullptr;
PRCondVar* shutdown_condvar = NULL; PRCondVar* shutdown_condvar = nullptr;
// Not really used, unless something fails to start // Not really used, unless something fails to start
bool shutdown_server = false; bool shutdown_server = false;
bool do_http_proxy = false; bool do_http_proxy = false;
@ -322,19 +322,19 @@ bool ConfigureSSLServerSocket(PRFileDesc* socket, server_info_t* si, string &cer
const char* certnick = certificate.empty() ? const char* certnick = certificate.empty() ?
si->cert_nickname.c_str() : certificate.c_str(); si->cert_nickname.c_str() : certificate.c_str();
ScopedCERTCertificate cert(PK11_FindCertFromNickname(certnick, NULL)); ScopedCERTCertificate cert(PK11_FindCertFromNickname(certnick, nullptr));
if (!cert) { if (!cert) {
LOG_ERROR(("Failed to find cert %s\n", certnick)); LOG_ERROR(("Failed to find cert %s\n", certnick));
return false; return false;
} }
ScopedSECKEYPrivateKey privKey(PK11_FindKeyByAnyCert(cert, NULL)); ScopedSECKEYPrivateKey privKey(PK11_FindKeyByAnyCert(cert, nullptr));
if (!privKey) { if (!privKey) {
LOG_ERROR(("Failed to find private key\n")); LOG_ERROR(("Failed to find private key\n"));
return false; return false;
} }
PRFileDesc* ssl_socket = SSL_ImportFD(NULL, socket); PRFileDesc* ssl_socket = SSL_ImportFD(nullptr, socket);
if (!ssl_socket) { if (!ssl_socket) {
LOG_ERROR(("Error importing SSL socket\n")); LOG_ERROR(("Error importing SSL socket\n"));
return false; return false;
@ -934,7 +934,7 @@ void StartServer(void* data)
char* password_func(PK11SlotInfo* slot, PRBool retry, void* arg) char* password_func(PK11SlotInfo* slot, PRBool retry, void* arg)
{ {
if (retry) if (retry)
return NULL; return nullptr;
return PL_strdup(""); return PL_strdup("");
} }
@ -948,7 +948,7 @@ server_info_t* findServerInfo(int portnumber)
return &(*it); return &(*it);
} }
return NULL; return nullptr;
} }
int processConfigLine(char* configLine) int processConfigLine(char* configLine)
@ -1009,7 +1009,7 @@ int processConfigLine(char* configLine)
if (!strcmp(keyword, "listen")) if (!strcmp(keyword, "listen"))
{ {
char* hostname = strtok2(_caret, ":", &_caret); char* hostname = strtok2(_caret, ":", &_caret);
char* hostportstring = NULL; char* hostportstring = nullptr;
if (strcmp(hostname, "*")) if (strcmp(hostname, "*"))
{ {
any_host_spec_config = true; any_host_spec_config = true;
@ -1046,19 +1046,22 @@ int processConfigLine(char* configLine)
server_info_t server; server_info_t server;
server.cert_nickname = certnick; server.cert_nickname = certnick;
server.listen_port = port; server.listen_port = port;
server.host_cert_table = PL_NewHashTable(0, PL_HashString, PL_CompareStrings, PL_CompareStrings, NULL, NULL); server.host_cert_table = PL_NewHashTable(0, PL_HashString, PL_CompareStrings,
PL_CompareStrings, nullptr, nullptr);
if (!server.host_cert_table) if (!server.host_cert_table)
{ {
LOG_ERROR(("Internal, could not create hash table\n")); LOG_ERROR(("Internal, could not create hash table\n"));
return 1; return 1;
} }
server.host_clientauth_table = PL_NewHashTable(0, PL_HashString, PL_CompareStrings, ClientAuthValueComparator, NULL, NULL); server.host_clientauth_table = PL_NewHashTable(0, PL_HashString, PL_CompareStrings,
ClientAuthValueComparator, nullptr, nullptr);
if (!server.host_clientauth_table) if (!server.host_clientauth_table)
{ {
LOG_ERROR(("Internal, could not create hash table\n")); LOG_ERROR(("Internal, could not create hash table\n"));
return 1; return 1;
} }
server.host_redir_table = PL_NewHashTable(0, PL_HashString, PL_CompareStrings, PL_CompareStrings, NULL, NULL); server.host_redir_table = PL_NewHashTable(0, PL_HashString, PL_CompareStrings,
PL_CompareStrings, nullptr, nullptr);
if (!server.host_redir_table) if (!server.host_redir_table)
{ {
LOG_ERROR(("Internal, could not create hash table\n")); LOG_ERROR(("Internal, could not create hash table\n"));
@ -1345,7 +1348,7 @@ int main(int argc, char** argv)
} }
// these values should make NSS use the defaults // these values should make NSS use the defaults
if (SSL_ConfigServerSessionIDCache(0, 0, 0, NULL) != SECSuccess) { if (SSL_ConfigServerSessionIDCache(0, 0, 0, nullptr) != SECSuccess) {
LOG_ERROR(("SSL_ConfigServerSessionIDCache failed\n")); LOG_ERROR(("SSL_ConfigServerSessionIDCache failed\n"));
PR_ShutdownThreadPool(threads); PR_ShutdownThreadPool(threads);
PR_DestroyCondVar(shutdown_condvar); PR_DestroyCondVar(shutdown_condvar);
@ -1378,9 +1381,9 @@ int main(int argc, char** argv)
for (vector<server_info_t>::iterator it = servers.begin(); for (vector<server_info_t>::iterator it = servers.begin();
it != servers.end(); it++) it != servers.end(); it++)
{ {
PL_HashTableEnumerateEntries(it->host_cert_table, freeHostCertHashItems, NULL); PL_HashTableEnumerateEntries(it->host_cert_table, freeHostCertHashItems, nullptr);
PL_HashTableEnumerateEntries(it->host_clientauth_table, freeClientAuthHashItems, NULL); PL_HashTableEnumerateEntries(it->host_clientauth_table, freeClientAuthHashItems, nullptr);
PL_HashTableEnumerateEntries(it->host_redir_table, freeHostRedirHashItems, NULL); PL_HashTableEnumerateEntries(it->host_redir_table, freeHostRedirHashItems, nullptr);
PL_HashTableDestroy(it->host_cert_table); PL_HashTableDestroy(it->host_cert_table);
PL_HashTableDestroy(it->host_clientauth_table); PL_HashTableDestroy(it->host_clientauth_table);
PL_HashTableDestroy(it->host_redir_table); PL_HashTableDestroy(it->host_redir_table);

View File

@ -77,7 +77,7 @@ int main(int argc, char** argv)
XScreenSaverQueryInfo(GDK_DISPLAY(), GDK_ROOT_WINDOW(), info); XScreenSaverQueryInfo(GDK_DISPLAY(), GDK_ROOT_WINDOW(), info);
const char* state; const char* state;
const char* til_or_since = NULL; const char* til_or_since = nullptr;
switch (info->state) { switch (info->state) {
case ScreenSaverOff: case ScreenSaverOff:
state = "Off"; state = "Off";
@ -127,10 +127,10 @@ int main(int argc, char** argv)
#endif #endif
GdkWindow* window = gdk_get_default_root_window(); GdkWindow* window = gdk_get_default_root_window();
GdkPixbuf* screenshot = NULL; GdkPixbuf* screenshot = nullptr;
// TODO GTK3 // TODO GTK3
#if (MOZ_WIDGET_GTK == 2) #if (MOZ_WIDGET_GTK == 2)
screenshot = gdk_pixbuf_get_from_drawable(NULL, window, NULL, screenshot = gdk_pixbuf_get_from_drawable(nullptr, window, nullptr,
0, 0, 0, 0, 0, 0, 0, 0,
gdk_screen_width(), gdk_screen_width(),
gdk_screen_height()); gdk_screen_height());
@ -140,12 +140,12 @@ int main(int argc, char** argv)
return 1; return 1;
} }
GError* error = NULL; GError* error = nullptr;
if (argc > 1) { if (argc > 1) {
gdk_pixbuf_save(screenshot, argv[1], "png", &error, NULL); gdk_pixbuf_save(screenshot, argv[1], "png", &error, nullptr);
} else { } else {
gdk_pixbuf_save_to_callback(screenshot, save_to_stdout, NULL, gdk_pixbuf_save_to_callback(screenshot, save_to_stdout, nullptr,
"png", &error, NULL); "png", &error, nullptr);
} }
if (error) { if (error) {
fprintf(stderr, "%s: failed to write screenshot as png: %s\n", fprintf(stderr, "%s: failed to write screenshot as png: %s\n",

View File

@ -46,14 +46,14 @@ static int GetEncoderClsid(const WCHAR* format, CLSID* pClsid)
UINT num = 0; // number of image encoders UINT num = 0; // number of image encoders
UINT size = 0; // size of the image encoder array in bytes UINT size = 0; // size of the image encoder array in bytes
ImageCodecInfo* pImageCodecInfo = NULL; ImageCodecInfo* pImageCodecInfo = nullptr;
GetImageEncodersSize(&num, &size); GetImageEncodersSize(&num, &size);
if(size == 0) if(size == 0)
return -1; // Failure return -1; // Failure
pImageCodecInfo = (ImageCodecInfo*)(malloc(size)); pImageCodecInfo = (ImageCodecInfo*)(malloc(size));
if(pImageCodecInfo == NULL) if(pImageCodecInfo == nullptr)
return -1; // Failure return -1; // Failure
GetImageEncoders(num, size, pImageCodecInfo); GetImageEncoders(num, size, pImageCodecInfo);
@ -79,7 +79,7 @@ int wmain(int argc, wchar_t** argv)
{ {
GdiplusStartupInput gdiplusStartupInput; GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR gdiplusToken; ULONG_PTR gdiplusToken;
GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, nullptr);
HWND desktop = GetDesktopWindow(); HWND desktop = GetDesktopWindow();
HDC desktopdc = GetDC(desktop); HDC desktopdc = GetDC(desktop);
@ -92,11 +92,11 @@ int wmain(int argc, wchar_t** argv)
SelectObject(mydc, oldbmp); SelectObject(mydc, oldbmp);
const wchar_t* filename = (argc > 1) ? argv[1] : L"screenshot.png"; const wchar_t* filename = (argc > 1) ? argv[1] : L"screenshot.png";
Bitmap* b = Bitmap::FromHBITMAP(mybmp, NULL); Bitmap* b = Bitmap::FromHBITMAP(mybmp, nullptr);
CLSID encoderClsid; CLSID encoderClsid;
Status stat = GenericError; Status stat = GenericError;
if (b && GetEncoderClsid(L"image/png", &encoderClsid) != -1) { if (b && GetEncoderClsid(L"image/png", &encoderClsid) != -1) {
stat = b->Save(filename, &encoderClsid, NULL); stat = b->Save(filename, &encoderClsid, nullptr);
} }
if (b) if (b)
delete b; delete b;

View File

@ -405,7 +405,7 @@ nsGIOService::OrgFreedesktopFileManager1ShowItems(const nsACString& aPath)
} }
char *uri = g_filename_to_uri(PromiseFlatCString(aPath).get(), nullptr, nullptr); char *uri = g_filename_to_uri(PromiseFlatCString(aPath).get(), nullptr, nullptr);
if (uri == NULL) { if (uri == nullptr) {
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }

View File

@ -21,7 +21,7 @@ class nsIRollupListener {
* was just rolled up. * was just rolled up.
* *
* aPoint is the mouse pointer position where the event that triggered the * aPoint is the mouse pointer position where the event that triggered the
* rollup occurred, which may be NULL. * rollup occurred, which may be nullptr.
* *
* aCount is the number of popups in a chain to close. If this is * aCount is the number of popups in a chain to close. If this is
* UINT32_MAX, then all popups are closed. * UINT32_MAX, then all popups are closed.

View File

@ -138,7 +138,7 @@ bool IsValidWrite(int fd, const void *wbuf, size_t count)
} }
} }
// For writev we pass NULL in wbuf. We should only get here from // For writev we pass a nullptr wbuf. We should only get here from
// dbm, and it uses write, so assert that we have wbuf. // dbm, and it uses write, so assert that we have wbuf.
if (!wbuf) { if (!wbuf) {
return true; return true;

View File

@ -342,7 +342,7 @@ protected:
private: private:
nsStorageStream* mStorageStream; nsStorageStream* mStorageStream;
uint32_t mReadCursor; // Next memory location to read byte, or NULL uint32_t mReadCursor; // Next memory location to read byte, or 0
uint32_t mSegmentEnd; // One byte past end of current buffer segment uint32_t mSegmentEnd; // One byte past end of current buffer segment
uint32_t mSegmentNum; // Segment number containing read cursor uint32_t mSegmentNum; // Segment number containing read cursor
uint32_t mSegmentSize; // All segments, except the last, are of this size uint32_t mSegmentSize; // All segments, except the last, are of this size