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

--HG--
extra : rebase_source : 9335e9b4b0ac02e8066fbb79797bbc0d3fd73874
This commit is contained in:
Birunthan Mohanathas 2013-10-23 16:36:09 -04:00
parent d025dae9ac
commit de354c9745
27 changed files with 92 additions and 87 deletions

View File

@ -87,7 +87,7 @@ IsImmersiveProcessRunning(const wchar_t *processName)
PROCESSENTRY32W entry;
entry.dwSize = sizeof(PROCESSENTRY32W);
HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL);
HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
if (Process32First(snapshot, &entry)) {
while (!exists && Process32Next(snapshot, &entry)) {

View File

@ -630,7 +630,8 @@ private:
static HRESULT
PrepareActivationManager(CComPtr<IApplicationActivationManager> &activateMgr)
{
HRESULT hr = activateMgr.CoCreateInstance(CLSID_ApplicationActivationManager, NULL, CLSCTX_LOCAL_SERVER);
HRESULT hr = activateMgr.CoCreateInstance(CLSID_ApplicationActivationManager,
nullptr, CLSCTX_LOCAL_SERVER);
if (FAILED(hr)) {
Log(L"CoCreateInstance failed, launching on desktop.");
return E_FAIL;
@ -654,7 +655,7 @@ DelayedExecuteThread(LPVOID param)
bool &bRequestMet(*(bool*)param);
AutoSetRequestMet asrm(&bRequestMet);
CoInitialize(NULL);
CoInitialize(nullptr);
CComPtr<IApplicationActivationManager> activateMgr;
if (FAILED(PrepareActivationManager(activateMgr))) {
@ -698,7 +699,8 @@ IFACEMETHODIMP CExecuteCommandVerb::Execute()
}
if (mIsRestartMetroRequest) {
HANDLE thread = CreateThread(NULL, 0, DelayedExecuteThread, &mRequestMet, 0, NULL);
HANDLE thread = CreateThread(nullptr, 0, DelayedExecuteThread,
&mRequestMet, 0, nullptr);
CloseHandle(thread);
return S_OK;
}

View File

@ -40,7 +40,7 @@ typedef struct ASFinderInfo
static void append_file(FILE* output, const char* input_name)
{
FILE* input = fopen(input_name, "rb");
EXIT_IF_FALSE(input != NULL);
EXIT_IF_FALSE(input != nullptr);
while (1) {
char buffer[4096];
@ -87,7 +87,7 @@ int main(int argc, char** argv)
}
FILE* output = fopen(argv[2], "wb");
if (output == NULL) {
if (output == nullptr) {
printf("%s: can't open file `%s'\n", argv[0], argv[2]);
exit(5);
}
@ -177,7 +177,7 @@ int main(int argc, char** argv)
memset(&cat_info, 0, sizeof(cat_info));
EXIT_IF_FALSE(FSGetCatalogInfo(&fsref,
kFSCatInfoGettableInfo,
&cat_info, NULL, NULL, NULL) == 0);
&cat_info, nullptr, nullptr, nullptr) == 0);
ASFinderInfo finder_info;
memcpy(&finder_info.ioFlFndrInfo, &cat_info.finderInfo,

View File

@ -58,7 +58,7 @@ MessageLink::~MessageLink()
ProcessLink::ProcessLink(MessageChannel *aChan)
: MessageLink(aChan),
mExistingListener(NULL)
mExistingListener(nullptr)
{
}

View File

@ -122,7 +122,7 @@ KeyStore::ResetHandlerInfo()
mHandlerInfo.state = STATE_IDLE;
mHandlerInfo.command = 0;
mHandlerInfo.paramCount = 0;
mHandlerInfo.commandPattern = NULL;
mHandlerInfo.commandPattern = nullptr;
for (int i = 0; i < MAX_PARAM; i++) {
mHandlerInfo.param[i].length = 0;
memset(mHandlerInfo.param[i].data, 0, VALUE_SIZE);

View File

@ -984,7 +984,7 @@ mozJSComponentLoader::ObjectForLocation(nsIFile *aComponentFile,
if (aPropagateExceptions)
ContextOptionsRef(cx).setDontReportUncaught(true);
if (script) {
ok = JS_ExecuteScriptVersion(cx, obj, script, NULL, JSVERSION_LATEST);
ok = JS_ExecuteScriptVersion(cx, obj, script, nullptr, JSVERSION_LATEST);
} else {
jsval rval;
ok = JS_CallFunction(cx, obj, function, 0, nullptr, &rval);

View File

@ -1099,7 +1099,7 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = {
{ &kTCPSOCKETPARENT_CID, false, nullptr, TCPSocketParentConstructor },
{ &kTCPSERVERSOCKETCHILD_CID, false, nullptr, TCPServerSocketChildConstructor },
{ &kNS_TIMESERVICE_CID, false, nullptr, nsITimeServiceConstructor },
{ &kNS_MEDIASTREAMCONTROLLERSERVICE_CID, false, NULL, nsIStreamingProtocolControllerServiceConstructor },
{ &kNS_MEDIASTREAMCONTROLLERSERVICE_CID, false, nullptr, nsIStreamingProtocolControllerServiceConstructor },
#ifdef MOZ_WIDGET_GONK
{ &kGONK_GPS_GEOLOCATION_PROVIDER_CID, false, nullptr, nsIGeolocationProviderConstructor },
#endif

View File

@ -13,7 +13,7 @@ using mozilla::dom::Link;
NS_IMPL_ISUPPORTS2(nsAndroidHistory, IHistory, nsIRunnable)
nsAndroidHistory* nsAndroidHistory::sHistory = NULL;
nsAndroidHistory* nsAndroidHistory::sHistory = nullptr;
/*static*/
nsAndroidHistory*

View File

@ -23,11 +23,11 @@ NS_DEFINE_NAMED_CID(NS_ANDROIDHISTORY_CID);
#endif
static const mozilla::Module::CIDEntry kBrowserCIDs[] = {
{ &knsShellService_CID, false, NULL, nsShellServiceConstructor },
{ &knsShellService_CID, false, nullptr, nsShellServiceConstructor },
#ifdef MOZ_ANDROID_HISTORY
{ &kNS_ANDROIDHISTORY_CID, false, NULL, nsAndroidHistoryConstructor },
{ &kNS_ANDROIDHISTORY_CID, false, nullptr, nsAndroidHistoryConstructor },
#endif
{ NULL }
{ nullptr }
};
static const mozilla::Module::ContractIDEntry kBrowserContracts[] = {
@ -35,7 +35,7 @@ static const mozilla::Module::ContractIDEntry kBrowserContracts[] = {
#ifdef MOZ_ANDROID_HISTORY
{ NS_IHISTORY_CONTRACTID, &kNS_ANDROIDHISTORY_CID },
#endif
{ NULL }
{ nullptr }
};
static const mozilla::Module kBrowserModule = {

View File

@ -936,7 +936,7 @@ static const mozilla::Module::CIDEntry kNeckoCIDs[] = {
mozilla::net::WebSocketSSLChannelConstructor },
#endif
#ifdef MOZ_RTSP
{ &kNS_RTSPPROTOCOLHANDLER_CID, false, NULL, mozilla::net::RtspHandlerConstructor },
{ &kNS_RTSPPROTOCOLHANDLER_CID, false, nullptr, mozilla::net::RtspHandlerConstructor },
#endif
#if defined(XP_WIN)
{ &kNS_NETWORK_LINK_SERVICE_CID, false, nullptr, nsNotifyAddrListenerConstructor },

View File

@ -2716,7 +2716,7 @@ SpdySession31::RequestHead()
MOZ_ASSERT(false,
"SpdySession31::RequestHead() "
"should not be called after SPDY is setup");
return NULL;
return nullptr;
}
uint32_t

View File

@ -836,7 +836,7 @@ Connection::internalClose()
if (srv == SQLITE_BUSY) {
// We still have non-finalized statements. Finalize them.
sqlite3_stmt *stmt = NULL;
sqlite3_stmt *stmt = nullptr;
while ((stmt = ::sqlite3_next_stmt(mDBConn, stmt))) {
PR_LOG(gStorageLog, PR_LOG_NOTICE,
("Auto-finalizing SQL statement '%s' (%x)",
@ -866,7 +866,7 @@ Connection::internalClose()
// Ensure that the loop continues properly, whether closing has succeeded
// or not.
if (srv == SQLITE_OK) {
stmt = NULL;
stmt = nullptr;
}
}

View File

@ -137,7 +137,7 @@ static const mozilla::Module::CIDEntry kToolkitCIDs[] = {
#if defined(USE_MOZ_UPDATER)
{ &kNS_UPDATEPROCESSOR_CID, false, nullptr, nsUpdateProcessorConstructor },
#endif
{ &kFINALIZATIONWITNESSSERVICE_CID, false, NULL, FinalizationWitnessServiceConstructor },
{ &kFINALIZATIONWITNESSSERVICE_CID, false, nullptr, FinalizationWitnessServiceConstructor },
{ nullptr }
};

View File

@ -13,7 +13,7 @@
#define NS_CONTENTHANDLER_CID \
{ 0x43ec2c82, 0xb9db, 0x4835, {0x80, 0x3f, 0x64, 0xc9, 0x72, 0x5a, 0x70, 0x28 } }
NS_IMPL_CLASSINFO(nsContentHandlerApp, NULL, 0, NS_CONTENTHANDLER_CID)
NS_IMPL_CLASSINFO(nsContentHandlerApp, nullptr, 0, NS_CONTENTHANDLER_CID)
NS_IMPL_ISUPPORTS1_CI(nsContentHandlerApp, nsIHandlerApp)
nsContentHandlerApp::nsContentHandlerApp(nsString aName, nsCString aType,

View File

@ -13,7 +13,7 @@
// XXX why does nsMIMEInfoImpl have a threadsafe nsISupports? do we need one
// here too?
NS_IMPL_CLASSINFO(nsDBusHandlerApp, NULL, 0, NS_DBUSHANDLERAPP_CID)
NS_IMPL_CLASSINFO(nsDBusHandlerApp, nullptr, 0, NS_DBUSHANDLERAPP_CID)
NS_IMPL_ISUPPORTS2_CI(nsDBusHandlerApp, nsIDBusHandlerApp, nsIHandlerApp)
////////////////////////////////////////////////////////////////////////////////
@ -112,12 +112,12 @@ nsDBusHandlerApp::LaunchWithURI(nsIURI *aURI,
dbus_message_iter_init_append(msg, &iter);
dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &uri);
if (dbus_connection_send(connection, msg, NULL)) {
if (dbus_connection_send(connection, msg, nullptr)) {
dbus_connection_flush(connection);
dbus_message_unref(msg);
} else {
dbus_message_unref(msg);
return NS_ERROR_FAILURE;
return NS_ERROR_FAILURE;
}
return NS_OK;

View File

@ -97,11 +97,11 @@ nsMIMEInfoWin::LaunchWithFile(nsIFile* aFile)
memset(&seinfo, 0, sizeof(seinfo));
seinfo.cbSize = sizeof(SHELLEXECUTEINFOW);
seinfo.fMask = 0;
seinfo.hwnd = NULL;
seinfo.lpVerb = NULL;
seinfo.hwnd = nullptr;
seinfo.lpVerb = nullptr;
seinfo.lpFile = rundll32Path;
seinfo.lpParameters = args.get();
seinfo.lpDirectory = NULL;
seinfo.lpDirectory = nullptr;
seinfo.nShow = SW_SHOWNORMAL;
if (ShellExecuteExW(&seinfo))
return NS_OK;
@ -246,15 +246,16 @@ nsMIMEInfoWin::LoadUriInternal(nsIURI * aURL)
sinfo.cbSize = sizeof(sinfo);
sinfo.fMask = SEE_MASK_FLAG_DDEWAIT |
SEE_MASK_FLAG_NO_UI;
sinfo.hwnd = NULL;
sinfo.hwnd = nullptr;
sinfo.lpVerb = (LPWSTR)&cmdVerb;
sinfo.nShow = SW_SHOWNORMAL;
LPITEMIDLIST pidl = NULL;
LPITEMIDLIST pidl = nullptr;
SFGAOF sfgao;
// Bug 394974
if (SUCCEEDED(SHParseDisplayName(utf16Spec.get(),NULL, &pidl, 0, &sfgao))) {
if (SUCCEEDED(SHParseDisplayName(utf16Spec.get(), nullptr,
&pidl, 0, &sfgao))) {
sinfo.lpIDList = pidl;
sinfo.fMask |= SEE_MASK_INVOKEIDLIST;
} else {
@ -513,7 +514,7 @@ void nsMIMEInfoWin::ProcessPath(nsCOMPtr<nsIMutableArray>& appList,
// Don't include firefox.exe in the list
WCHAR exe[MAX_PATH+1];
uint32_t len = GetModuleFileNameW(NULL, exe, MAX_PATH);
uint32_t len = GetModuleFileNameW(nullptr, exe, MAX_PATH);
if (len < MAX_PATH && len != 0) {
uint32_t index = lower.Find(exe);
if (index != -1)

View File

@ -35,9 +35,10 @@ nsOSHelperAppService::nsOSHelperAppService() :
nsExternalHelperAppService()
, mAppAssoc(nullptr)
{
CoInitialize(NULL);
CoCreateInstance(CLSID_ApplicationAssociationRegistration, NULL, CLSCTX_INPROC,
IID_IApplicationAssociationRegistration, (void**)&mAppAssoc);
CoInitialize(nullptr);
CoCreateInstance(CLSID_ApplicationAssociationRegistration, nullptr,
CLSCTX_INPROC, IID_IApplicationAssociationRegistration,
(void**)&mAppAssoc);
}
nsOSHelperAppService::~nsOSHelperAppService()
@ -141,7 +142,8 @@ nsresult nsOSHelperAppService::OSProtocolHandlerExists(const char * aProtocolSch
&hKey);
if (err == ERROR_SUCCESS)
{
err = ::RegQueryValueExW(hKey, L"URL Protocol", NULL, NULL, NULL, NULL);
err = ::RegQueryValueExW(hKey, L"URL Protocol",
nullptr, nullptr, nullptr, nullptr);
*aHandlerExists = (err == ERROR_SUCCESS);
// close the key
::RegCloseKey(hKey);

View File

@ -1331,7 +1331,7 @@ nsOfflineCacheUpdate::Init(nsIURI *aManifestURI,
}
rv = nsOfflineCacheUpdateService::OfflineAppPinnedForURI(aDocumentURI,
NULL,
nullptr,
&mPinned);
NS_ENSURE_SUCCESS(rv, rv);
@ -1383,7 +1383,7 @@ nsOfflineCacheUpdate::InitForUpdateCheck(nsIURI *aManifestURI,
mApplicationCache = mPreviousApplicationCache;
rv = nsOfflineCacheUpdateService::OfflineAppPinnedForURI(aManifestURI,
NULL,
nullptr,
&mPinned);
NS_ENSURE_SUCCESS(rv, rv);
@ -1442,7 +1442,7 @@ nsOfflineCacheUpdate::InitPartial(nsIURI *aManifestURI,
NS_ENSURE_SUCCESS(rv, rv);
rv = nsOfflineCacheUpdateService::OfflineAppPinnedForURI(aDocumentURI,
NULL,
nullptr,
&mPinned);
NS_ENSURE_SUCCESS(rv, rv);
@ -2191,7 +2191,7 @@ EvictOneOfCacheGroups(nsIApplicationCacheService *cacheService,
bool pinned;
rv = nsOfflineCacheUpdateService::OfflineAppPinnedForURI(uri,
NULL,
nullptr,
&pinned);
NS_ENSURE_SUCCESS(rv, rv);

View File

@ -70,7 +70,7 @@ void ErrorDialog(const char* message)
{
gtk_init(pargc, pargv);
GtkWidget* dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "%s", message);
GtkWidget* dialog = gtk_message_dialog_new(nullptr, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "%s", message);
gtk_window_set_title(GTK_WINDOW(dialog), "Error launching webapp");
gtk_window_set_skip_taskbar_hint(GTK_WINDOW(dialog), false);
gtk_dialog_run(GTK_DIALOG(dialog));
@ -275,7 +275,7 @@ void RemoveApplication(nsINIParser& parser, const char* curExeDir, const char* p
* The only difference between libnotify.so.4 and libnotify.so.1 for these symbols
* is that notify_notification_new takes three arguments in libnotify.so.4 and
* four in libnotify.so.1.
* Passing the fourth argument as NULL is binary compatible.
* Passing the fourth argument as nullptr is binary compatible.
*/
typedef void (*notify_init_t)(const char*);
typedef void* (*notify_notification_new_t)(const char*, const char*, const char*, const char*);
@ -298,9 +298,9 @@ void RemoveApplication(nsINIParser& parser, const char* curExeDir, const char* p
nn_init(appName);
void* n = nn_new(uninstallMsg, NULL, "dialog-information", NULL);
void* n = nn_new(uninstallMsg, nullptr, "dialog-information", nullptr);
nn_show(n, NULL);
nn_show(n, nullptr);
dlclose(handle);
}

View File

@ -89,7 +89,7 @@ namespace {
{
public:
ScopedXREAppData()
: mAppData(NULL) { }
: mAppData(nullptr) { }
nsresult
create(nsIFile* aINIFile)
@ -99,7 +99,7 @@ namespace {
~ScopedXREAppData()
{
if (NULL != mAppData) {
if (nullptr != mAppData) {
XRE_FreeAppData(mAppData);
}
}
@ -135,7 +135,7 @@ namespace {
wchar_t msg[1024];
_vsnwprintf_s(msg, _countof(msg), _countof(msg), fmt, ap);
MessageBoxW(NULL, msg, L"Web Runtime", MB_OK);
MessageBoxW(nullptr, msg, L"Web Runtime", MB_OK);
va_end(ap);
}
@ -199,13 +199,13 @@ namespace {
::ZeroMemory(&pi, sizeof(pi));
if (!CreateProcessW(curExePath, // Module name
NULL, // Command line
NULL, // Process handle not inheritable
NULL, // Thread handle not inheritable
nullptr, // Command line
nullptr, // Process handle not inheritable
nullptr, // Thread handle not inheritable
FALSE, // Set handle inheritance to FALSE
0, // No creation flags
NULL, // Use parent's environment block
NULL, // Use parent's starting directory
nullptr, // Use parent's environment block
nullptr, // Use parent's starting directory
&si,
&pi)) {
return false;
@ -358,8 +358,8 @@ namespace {
// RegGetValue instead
if (ERROR_SUCCESS != RegQueryValueExW(key,
L"Path",
NULL,
NULL,
nullptr,
nullptr,
reinterpret_cast<BYTE*>(wideGreDir),
&length)) {
RegCloseKey(key);
@ -383,8 +383,8 @@ namespace {
-1,
firefoxDir,
MAXPATHLEN,
NULL,
NULL)) {
nullptr,
nullptr)) {
return false;
}
@ -438,8 +438,8 @@ main(int argc, char* argv[])
-1,
buffer,
MAXPATHLEN,
NULL,
NULL)) {
nullptr,
nullptr)) {
Output("Application directory could not be processed.");
return 255;
}

View File

@ -20,15 +20,15 @@ NS_DEFINE_NAMED_CID(NS_APPSHELLSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_WINDOWMEDIATOR_CID);
static const mozilla::Module::CIDEntry kAppShellCIDs[] = {
{ &kNS_APPSHELLSERVICE_CID, false, NULL, nsAppShellServiceConstructor },
{ &kNS_WINDOWMEDIATOR_CID, false, NULL, nsWindowMediatorConstructor },
{ NULL }
{ &kNS_APPSHELLSERVICE_CID, false, nullptr, nsAppShellServiceConstructor },
{ &kNS_WINDOWMEDIATOR_CID, false, nullptr, nsWindowMediatorConstructor },
{ nullptr }
};
static const mozilla::Module::ContractIDEntry kAppShellContracts[] = {
{ NS_APPSHELLSERVICE_CONTRACTID, &kNS_APPSHELLSERVICE_CID },
{ NS_WINDOWMEDIATOR_CONTRACTID, &kNS_WINDOWMEDIATOR_CID },
{ NULL }
{ nullptr }
};
static nsresult
@ -47,8 +47,8 @@ static const mozilla::Module kAppShellModule = {
mozilla::Module::kVersion,
kAppShellCIDs,
kAppShellContracts,
NULL,
NULL,
nullptr,
nullptr,
nsAppShellModuleConstructor,
nsAppShellModuleDestructor
};

View File

@ -18,21 +18,21 @@ NS_DEFINE_NAMED_CID(NS_DIRECTORYVIEWERFACTORY_CID);
NS_DEFINE_NAMED_CID(NS_HTTPINDEX_SERVICE_CID);
static const mozilla::Module::CIDEntry kXPFECIDs[] = {
{ &kNS_DIRECTORYVIEWERFACTORY_CID, false, NULL, nsDirectoryViewerFactoryConstructor },
{ &kNS_HTTPINDEX_SERVICE_CID, false, NULL, nsHTTPIndexConstructor },
{ NULL }
{ &kNS_DIRECTORYVIEWERFACTORY_CID, false, nullptr, nsDirectoryViewerFactoryConstructor },
{ &kNS_HTTPINDEX_SERVICE_CID, false, nullptr, nsHTTPIndexConstructor },
{ nullptr }
};
static const mozilla::Module::ContractIDEntry kXPFEContracts[] = {
{ "@mozilla.org/xpfe/http-index-format-factory-constructor", &kNS_DIRECTORYVIEWERFACTORY_CID },
{ NS_HTTPINDEX_SERVICE_CONTRACTID, &kNS_HTTPINDEX_SERVICE_CID },
{ NS_HTTPINDEX_DATASOURCE_CONTRACTID, &kNS_HTTPINDEX_SERVICE_CID },
{ NULL }
{ nullptr }
};
static const mozilla::Module::CategoryEntry kXPFECategories[] = {
{ "Gecko-Content-Viewers", "application/http-index-format", "@mozilla.org/xpfe/http-index-format-factory-constructor" },
{ NULL }
{ nullptr }
};
static const mozilla::Module kXPFEModule = {

View File

@ -355,7 +355,7 @@ NS_IMETHODIMP nsWindowDataSource::GetTarget(nsIRDFResource *aSource, nsIRDFResou
{
NS_ENSURE_ARG_POINTER(_retval);
// add extra NULL checking for top-crash bug # 146466
// add extra nullptr checking for top-crash bug # 146466
if (!gRDFService) return NS_RDF_NO_VALUE;
if (!mInner) return NS_RDF_NO_VALUE;
if (!mContainer) return NS_RDF_NO_VALUE;
@ -548,18 +548,18 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsWindowDataSource, Init)
NS_DEFINE_NAMED_CID(NS_WINDOWDATASOURCE_CID);
static const mozilla::Module::CIDEntry kWindowDSCIDs[] = {
{ &kNS_WINDOWDATASOURCE_CID, false, NULL, nsWindowDataSourceConstructor },
{ NULL }
{ &kNS_WINDOWDATASOURCE_CID, false, nullptr, nsWindowDataSourceConstructor },
{ nullptr }
};
static const mozilla::Module::ContractIDEntry kWindowDSContracts[] = {
{ NS_RDF_DATASOURCE_CONTRACTID_PREFIX "window-mediator", &kNS_WINDOWDATASOURCE_CID },
{ NULL }
{ nullptr }
};
static const mozilla::Module::CategoryEntry kWindowDSCategories[] = {
{ "app-startup", "Window Data Source", "service," NS_RDF_DATASOURCE_CONTRACTID_PREFIX "window-mediator" },
{ NULL }
{ nullptr }
};
static const mozilla::Module kWindowDSModule = {

View File

@ -59,7 +59,7 @@ static void Output(bool isError, const char *fmt, ... )
else
flags |= MB_ICONINFORMATION;
MessageBoxW(NULL, msg, L"XULRunner", flags);
MessageBoxW(nullptr, msg, L"XULRunner", flags);
#else
vfprintf(stderr, fmt, ap);
#endif

View File

@ -35,13 +35,13 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(SimpleTest)
NS_DEFINE_NAMED_CID(SIMPLETEST_CID);
static const mozilla::Module::CIDEntry kSimpleCIDs[] = {
{ &kSIMPLETEST_CID, false, NULL, SimpleTestConstructor },
{ NULL }
{ &kSIMPLETEST_CID, false, nullptr, SimpleTestConstructor },
{ nullptr }
};
static const mozilla::Module::ContractIDEntry kSimpleContracts[] = {
{ "@test.mozilla.org/simple-test;1?impl=c++", &kSIMPLETEST_CID },
{ NULL }
{ nullptr }
};
static const mozilla::Module kSimpleModule = {

View File

@ -71,7 +71,7 @@ static void Output(bool isError, const char *fmt, ... )
wide_msg,
sizeof(wide_msg) / sizeof(wchar_t));
MessageBoxW(NULL, wide_msg, L"XULRunner", flags);
MessageBoxW(nullptr, wide_msg, L"XULRunner", flags);
#else
vfprintf(stderr, fmt, ap);
#endif
@ -205,11 +205,11 @@ main(int argc, char **argv)
#ifdef XP_WIN
wchar_t wide_path[MAX_PATH];
if (!::GetModuleFileNameW(NULL, wide_path, MAX_PATH))
if (!::GetModuleFileNameW(nullptr, wide_path, MAX_PATH))
return 1;
WideCharToMultiByte(CP_UTF8, 0, wide_path,-1,
iniPath, MAX_PATH, NULL, NULL);
iniPath, MAX_PATH, nullptr, nullptr);
#elif defined(XP_OS2)
PPIB ppib;
@ -254,7 +254,7 @@ main(int argc, char **argv)
realpath(tmpPath, iniPath);
break;
}
token = strtok(NULL, ":");
token = strtok(nullptr, ":");
}
free (pathdup);
if (!found)
@ -360,13 +360,13 @@ main(int argc, char **argv)
if (absfwurl) {
CFURLRef xulurl =
CFURLCreateCopyAppendingPathComponent(NULL, absfwurl,
CFURLCreateCopyAppendingPathComponent(nullptr, absfwurl,
CFSTR("XUL.framework"),
true);
if (xulurl) {
CFURLRef xpcomurl =
CFURLCreateCopyAppendingPathComponent(NULL, xulurl,
CFURLCreateCopyAppendingPathComponent(nullptr, xulurl,
CFSTR("libxpcom.dylib"),
false);

View File

@ -85,9 +85,9 @@ namespace {
struct ScopedResourceUpdateTraits
{
typedef HANDLE type;
static type empty() { return NULL; }
static type empty() { return nullptr; }
static void release(type handle) {
if(NULL != handle) {
if(nullptr != handle) {
EndUpdateResourceW(handle, TRUE); // Discard changes
}
}
@ -131,7 +131,7 @@ wmain(int argc, wchar_t** argv)
// Open the target library for updating
ScopedResourceUpdate updateRes(BeginUpdateResourceW(argv[1], FALSE));
if (NULL == updateRes) {
if (nullptr == updateRes) {
fprintf(stderr, "Unable to open library for modification.\n");
return 1;
}