Skip to content

Commit

Permalink
Bug 784739 - Switch from NULL to nullptr in miscellaneous directories…
Browse files Browse the repository at this point in the history
…; r=ehsan
  • Loading branch information
poiru committed Oct 23, 2013
1 parent 3dce9a3 commit d967d95
Show file tree
Hide file tree
Showing 27 changed files with 92 additions and 87 deletions.
2 changes: 1 addition & 1 deletion browser/metro/shell/commandexecutehandler/CEHHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,8 @@ class AutoSetRequestMet
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;
Expand All @@ -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))) {
Expand Down Expand Up @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions config/asencode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion ipc/glue/MessageLink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ MessageLink::~MessageLink()

ProcessLink::ProcessLink(MessageChannel *aChan)
: MessageLink(aChan),
mExistingListener(NULL)
mExistingListener(nullptr)
{
}

Expand Down
2 changes: 1 addition & 1 deletion ipc/keystore/KeyStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion js/xpconnect/loader/mozJSComponentLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion layout/build/nsLayoutModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mobile/android/components/build/nsAndroidHistory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ using mozilla::dom::Link;

NS_IMPL_ISUPPORTS2(nsAndroidHistory, IHistory, nsIRunnable)

nsAndroidHistory* nsAndroidHistory::sHistory = NULL;
nsAndroidHistory* nsAndroidHistory::sHistory = nullptr;

/*static*/
nsAndroidHistory*
Expand Down
8 changes: 4 additions & 4 deletions mobile/android/components/build/nsBrowserModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ 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[] = {
{ nsShellService_ContractID, &knsShellService_CID },
#ifdef MOZ_ANDROID_HISTORY
{ NS_IHISTORY_CONTRACTID, &kNS_ANDROIDHISTORY_CID },
#endif
{ NULL }
{ nullptr }
};

static const mozilla::Module kBrowserModule = {
Expand Down
2 changes: 1 addition & 1 deletion netwerk/build/nsNetModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
2 changes: 1 addition & 1 deletion netwerk/protocol/http/SpdySession31.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions storage/src/mozStorageConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)",
Expand Down Expand Up @@ -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;
}
}

Expand Down
2 changes: 1 addition & 1 deletion toolkit/components/build/nsToolkitCompsModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
};

Expand Down
2 changes: 1 addition & 1 deletion uriloader/exthandler/nsContentHandlerApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions uriloader/exthandler/nsDBusHandlerApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)

////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -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;

Expand Down
15 changes: 8 additions & 7 deletions uriloader/exthandler/win/nsMIMEInfoWin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
Expand Down
10 changes: 6 additions & 4 deletions uriloader/exthandler/win/nsOSHelperAppService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions uriloader/prefetch/nsOfflineCacheUpdate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1331,7 +1331,7 @@ nsOfflineCacheUpdate::Init(nsIURI *aManifestURI,
}

rv = nsOfflineCacheUpdateService::OfflineAppPinnedForURI(aDocumentURI,
NULL,
nullptr,
&mPinned);
NS_ENSURE_SUCCESS(rv, rv);

Expand Down Expand Up @@ -1383,7 +1383,7 @@ nsOfflineCacheUpdate::InitForUpdateCheck(nsIURI *aManifestURI,
mApplicationCache = mPreviousApplicationCache;

rv = nsOfflineCacheUpdateService::OfflineAppPinnedForURI(aManifestURI,
NULL,
nullptr,
&mPinned);
NS_ENSURE_SUCCESS(rv, rv);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -2191,7 +2191,7 @@ EvictOneOfCacheGroups(nsIApplicationCacheService *cacheService,

bool pinned;
rv = nsOfflineCacheUpdateService::OfflineAppPinnedForURI(uri,
NULL,
nullptr,
&pinned);
NS_ENSURE_SUCCESS(rv, rv);

Expand Down
8 changes: 4 additions & 4 deletions webapprt/gtk2/webapprt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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*);
Expand All @@ -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);
}
Expand Down
Loading

0 comments on commit d967d95

Please sign in to comment.