From a7c24ca48995cf2bf436156302f96b91bf135409 Mon Sep 17 00:00:00 2001 From: Goraf <22941576+Goraf@users.noreply.github.com> Date: Mon, 13 Nov 2017 15:03:31 +0100 Subject: Code modernize ... * replace 0/NULL with nullptr [using clang-tidy] --- plugins/YAMN/src/yamn.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'plugins/YAMN/src/yamn.cpp') diff --git a/plugins/YAMN/src/yamn.cpp b/plugins/YAMN/src/yamn.cpp index ee15e5c343..9343f0f53f 100644 --- a/plugins/YAMN/src/yamn.cpp +++ b/plugins/YAMN/src/yamn.cpp @@ -100,8 +100,8 @@ void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD) DWORD Status, tid; // we use event to signal, that running thread has all needed stack parameters copied - HANDLE ThreadRunningEV = CreateEvent(NULL, FALSE, FALSE, NULL); - if (ThreadRunningEV == NULL) + HANDLE ThreadRunningEV = CreateEvent(nullptr, FALSE, FALSE, nullptr); + if (ThreadRunningEV == nullptr) return; // if we want to close miranda, we get event and do not run checking anymore if (WAIT_OBJECT_0==WaitForSingleObject(ExitEV, 0)) @@ -110,7 +110,7 @@ void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD) Status=CallService(MS_CLIST_GETSTATUSMODE, 0, 0); mir_cslock lck(PluginRegCS); - for (PYAMN_PROTOPLUGINQUEUE ActualPlugin = FirstProtoPlugin; ActualPlugin != NULL; ActualPlugin = ActualPlugin->Next) { + for (PYAMN_PROTOPLUGINQUEUE ActualPlugin = FirstProtoPlugin; ActualPlugin != nullptr; ActualPlugin = ActualPlugin->Next) { #ifdef DEBUG_SYNCHRO DebugLog(SynchroFile, "TimerProc:AccountBrowserSO-read wait\n"); #endif @@ -124,9 +124,9 @@ void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD) #ifdef DEBUG_SYNCHRO DebugLog(SynchroFile, "TimerProc:AccountBrowserSO-read enter\n"); #endif - for (ActualAccount=ActualPlugin->Plugin->FirstAccount;ActualAccount != NULL;ActualAccount=ActualAccount->Next) + for (ActualAccount=ActualPlugin->Plugin->FirstAccount;ActualAccount != nullptr;ActualAccount=ActualAccount->Next) { - if (ActualAccount->Plugin==NULL || ActualAccount->Plugin->Fcn==NULL) //account not inited + if (ActualAccount->Plugin==nullptr || ActualAccount->Plugin->Fcn==nullptr) //account not inited continue; #ifdef DEBUG_SYNCHRO DebugLog(SynchroFile, "TimerProc:ActualAccountSO-read wait\n"); @@ -192,7 +192,7 @@ void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD) ((ActualAccount->StatusFlags & YAMN_ACC_ST9) && (Status==ID_STATUS_OUTTOLUNCH)))) { - if ((!ActualAccount->Interval && !ActualAccount->TimeLeft) || ActualAccount->Plugin->Fcn->TimeoutFcnPtr==NULL) + if ((!ActualAccount->Interval && !ActualAccount->TimeLeft) || ActualAccount->Plugin->Fcn->TimeoutFcnPtr==nullptr) { goto ChangeIsCountingStatusLabel; } @@ -206,11 +206,11 @@ void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD) WindowList_BroadcastAsync(YAMNVar.MessageWnds, WM_YAMN_CHANGETIME, (WPARAM)ActualAccount, (LPARAM)ActualAccount->TimeLeft); if (!ActualAccount->TimeLeft) { - struct CheckParam ParamToPlugin={YAMN_CHECKVERSION, ThreadRunningEV, ActualAccount, YAMN_NORMALCHECK, (void *)0, NULL}; + struct CheckParam ParamToPlugin={YAMN_CHECKVERSION, ThreadRunningEV, ActualAccount, YAMN_NORMALCHECK, (void *)nullptr, nullptr}; ActualAccount->TimeLeft=ActualAccount->Interval; - HANDLE NewThread = CreateThread(NULL, 0, (YAMN_STANDARDFCN)ActualAccount->Plugin->Fcn->TimeoutFcnPtr, &ParamToPlugin, 0, &tid); - if (NewThread == NULL) + HANDLE NewThread = CreateThread(nullptr, 0, (YAMN_STANDARDFCN)ActualAccount->Plugin->Fcn->TimeoutFcnPtr, &ParamToPlugin, 0, &tid); + if (NewThread == nullptr) { #ifdef DEBUG_SYNCHRO DebugLog(SynchroFile, "TimerProc:ActualAccountSO-read done\n"); @@ -256,8 +256,8 @@ INT_PTR ForceCheckSvc(WPARAM, LPARAM) DWORD tid; //we use event to signal, that running thread has all needed stack parameters copied - HANDLE ThreadRunningEV = CreateEvent(NULL, FALSE, FALSE, NULL); - if (ThreadRunningEV == NULL) + HANDLE ThreadRunningEV = CreateEvent(nullptr, FALSE, FALSE, nullptr); + if (ThreadRunningEV == nullptr) return 0; //if we want to close miranda, we get event and do not run pop3 checking anymore if (WAIT_OBJECT_0 == WaitForSingleObject(ExitEV, 0)) @@ -265,7 +265,7 @@ INT_PTR ForceCheckSvc(WPARAM, LPARAM) { mir_cslock lck(PluginRegCS); - for (PYAMN_PROTOPLUGINQUEUE ActualPlugin = FirstProtoPlugin; ActualPlugin != NULL; ActualPlugin = ActualPlugin->Next) { + for (PYAMN_PROTOPLUGINQUEUE ActualPlugin = FirstProtoPlugin; ActualPlugin != nullptr; ActualPlugin = ActualPlugin->Next) { #ifdef DEBUG_SYNCHRO DebugLog(SynchroFile, "ForceCheck:AccountBrowserSO-read wait\n"); #endif @@ -273,8 +273,8 @@ INT_PTR ForceCheckSvc(WPARAM, LPARAM) #ifdef DEBUG_SYNCHRO DebugLog(SynchroFile, "ForceCheck:AccountBrowserSO-read enter\n"); #endif - for (ActualAccount = ActualPlugin->Plugin->FirstAccount; ActualAccount != NULL; ActualAccount = ActualAccount->Next) { - if (ActualAccount->Plugin->Fcn == NULL) //account not inited + for (ActualAccount = ActualPlugin->Plugin->FirstAccount; ActualAccount != nullptr; ActualAccount = ActualAccount->Next) { + if (ActualAccount->Plugin->Fcn == nullptr) //account not inited continue; #ifdef DEBUG_SYNCHRO DebugLog(SynchroFile, "ForceCheck:ActualAccountSO-read wait\n"); @@ -290,13 +290,13 @@ INT_PTR ForceCheckSvc(WPARAM, LPARAM) #endif if ((ActualAccount->Flags & YAMN_ACC_ENA) && (ActualAccount->StatusFlags & YAMN_ACC_FORCE)) //account cannot be forced to check { - if (ActualAccount->Plugin->Fcn->ForceCheckFcnPtr == NULL) { + if (ActualAccount->Plugin->Fcn->ForceCheckFcnPtr == nullptr) { ReadDoneFcn(ActualAccount->AccountAccessSO); continue; } - struct CheckParam ParamToPlugin = { YAMN_CHECKVERSION, ThreadRunningEV, ActualAccount, YAMN_FORCECHECK, (void *)0, NULL }; + struct CheckParam ParamToPlugin = { YAMN_CHECKVERSION, ThreadRunningEV, ActualAccount, YAMN_FORCECHECK, (void *)nullptr, nullptr }; - if (NULL == CreateThread(NULL, 0, (YAMN_STANDARDFCN)ActualAccount->Plugin->Fcn->ForceCheckFcnPtr, &ParamToPlugin, 0, &tid)) { + if (nullptr == CreateThread(nullptr, 0, (YAMN_STANDARDFCN)ActualAccount->Plugin->Fcn->ForceCheckFcnPtr, &ParamToPlugin, 0, &tid)) { ReadDoneFcn(ActualAccount->AccountAccessSO); continue; } -- cgit v1.2.3