diff options
author | Goraf <22941576+Goraf@users.noreply.github.com> | 2017-11-13 15:03:31 +0100 |
---|---|---|
committer | Goraf <22941576+Goraf@users.noreply.github.com> | 2017-11-13 15:07:33 +0100 |
commit | a7c24ca48995cf2bf436156302f96b91bf135409 (patch) | |
tree | 953835509ff1b778833e78fd7b74b05e05e77c84 /plugins/YAMN/src/proto/pop3 | |
parent | 591ec17b1c99db7f120c22ca9fb20ae05fe78325 (diff) |
Code modernize ...
* replace 0/NULL with nullptr [using clang-tidy]
Diffstat (limited to 'plugins/YAMN/src/proto/pop3')
-rw-r--r-- | plugins/YAMN/src/proto/pop3/pop3.cpp | 16 | ||||
-rw-r--r-- | plugins/YAMN/src/proto/pop3/pop3comm.cpp | 250 | ||||
-rw-r--r-- | plugins/YAMN/src/proto/pop3/pop3opt.cpp | 130 |
3 files changed, 198 insertions, 198 deletions
diff --git a/plugins/YAMN/src/proto/pop3/pop3.cpp b/plugins/YAMN/src/proto/pop3/pop3.cpp index 5204ba1259..d47fac4836 100644 --- a/plugins/YAMN/src/proto/pop3/pop3.cpp +++ b/plugins/YAMN/src/proto/pop3/pop3.cpp @@ -34,11 +34,11 @@ //sets AckFlag char *CPop3Client::Connect(const char* servername,const int port,BOOL UseSSL, BOOL NoTLS) { - char *temp = 0; + char *temp = nullptr; if (Stopped) //check if we can work with this POP3 client session throw POP3Error=(DWORD)EPOP3_STOPPED; - if (NetClient != NULL) + if (NetClient != nullptr) delete NetClient; SSL=UseSSL; NetClient=new CNLClient; @@ -56,7 +56,7 @@ char *CPop3Client::Connect(const char* servername,const int port,BOOL UseSSL, BO catch (...) { NetClient->Disconnect(); - return NULL; + return nullptr; } } @@ -73,7 +73,7 @@ char *CPop3Client::Connect(const char* servername,const int port,BOOL UseSSL, BO NetClient->SSLify(); } catch (...) { NetClient->Disconnect(); - return NULL; + return nullptr; } // temp = RecvRest(NetClient->Recv(),POP3_SEARCHACK); } @@ -105,7 +105,7 @@ char* CPop3Client::RecvRest(char* prev,int mode,int size) { //if not found if (NetClient->Stopped) //check if we can work with this POP3 client session { - if (PrevString != NULL) + if (PrevString != nullptr) free(PrevString); throw POP3Error=(DWORD)EPOP3_STOPPED; } @@ -113,9 +113,9 @@ char* CPop3Client::RecvRest(char* prev,int mode,int size) { SizeRead+=size; SizeLeft=size; - LastString=NetClient->Recv(NULL,SizeLeft); + LastString=NetClient->Recv(nullptr,SizeLeft); PrevString=(char *)realloc(PrevString,sizeof(char)*(SizeRead+size)); - if (PrevString==NULL) + if (PrevString==nullptr) throw POP3Error=(DWORD)EPOP3_RESTALLOC; memcpy(PrevString+SizeRead,LastString,size); free(LastString); @@ -239,7 +239,7 @@ char* CPop3Client::APOP(char* name, char* pw, char* timestamp) char *Result; unsigned char digest[16]; - if (timestamp==NULL) + if (timestamp==nullptr) throw POP3Error=(DWORD)EPOP3_APOP; mir_md5_state_s ctx; mir_md5_init(&ctx); diff --git a/plugins/YAMN/src/proto/pop3/pop3comm.cpp b/plugins/YAMN/src/proto/pop3/pop3comm.cpp index 8984a4dfbb..edd7598c26 100644 --- a/plugins/YAMN/src/proto/pop3/pop3comm.cpp +++ b/plugins/YAMN/src/proto/pop3/pop3comm.cpp @@ -16,8 +16,8 @@ //--------------------------------------------------------------------------------------------------
-HANDLE hNetLib = NULL;
-PSCOUNTER CPOP3Account::AccountWriterSO = NULL;
+HANDLE hNetLib = nullptr;
+PSCOUNTER CPOP3Account::AccountWriterSO = nullptr;
//Creates new CPOP3Account structure
HACCOUNT WINAPI CreatePOP3Account(HYAMNPROTOPLUGIN Plugin, DWORD CAccountVersion);
@@ -87,8 +87,8 @@ void ExtractList(char *stream, int len, HYAMNMAIL queue); void ExtractMail(char *stream, int len, HYAMNMAIL queue);
-YAMNExportedFcns *pYAMNFcn = NULL;
-MailExportedFcns *pYAMNMailFcn = NULL;
+YAMNExportedFcns *pYAMNFcn = nullptr;
+MailExportedFcns *pYAMNMailFcn = nullptr;
YAMN_PROTOIMPORTFCN POP3ProtocolFunctions =
{
@@ -102,23 +102,23 @@ YAMN_PROTOIMPORTFCN POP3ProtocolFunctions = SynchroPOP3,
DeleteMailsPOP3,
GetErrorString,
- NULL,
+ nullptr,
DeleteErrorString,
WritePOP3Accounts,
- NULL,
+ nullptr,
UnLoadPOP3,
};
YAMN_MAILIMPORTFCN POP3MailFunctions =
{
CreatePOP3Mail,
- NULL,
- NULL,
- NULL,
+ nullptr,
+ nullptr,
+ nullptr,
};
-PYAMN_VARIABLES pYAMNVar = NULL;
-HYAMNPROTOPLUGIN POP3Plugin = NULL;
+PYAMN_VARIABLES pYAMNVar = nullptr;
+HYAMNPROTOPLUGIN POP3Plugin = nullptr;
YAMN_PROTOREGISTRATION POP3ProtocolRegistration =
{
@@ -130,7 +130,7 @@ YAMN_PROTOREGISTRATION POP3ProtocolRegistration = __AUTHORWEB,
};
-static wchar_t *FileName = NULL;
+static wchar_t *FileName = nullptr;
HANDLE RegisterNLClient(const char *name);
@@ -142,7 +142,7 @@ CPOP3Account::CPOP3Account() //NOTE! This constructor constructs CAccount structure. If your plugin is not internal,
//you will need these constructors. All you need is in Account.cpp. Just copy to your source code
//constructor and destructor of CAccount.
- UseInternetFree = CreateEvent(NULL, FALSE, TRUE, NULL);
+ UseInternetFree = CreateEvent(nullptr, FALSE, TRUE, nullptr);
InternetQueries = new SCOUNTER;
AbilityFlags = YAMN_ACC_BROWSE | YAMN_ACC_POPUP;
@@ -152,7 +152,7 @@ CPOP3Account::CPOP3Account() CPOP3Account::~CPOP3Account()
{
CloseHandle(UseInternetFree);
- if (InternetQueries != NULL)
+ if (InternetQueries != nullptr)
delete InternetQueries;
}
@@ -176,7 +176,7 @@ void WINAPI DeletePOP3Account(HACCOUNT Which) void WINAPI StopPOP3Account(HACCOUNT Which)
{
((HPOP3ACCOUNT)Which)->Client.Stopped = TRUE;
- if (((HPOP3ACCOUNT)Which)->Client.NetClient != NULL) //we should inform also network client. Usefull only when network client implements this feature
+ if (((HPOP3ACCOUNT)Which)->Client.NetClient != nullptr) //we should inform also network client. Usefull only when network client implements this feature
((HPOP3ACCOUNT)Which)->Client.NetClient->Stopped = TRUE;
}
@@ -185,19 +185,19 @@ int RegisterPOP3Plugin(WPARAM, LPARAM) {
//Get YAMN variables we can use
- if (NULL == (pYAMNVar = (PYAMN_VARIABLES)CallService(MS_YAMN_GETVARIABLES, (WPARAM)YAMN_VARIABLESVERSION, 0)))
+ if (nullptr == (pYAMNVar = (PYAMN_VARIABLES)CallService(MS_YAMN_GETVARIABLES, (WPARAM)YAMN_VARIABLESVERSION, 0)))
return 0;
//We have to get pointers to YAMN exported functions: allocate structure and fill it
- if (NULL == (pYAMNFcn = new struct YAMNExportedFcns))
+ if (nullptr == (pYAMNFcn = new struct YAMNExportedFcns))
{
- UnLoadPOP3(0); return 0;
+ UnLoadPOP3(nullptr); return 0;
}
//Register new pop3 user in netlib
- if (NULL == (hNetLib = RegisterNLClient("YAMN-POP3")))
+ if (nullptr == (hNetLib = RegisterNLClient("YAMN-POP3")))
{
- UnLoadPOP3(0); return 0;
+ UnLoadPOP3(nullptr); return 0;
}
pYAMNFcn->SetProtocolPluginFcnImportFcn = (YAMN_SETPROTOCOLPLUGINFCNIMPORTFCN)CallService(MS_YAMN_GETFCNPTR, (WPARAM)YAMN_SETPROTOCOLPLUGINFCNIMPORTID, 0);
@@ -211,9 +211,9 @@ int RegisterPOP3Plugin(WPARAM, LPARAM) pYAMNFcn->SetStatusFcn = (YAMN_SETSTATUSFCN)CallService(MS_YAMN_GETFCNPTR, (WPARAM)YAMN_SETSTATUSID, 0);
pYAMNFcn->GetStatusFcn = (YAMN_GETSTATUSFCN)CallService(MS_YAMN_GETFCNPTR, (WPARAM)YAMN_GETSTATUSID, 0);
- if (NULL == (pYAMNMailFcn = new struct MailExportedFcns))
+ if (nullptr == (pYAMNMailFcn = new struct MailExportedFcns))
{
- UnLoadPOP3(0); return 0;
+ UnLoadPOP3(nullptr); return 0;
}
pYAMNMailFcn->SynchroMessagesFcn = (YAMN_SYNCHROMIMEMSGSFCN)CallService(MS_YAMN_GETFCNPTR, (WPARAM)YAMN_SYNCHROMIMEMSGSID, 0);
@@ -225,10 +225,10 @@ int RegisterPOP3Plugin(WPARAM, LPARAM) pYAMNMailFcn->CreateNewDeleteQueueFcn = (YAMN_CREATENEWDELETEQUEUEFCN)CallService(MS_YAMN_GETFCNPTR, (WPARAM)YAMN_CREATENEWDELETEQUEUEID, 0);
//set static variable
- if (CPOP3Account::AccountWriterSO == NULL) {
- if (NULL == (CPOP3Account::AccountWriterSO = new SCOUNTER))
+ if (CPOP3Account::AccountWriterSO == nullptr) {
+ if (nullptr == (CPOP3Account::AccountWriterSO = new SCOUNTER))
{
- UnLoadPOP3(0); return 0;
+ UnLoadPOP3(nullptr); return 0;
}
}
@@ -236,7 +236,7 @@ int RegisterPOP3Plugin(WPARAM, LPARAM) //it is quite impossible this function returns zero (failure) as YAMN and internal plugin structre versions are the same
POP3ProtocolRegistration.Name = Translate("POP3 protocol (internal)");
POP3ProtocolRegistration.Description = Translate(__DESCRIPTION);
- if (NULL == (POP3Plugin = (HYAMNPROTOPLUGIN)CallService(MS_YAMN_REGISTERPROTOPLUGIN, (WPARAM)&POP3ProtocolRegistration, (LPARAM)YAMN_PROTOREGISTRATIONVERSION)))
+ if (nullptr == (POP3Plugin = (HYAMNPROTOPLUGIN)CallService(MS_YAMN_REGISTERPROTOPLUGIN, (WPARAM)&POP3ProtocolRegistration, (LPARAM)YAMN_PROTOREGISTRATIONVERSION)))
return 0;
//Next we set our imported functions for YAMN
@@ -251,28 +251,28 @@ int RegisterPOP3Plugin(WPARAM, LPARAM) switch (CallService(MS_YAMN_READACCOUNTS, (WPARAM)POP3Plugin, (LPARAM)FileName)) {
case EACC_FILEVERSION:
- MessageBox(NULL, TranslateT("Found new version of account book, not compatible with this version of YAMN."), TranslateT("YAMN (internal POP3) read error"), MB_OK);
+ MessageBox(nullptr, TranslateT("Found new version of account book, not compatible with this version of YAMN."), TranslateT("YAMN (internal POP3) read error"), MB_OK);
CallService(MS_YAMN_DELETEFILENAME, (WPARAM)FileName, 0);
- FileName = NULL;
+ FileName = nullptr;
return 0;
case EACC_FILECOMPATIBILITY:
- MessageBox(NULL, TranslateT("Error reading account file. Account file corrupted."), TranslateT("YAMN (internal POP3) read error"), MB_OK);
+ MessageBox(nullptr, TranslateT("Error reading account file. Account file corrupted."), TranslateT("YAMN (internal POP3) read error"), MB_OK);
CallService(MS_YAMN_DELETEFILENAME, (WPARAM)FileName, 0);
- FileName = NULL;
+ FileName = nullptr;
return 0;
case EACC_ALLOC:
- MessageBox(NULL, TranslateT("Memory allocation error while data reading"), TranslateT("YAMN (internal POP3) read error"), MB_OK);
+ MessageBox(nullptr, TranslateT("Memory allocation error while data reading"), TranslateT("YAMN (internal POP3) read error"), MB_OK);
CallService(MS_YAMN_DELETEFILENAME, (WPARAM)FileName, 0);
- FileName = NULL;
+ FileName = nullptr;
return 0;
case EACC_SYSTEM:
if (ERROR_FILE_NOT_FOUND != GetLastError())
{
wchar_t temp[1024] = { 0 };
mir_snwprintf(temp, L"%s\n%s", TranslateT("Reading file error. File already in use?"), FileName);
- MessageBox(NULL, temp, TranslateT("YAMN (internal POP3) read error"), MB_OK);
+ MessageBox(nullptr, temp, TranslateT("YAMN (internal POP3) read error"), MB_OK);
CallService(MS_YAMN_DELETEFILENAME, (WPARAM)FileName, 0);
- FileName = NULL;
+ FileName = nullptr;
return 0;
}
break;
@@ -282,7 +282,7 @@ int RegisterPOP3Plugin(WPARAM, LPARAM) HACCOUNT Finder;
DBVARIANT dbv;
- for (Finder = POP3Plugin->FirstAccount; Finder != NULL; Finder = Finder->Next) {
+ for (Finder = POP3Plugin->FirstAccount; Finder != nullptr; Finder = Finder->Next) {
Finder->hContact = NULL;
for (MCONTACT hContact = db_find_first(YAMN_DBMODULE); hContact; hContact = db_find_next(hContact, YAMN_DBMODULE)) {
if (!db_get_s(hContact, YAMN_DBMODULE, "Id", &dbv)) {
@@ -318,19 +318,19 @@ DWORD WINAPI UnLoadPOP3(void *) {
//pYAMNVar is only a pointr, no need delete or free
if (hNetLib) {
- Netlib_CloseHandle(hNetLib); hNetLib = NULL;
+ Netlib_CloseHandle(hNetLib); hNetLib = nullptr;
}
if (CPOP3Account::AccountWriterSO) {
- delete CPOP3Account::AccountWriterSO; CPOP3Account::AccountWriterSO = NULL;
+ delete CPOP3Account::AccountWriterSO; CPOP3Account::AccountWriterSO = nullptr;
}
if (pYAMNMailFcn) {
- delete pYAMNMailFcn; pYAMNMailFcn = NULL;
+ delete pYAMNMailFcn; pYAMNMailFcn = nullptr;
}
if (pYAMNFcn) {
- delete pYAMNFcn; pYAMNFcn = NULL;
+ delete pYAMNFcn; pYAMNFcn = nullptr;
}
if (FileName) {
- CallService(MS_YAMN_DELETEFILENAME, (WPARAM)FileName, 0); FileName = NULL;
+ CallService(MS_YAMN_DELETEFILENAME, (WPARAM)FileName, 0); FileName = nullptr;
}
#ifdef DEBUG_SYNCHRO
@@ -345,7 +345,7 @@ DWORD WINAPI WritePOP3Accounts() if (ReturnValue == EACC_SYSTEM) {
wchar_t temp[1024] = { 0 };
mir_snwprintf(temp, L"%s\n%s", TranslateT("Error while copying data to disk occurred. Is file in use?"), FileName);
- MessageBox(NULL, temp, TranslateT("POP3 plugin - write file error"), MB_OK);
+ MessageBox(nullptr, temp, TranslateT("POP3 plugin - write file error"), MB_OK);
}
return ReturnValue;
@@ -356,8 +356,8 @@ DWORD WINAPI WritePOP3Options(HANDLE File, HACCOUNT Which) DWORD WrittenBytes;
DWORD Ver = POP3_FILEVERSION;
- if ((!WriteFile(File, (char *)&Ver, sizeof(DWORD), &WrittenBytes, NULL)) ||
- (!WriteFile(File, (char *)&((HPOP3ACCOUNT)Which)->CP, sizeof(WORD), &WrittenBytes, NULL)))
+ if ((!WriteFile(File, (char *)&Ver, sizeof(DWORD), &WrittenBytes, nullptr)) ||
+ (!WriteFile(File, (char *)&((HPOP3ACCOUNT)Which)->CP, sizeof(WORD), &WrittenBytes, nullptr)))
return EACC_SYSTEM;
return 0;
}
@@ -396,13 +396,13 @@ HYAMNMAIL WINAPI CreatePOP3Mail(HACCOUNT Account, DWORD) // if (MailDataVersion != YAMN_MAILDATAVERSION) return NULL;
//Now it is needed to construct our POP3 account and return its handle
- if (NULL == (NewMail = new YAMNMAIL))
- return NULL;
+ if (nullptr == (NewMail = new YAMNMAIL))
+ return nullptr;
- if (NULL == (NewMail->MailData = new MAILDATA))
+ if (nullptr == (NewMail->MailData = new MAILDATA))
{
delete NewMail;
- return NULL;
+ return nullptr;
}
NewMail->MailData->CP = ((HPOP3ACCOUNT)Account)->CP;
return (HYAMNMAIL)NewMail;
@@ -424,7 +424,7 @@ static void PostErrorProc(HPOP3ACCOUNT ActualAccount, void *ParamToBadConnection PPOP3_ERRORCODE ErrorCode;
//We store status before we do Quit(), because quit can destroy our errorcode status
- if (NULL != (ErrorCode = new POP3_ERRORCODE))
+ if (nullptr != (ErrorCode = new POP3_ERRORCODE))
{
ErrorCode->SSL = UseSSL;
ErrorCode->AppError = ActualAccount->SystemError;
@@ -438,7 +438,7 @@ static void PostErrorProc(HPOP3ACCOUNT ActualAccount, void *ParamToBadConnection try
{
DataRX = ActualAccount->Client.Quit();
- if (DataRX != NULL)
+ if (DataRX != nullptr)
free(DataRX);
}
catch (...)
@@ -456,19 +456,19 @@ static void PostErrorProc(HPOP3ACCOUNT ActualAccount, void *ParamToBadConnection SetAccountStatus(ActualAccount, TranslateT("Disconnected"));
//If we cannot allocate memory, do nothing
- if (ErrorCode == NULL)
+ if (ErrorCode == nullptr)
{
SetEvent(ActualAccount->UseInternetFree);
return;
}
}
else //else it was called from POP3 plugin, probably error when deleting old mail (POP3 synchro calls POP3 delete)
- if (ErrorCode == NULL)
+ if (ErrorCode == nullptr)
return;
if ((ActualAccount->BadConnectN.Flags & YAMN_ACC_MSG) || (ActualAccount->BadConnectN.Flags & YAMN_ACC_ICO) || (ActualAccount->BadConnectN.Flags & YAMN_ACC_POP))
{
- YAMN_BADCONNECTIONPARAM cp = { (HANDLE)0, ActualAccount, (UINT_PTR)ErrorCode, ParamToBadConnection };
+ YAMN_BADCONNECTIONPARAM cp = { (HANDLE)nullptr, ActualAccount, (UINT_PTR)ErrorCode, ParamToBadConnection };
CallService(MS_YAMN_BADCONNECTION, (WPARAM)&cp, (LPARAM)YAMN_BADCONNECTIONVERSION);
}
@@ -481,8 +481,8 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp) {
HPOP3ACCOUNT ActualAccount;
CPop3Client *MyClient;
- HYAMNMAIL NewMails = NULL, MsgQueuePtr = NULL;
- char* DataRX = NULL, *Temp;
+ HYAMNMAIL NewMails = nullptr, MsgQueuePtr = nullptr;
+ char* DataRX = nullptr, *Temp;
int mboxsize, msgs, i;
SYSTEMTIME now;
LPVOID YAMNParam;
@@ -589,14 +589,14 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp) #endif
// if we are already connected, we have open session (another thread left us open session), so we don't need to login
// note that connected state without logging cannot occur, because if we close session, we always close socket too (we must close socket is the right word :))
- if ((MyClient->NetClient == NULL) || !MyClient->NetClient->Connected())
+ if ((MyClient->NetClient == nullptr) || !MyClient->NetClient->Connected())
{
SetAccountStatus(ActualAccount, TranslateT("Connecting to server"));
DataRX = MyClient->Connect(ActualCopied.ServerName, ActualCopied.ServerPort, ActualCopied.Flags & YAMN_ACC_SSL23, ActualCopied.Flags & YAMN_ACC_NOTLS);
- char *timestamp = NULL;
+ char *timestamp = nullptr;
- if (DataRX != NULL)
+ if (DataRX != nullptr)
{
if (ActualCopied.Flags & YAMN_ACC_APOP)
{
@@ -610,7 +610,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp) }
}
free(DataRX);
- DataRX = NULL;
+ DataRX = nullptr;
}
SetAccountStatus(ActualAccount, TranslateT("Entering POP3 account"));
@@ -618,20 +618,20 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp) if (ActualCopied.Flags & YAMN_ACC_APOP)
{
DataRX = MyClient->APOP(ActualCopied.ServerLogin, ActualCopied.ServerPasswd, timestamp);
- if (DataRX != NULL)
+ if (DataRX != nullptr)
free(DataRX);
- DataRX = NULL;
+ DataRX = nullptr;
delete[] timestamp;
}
else {
DataRX = MyClient->User(ActualCopied.ServerLogin);
- if (DataRX != NULL)
+ if (DataRX != nullptr)
free(DataRX);
- DataRX = NULL;
+ DataRX = nullptr;
DataRX = MyClient->Pass(ActualCopied.ServerPasswd);
- if (DataRX != NULL)
+ if (DataRX != nullptr)
free(DataRX);
- DataRX = NULL;
+ DataRX = nullptr;
}
}
SetAccountStatus(ActualAccount, TranslateT("Searching for new mail message"));
@@ -648,9 +648,9 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp) DebugLog(DecodeFile,"<Msgs>%d</Msgs>\n",msgs);
DebugLog(DecodeFile,"</Extracting stat>\n");
#endif
- if (DataRX != NULL)
+ if (DataRX != nullptr)
free(DataRX);
- DataRX = NULL;
+ DataRX = nullptr;
for (i = 0; i < msgs; i++)
{
if (!i)
@@ -660,7 +660,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp) MsgQueuePtr->Next = (HYAMNMAIL)CallService(MS_YAMN_CREATEACCOUNTMAIL, (WPARAM)ActualAccount, (LPARAM)YAMN_MAILVERSION);
MsgQueuePtr = MsgQueuePtr->Next;
}
- if (MsgQueuePtr == NULL)
+ if (MsgQueuePtr == nullptr)
{
ActualAccount->SystemError = EPOP3_QUEUEALLOC;
throw (DWORD)ActualAccount->SystemError;
@@ -677,9 +677,9 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp) #ifdef DEBUG_DECODE
DebugLog(DecodeFile,"</Extracting list>\n");
#endif
- if (DataRX != NULL)
+ if (DataRX != nullptr)
free(DataRX);
- DataRX = NULL;
+ DataRX = nullptr;
#ifdef DEBUG_DECODE
DebugLog(DecodeFile,"<Extracting UIDL>\n");
@@ -689,9 +689,9 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp) #ifdef DEBUG_DECODE
DebugLog(DecodeFile,"</Extracting UIDL>\n");
#endif
- if (DataRX != NULL)
+ if (DataRX != nullptr)
free(DataRX);
- DataRX = NULL;
+ DataRX = nullptr;
}
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"CheckPOP3:ActualAccountMsgsSO-write wait\n");
@@ -707,10 +707,10 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp) DebugLog(SynchroFile,"CheckPOP3:ActualAccountMsgsSO-write enter\n");
#endif
ActualAccount->LastChecked = now;
- for (MsgQueuePtr = (HYAMNMAIL)ActualAccount->Mails; MsgQueuePtr != NULL; MsgQueuePtr = MsgQueuePtr->Next) {
+ for (MsgQueuePtr = (HYAMNMAIL)ActualAccount->Mails; MsgQueuePtr != nullptr; MsgQueuePtr = MsgQueuePtr->Next) {
if (MsgQueuePtr->Flags&YAMN_MSG_BODYREQUESTED) {
- HYAMNMAIL NewMsgsPtr = NULL;
- for (NewMsgsPtr = (HYAMNMAIL)NewMails; NewMsgsPtr != NULL; NewMsgsPtr = NewMsgsPtr->Next) {
+ HYAMNMAIL NewMsgsPtr = nullptr;
+ for (NewMsgsPtr = (HYAMNMAIL)NewMails; NewMsgsPtr != nullptr; NewMsgsPtr = NewMsgsPtr->Next) {
if (!mir_strcmp(MsgQueuePtr->ID, NewMsgsPtr->ID)) {
wchar_t accstatus[512];
mir_snwprintf(accstatus, TranslateT("Reading body %s"), NewMsgsPtr->ID);
@@ -720,7 +720,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp) DebugLog(DecodeFile,"<Reading body>\n");
DebugLog(DecodeFile,"<Header>%s</Header>\n",DataRX);
#endif
- if (DataRX != NULL)
+ if (DataRX != nullptr)
{
Temp = DataRX;
while ((Temp < DataRX + MyClient->NetClient->Rcv) && (WS(Temp) || ENDLINE(Temp))) Temp++;
@@ -733,12 +733,12 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp) continue;
//delete all the headers of the old mail MsgQueuePtr->MailData->TranslatedHeader
struct CMimeItem *TH = MsgQueuePtr->MailData->TranslatedHeader;
- if (TH) for (; MsgQueuePtr->MailData->TranslatedHeader != NULL;)
+ if (TH) for (; MsgQueuePtr->MailData->TranslatedHeader != nullptr;)
{
TH = TH->Next;
- if (MsgQueuePtr->MailData->TranslatedHeader->name != NULL)
+ if (MsgQueuePtr->MailData->TranslatedHeader->name != nullptr)
delete[] MsgQueuePtr->MailData->TranslatedHeader->name;
- if (MsgQueuePtr->MailData->TranslatedHeader->value != NULL)
+ if (MsgQueuePtr->MailData->TranslatedHeader->value != nullptr)
delete[] MsgQueuePtr->MailData->TranslatedHeader->value;
delete MsgQueuePtr->MailData->TranslatedHeader;
MsgQueuePtr->MailData->TranslatedHeader = TH;
@@ -752,23 +752,23 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp) #endif
MsgQueuePtr->Flags |= YAMN_MSG_BODYRECEIVED;
- if (DataRX != NULL)
+ if (DataRX != nullptr)
free(DataRX);
- DataRX = NULL;
+ DataRX = nullptr;
break;
}
}
}
}
- SynchroMessages(ActualAccount, (HYAMNMAIL *)&ActualAccount->Mails, NULL, (HYAMNMAIL *)&NewMails, NULL); //we get only new mails on server!
+ SynchroMessages(ActualAccount, (HYAMNMAIL *)&ActualAccount->Mails, nullptr, (HYAMNMAIL *)&NewMails, nullptr); //we get only new mails on server!
// NewMails=NULL;
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"CheckPOP3:ActualAccountMsgsSO-write done\n");
#endif
MsgsWriteDone(ActualAccount);
- for (MsgQueuePtr = (HYAMNMAIL)ActualAccount->Mails; MsgQueuePtr != NULL; MsgQueuePtr = MsgQueuePtr->Next) {
+ for (MsgQueuePtr = (HYAMNMAIL)ActualAccount->Mails; MsgQueuePtr != nullptr; MsgQueuePtr = MsgQueuePtr->Next) {
if ((MsgQueuePtr->Flags&YAMN_MSG_BODYREQUESTED) && (MsgQueuePtr->Flags&YAMN_MSG_BODYRECEIVED)) {
MsgQueuePtr->Flags &= ~YAMN_MSG_BODYREQUESTED;
if (MsgQueuePtr->MsgWindow)
@@ -776,13 +776,13 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp) }
}
- for (msgs = 0, MsgQueuePtr = NewMails; MsgQueuePtr != NULL; MsgQueuePtr = MsgQueuePtr->Next, msgs++); //get number of new mails
+ for (msgs = 0, MsgQueuePtr = NewMails; MsgQueuePtr != nullptr; MsgQueuePtr = MsgQueuePtr->Next, msgs++); //get number of new mails
try
{
wchar_t accstatus[512];
- for (i = 0, MsgQueuePtr = NewMails; MsgQueuePtr != NULL; i++)
+ for (i = 0, MsgQueuePtr = NewMails; MsgQueuePtr != nullptr; i++)
{
BOOL autoretr = (ActualAccount->Flags & YAMN_ACC_BODY) != 0;
DataRX = MyClient->Top(MsgQueuePtr->Number, autoretr ? 100 : 0);
@@ -793,7 +793,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp) DebugLog(DecodeFile,"<New mail>\n");
DebugLog(DecodeFile,"<Header>%s</Header>\n",DataRX);
#endif
- if (DataRX != NULL)
+ if (DataRX != nullptr)
{
Temp = DataRX;
while ((Temp < DataRX + MyClient->NetClient->Rcv) && (WS(Temp) || ENDLINE(Temp))) Temp++;
@@ -820,9 +820,9 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp) // CallService(MS_YAMN_FILTERMAIL,(WPARAM)ActualAccount,(LPARAM)MsgQueuePtr);
FilterMailSvc((WPARAM)ActualAccount, (LPARAM)MsgQueuePtr);
- if (DataRX != NULL)
+ if (DataRX != nullptr)
free(DataRX);
- DataRX = NULL;
+ DataRX = nullptr;
//MsgQueuePtr->MailData->Body=MyClient->Retr(MsgQueuePtr->Number);
@@ -846,7 +846,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp) #ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"CheckPOP3:ActualAccountMsgsSO-write enter\n");
#endif
- if (ActualAccount->Mails == NULL)
+ if (ActualAccount->Mails == nullptr)
ActualAccount->Mails = NewMails;
else
{
@@ -871,9 +871,9 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp) if (0 == SCGetNumber(ActualAccount->InternetQueries))
{
DataRX = MyClient->Quit();
- if (DataRX != NULL)
+ if (DataRX != nullptr)
free(DataRX);
- DataRX = NULL;
+ DataRX = nullptr;
MyClient->NetClient->Disconnect();
SetAccountStatus(ActualAccount, TranslateT("Disconnected"));
@@ -894,7 +894,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp) }
{
- YAMN_MAILBROWSERPARAM Param = { (HANDLE)0, ActualAccount, ActualCopied.NFlags, ActualCopied.NNFlags, YAMNParam };
+ YAMN_MAILBROWSERPARAM Param = { (HANDLE)nullptr, ActualAccount, ActualCopied.NFlags, ActualCopied.NNFlags, YAMNParam };
if (CheckFlags & YAMN_FORCECHECK)
Param.nnflags |= YAMN_ACC_POP; //if force check, show popup anyway and if mailbrowser was opened, do not close
@@ -935,9 +935,9 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp) DeleteMIMEQueue(ActualAccount, NewMails);
- if (DataRX != NULL)
+ if (DataRX != nullptr)
free(DataRX);
- DataRX = NULL;
+ DataRX = nullptr;
switch (ActualAccount->SystemError)
{
case EACC_QUEUEALLOC:
@@ -976,8 +976,8 @@ void __cdecl DeleteMailsPOP3(void *param) DeleteParam *WhichTemp = (DeleteParam *)param;
CPop3Client *MyClient;
- HYAMNMAIL DeleteMails, NewMails = NULL, MsgQueuePtr = NULL;
- char* DataRX = NULL;
+ HYAMNMAIL DeleteMails, NewMails = nullptr, MsgQueuePtr = nullptr;
+ char* DataRX = nullptr;
int mboxsize = 0, msgs = 0, i;
BOOL UsingInternet = FALSE;
struct {
@@ -1028,11 +1028,11 @@ void __cdecl DeleteMailsPOP3(void *param) #ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"DeleteMailsPOP3:ActualAccountSO-read enter\n");
#endif
- if (NULL == (DeleteMails = (HYAMNMAIL)CreateNewDeleteQueue((HYAMNMAIL)ActualAccount->Mails))) //if there's no mail for deleting, return
+ if (nullptr == (DeleteMails = (HYAMNMAIL)CreateNewDeleteQueue((HYAMNMAIL)ActualAccount->Mails))) //if there's no mail for deleting, return
{
if (POP3_DELETEFROMCHECK != POP3PluginParam) //We do not wait for free internet when calling from SynchroPOP3. It is because UseInternetFree is blocked
{
- YAMN_MAILBROWSERPARAM Param = { (HANDLE)0, ActualAccount, YAMN_ACC_MSGP, YAMN_ACC_MSGP, YAMNParam }; //Just update the window
+ YAMN_MAILBROWSERPARAM Param = { (HANDLE)nullptr, ActualAccount, YAMN_ACC_MSGP, YAMN_ACC_MSGP, YAMNParam }; //Just update the window
CallService(MS_YAMN_MAILBROWSER, (WPARAM)&Param, (LPARAM)YAMN_MAILBROWSERVERSION);
}
@@ -1083,14 +1083,14 @@ void __cdecl DeleteMailsPOP3(void *param) #ifdef DEBUG_COMM
DebugLog(CommFile,"<--------Communication-------->\n");
#endif
- if ((MyClient->NetClient == NULL) || !MyClient->NetClient->Connected())
+ if ((MyClient->NetClient == nullptr) || !MyClient->NetClient->Connected())
{
SetAccountStatus(ActualAccount, TranslateT("Connecting to server"));
DataRX = MyClient->Connect(ActualCopied.ServerName, ActualCopied.ServerPort, ActualCopied.Flags & YAMN_ACC_SSL23, ActualCopied.Flags & YAMN_ACC_NOTLS);
- char *timestamp = NULL;
- if (DataRX != NULL) {
+ char *timestamp = nullptr;
+ if (DataRX != nullptr) {
if (ActualAccount->Flags & YAMN_ACC_APOP) {
char *lpos = strchr(DataRX, '<');
char *rpos = strchr(DataRX, '>');
@@ -1102,27 +1102,27 @@ void __cdecl DeleteMailsPOP3(void *param) }
}
free(DataRX);
- DataRX = NULL;
+ DataRX = nullptr;
}
SetAccountStatus(ActualAccount, TranslateT("Entering POP3 account"));
if (ActualAccount->Flags & YAMN_ACC_APOP)
{
DataRX = MyClient->APOP(ActualCopied.ServerLogin, ActualCopied.ServerPasswd, timestamp);
- if (DataRX != NULL)
+ if (DataRX != nullptr)
free(DataRX);
- DataRX = NULL;
+ DataRX = nullptr;
delete[] timestamp;
}
else {
DataRX = MyClient->User(ActualCopied.ServerLogin);
- if (DataRX != NULL)
+ if (DataRX != nullptr)
free(DataRX);
- DataRX = NULL;
+ DataRX = nullptr;
DataRX = MyClient->Pass(ActualCopied.ServerPasswd);
- if (DataRX != NULL)
+ if (DataRX != nullptr)
free(DataRX);
- DataRX = NULL;
+ DataRX = nullptr;
}
}
@@ -1144,9 +1144,9 @@ void __cdecl DeleteMailsPOP3(void *param) DebugLog(DecodeFile,"<Msgs>%d</Msgs>\n",msgs);
DebugLog(DecodeFile,"</Extracting stat>\n");
#endif
- if (DataRX != NULL)
+ if (DataRX != nullptr)
free(DataRX);
- DataRX = NULL;
+ DataRX = nullptr;
for (i = 0; i < msgs; i++)
{
if (!i)
@@ -1156,7 +1156,7 @@ void __cdecl DeleteMailsPOP3(void *param) MsgQueuePtr->Next = (HYAMNMAIL)CallService(MS_YAMN_CREATEACCOUNTMAIL, (WPARAM)ActualAccount, (LPARAM)YAMN_MAILVERSION);
MsgQueuePtr = MsgQueuePtr->Next;
}
- if (MsgQueuePtr == NULL)
+ if (MsgQueuePtr == nullptr)
{
ActualAccount->SystemError = EPOP3_QUEUEALLOC;
throw (DWORD)ActualAccount->SystemError;
@@ -1173,12 +1173,12 @@ void __cdecl DeleteMailsPOP3(void *param) #ifdef DEBUG_DECODE
DebugLog(DecodeFile,"</Extracting UIDL>\n");
#endif
- if (DataRX != NULL)
+ if (DataRX != nullptr)
free(DataRX);
- DataRX = NULL;
+ DataRX = nullptr;
// we get "new mails" on server (NewMails will contain all mails on server not found in DeleteMails)
// but also in DeleteMails we get only those, which are still on server with their responsable numbers
- SynchroMessages(ActualAccount, (HYAMNMAIL *)&DeleteMails, NULL, (HYAMNMAIL *)&NewMails, NULL);
+ SynchroMessages(ActualAccount, (HYAMNMAIL *)&DeleteMails, nullptr, (HYAMNMAIL *)&NewMails, nullptr);
}
}
else
@@ -1202,7 +1202,7 @@ void __cdecl DeleteMailsPOP3(void *param) {
HYAMNMAIL Temp;
- for (i = 0, MsgQueuePtr = DeleteMails; MsgQueuePtr != NULL; i++)
+ for (i = 0, MsgQueuePtr = DeleteMails; MsgQueuePtr != nullptr; i++)
{
if (!(MsgQueuePtr->Flags & YAMN_MSG_VIRTUAL)) //of course we can only delete real mails, not virtual
{
@@ -1228,9 +1228,9 @@ void __cdecl DeleteMailsPOP3(void *param) }
MsgQueuePtr = Temp;
- if (DataRX != NULL)
+ if (DataRX != nullptr)
free(DataRX);
- DataRX = NULL;
+ DataRX = nullptr;
}
else
MsgQueuePtr = MsgQueuePtr->Next;
@@ -1245,25 +1245,25 @@ void __cdecl DeleteMailsPOP3(void *param) throw; //and go to the main exception handling
}
- if (NewMails != NULL)
+ if (NewMails != nullptr)
// in ActualAccount->Mails we have all mails stored before calling this function
// in NewMails we have all mails not found in DeleteMails (in other words: we performed new ID checking and we
// stored all mails found on server, then we deleted the ones we wanted to delete in this function
// and NewMails queue now contains actual state of mails on server). But we will not use NewMails as actual state, because NewMails does not contain header data (subject, from...)
// We perform deleting from ActualAccount->Mails: we remove from original queue (ActualAccount->Mails) all deleted mails
- SynchroMessages(ActualAccount, (HYAMNMAIL *)&ActualAccount->Mails, NULL, (HYAMNMAIL *)&NewMails, NULL);
+ SynchroMessages(ActualAccount, (HYAMNMAIL *)&ActualAccount->Mails, nullptr, (HYAMNMAIL *)&NewMails, nullptr);
// Now ActualAccount->Mails contains all mails when calling this function except the ones, we wanted to delete (these are in DeleteMails)
// And in NewMails we have new mails (if any)
else if (POP3_DELETEFROMCHECK != POP3PluginParam)
{
DeleteMIMEQueue(ActualAccount, (HYAMNMAIL)ActualAccount->Mails);
- ActualAccount->Mails = NULL;
+ ActualAccount->Mails = nullptr;
}
}
else
{
DeleteMIMEQueue(ActualAccount, (HYAMNMAIL)ActualAccount->Mails);
- ActualAccount->Mails = NULL;
+ ActualAccount->Mails = nullptr;
}
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"DeleteMailsPOP3:ActualAccountMsgsSO-write done\n");
@@ -1281,16 +1281,16 @@ void __cdecl DeleteMailsPOP3(void *param) // if this functin was called from SynchroPOP3, then do not try to disconnect
if (POP3_DELETEFROMCHECK != POP3PluginParam)
{
- YAMN_MAILBROWSERPARAM Param = { (HANDLE)0, ActualAccount, ActualCopied.NFlags, YAMN_ACC_MSGP, YAMNParam };
+ YAMN_MAILBROWSERPARAM Param = { (HANDLE)nullptr, ActualAccount, ActualCopied.NFlags, YAMN_ACC_MSGP, YAMNParam };
CallService(MS_YAMN_MAILBROWSER, (WPARAM)&Param, (LPARAM)YAMN_MAILBROWSERVERSION);
if (0 == SCGetNumber(ActualAccount->InternetQueries))
{
DataRX = MyClient->Quit();
- if (DataRX != NULL)
+ if (DataRX != nullptr)
free(DataRX);
- DataRX = NULL;
+ DataRX = nullptr;
MyClient->NetClient->Disconnect();
SetAccountStatus(ActualAccount, TranslateT("Disconnected"));
@@ -1315,7 +1315,7 @@ void __cdecl DeleteMailsPOP3(void *param) #ifdef DEBUG_COMM
DebugLog(CommFile,"ERROR %x\n",ErrorCode);
#endif
- if (DataRX != NULL)
+ if (DataRX != nullptr)
free(DataRX);
switch (ActualAccount->SystemError)
{
@@ -1485,7 +1485,7 @@ void ExtractList(char *stream, int len, HYAMNMAIL queue) DebugLog(DecodeFile,"<Nr>%d</Nr>\n",msgnr);
#endif
- for (i = 1, queueptr = queue; (queueptr->Next != NULL) && (i < msgnr); queueptr = queueptr->Next, i++);
+ for (i = 1, queueptr = queue; (queueptr->Next != nullptr) && (i < msgnr); queueptr = queueptr->Next, i++);
if (i != msgnr)
throw (DWORD)EPOP3_LIST;
while (!WS(finder)) finder++; //jump characters
diff --git a/plugins/YAMN/src/proto/pop3/pop3opt.cpp b/plugins/YAMN/src/proto/pop3/pop3opt.cpp index 16fda3be2c..5d239f3e1e 100644 --- a/plugins/YAMN/src/proto/pop3/pop3opt.cpp +++ b/plugins/YAMN/src/proto/pop3/pop3opt.cpp @@ -92,22 +92,22 @@ INT_PTR CALLBACK DlgProcPluginOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM) id = SendMessage(hCombo, CB_GETITEMDATA, (WPARAM)index, 0);
mir_cslock lck(PluginRegCS);
- for (PParser = FirstProtoPlugin; PParser != NULL; PParser = PParser->Next)
+ for (PParser = FirstProtoPlugin; PParser != nullptr; PParser = PParser->Next)
if (id == (INT_PTR)PParser->Plugin) {
SetDlgItemTextA(hDlg, IDC_STVER, PParser->Plugin->PluginInfo->Ver);
- SetDlgItemTextA(hDlg, IDC_STDESC, PParser->Plugin->PluginInfo->Description == NULL ? "" : PParser->Plugin->PluginInfo->Description);
- SetDlgItemTextA(hDlg, IDC_STCOPY, PParser->Plugin->PluginInfo->Copyright == NULL ? "" : PParser->Plugin->PluginInfo->Copyright);
- SetDlgItemTextA(hDlg, IDC_STMAIL, PParser->Plugin->PluginInfo->Email == NULL ? "" : PParser->Plugin->PluginInfo->Email);
- SetDlgItemTextA(hDlg, IDC_STWWW, PParser->Plugin->PluginInfo->WWW == NULL ? "" : PParser->Plugin->PluginInfo->WWW);
+ SetDlgItemTextA(hDlg, IDC_STDESC, PParser->Plugin->PluginInfo->Description == nullptr ? "" : PParser->Plugin->PluginInfo->Description);
+ SetDlgItemTextA(hDlg, IDC_STCOPY, PParser->Plugin->PluginInfo->Copyright == nullptr ? "" : PParser->Plugin->PluginInfo->Copyright);
+ SetDlgItemTextA(hDlg, IDC_STMAIL, PParser->Plugin->PluginInfo->Email == nullptr ? "" : PParser->Plugin->PluginInfo->Email);
+ SetDlgItemTextA(hDlg, IDC_STWWW, PParser->Plugin->PluginInfo->WWW == nullptr ? "" : PParser->Plugin->PluginInfo->WWW);
break;
}
- for (FParser = FirstFilterPlugin; FParser != NULL; FParser = FParser->Next)
+ for (FParser = FirstFilterPlugin; FParser != nullptr; FParser = FParser->Next)
if (id == (INT_PTR)FParser->Plugin) {
SetDlgItemTextA(hDlg, IDC_STVER, FParser->Plugin->PluginInfo->Ver);
- SetDlgItemTextA(hDlg, IDC_STDESC, FParser->Plugin->PluginInfo->Description == NULL ? "" : FParser->Plugin->PluginInfo->Description);
- SetDlgItemTextA(hDlg, IDC_STCOPY, FParser->Plugin->PluginInfo->Copyright == NULL ? "" : FParser->Plugin->PluginInfo->Copyright);
- SetDlgItemTextA(hDlg, IDC_STMAIL, FParser->Plugin->PluginInfo->Email == NULL ? "" : FParser->Plugin->PluginInfo->Email);
- SetDlgItemTextA(hDlg, IDC_STWWW, FParser->Plugin->PluginInfo->WWW == NULL ? "" : FParser->Plugin->PluginInfo->WWW);
+ SetDlgItemTextA(hDlg, IDC_STDESC, FParser->Plugin->PluginInfo->Description == nullptr ? "" : FParser->Plugin->PluginInfo->Description);
+ SetDlgItemTextA(hDlg, IDC_STCOPY, FParser->Plugin->PluginInfo->Copyright == nullptr ? "" : FParser->Plugin->PluginInfo->Copyright);
+ SetDlgItemTextA(hDlg, IDC_STMAIL, FParser->Plugin->PluginInfo->Email == nullptr ? "" : FParser->Plugin->PluginInfo->Email);
+ SetDlgItemTextA(hDlg, IDC_STWWW, FParser->Plugin->PluginInfo->WWW == nullptr ? "" : FParser->Plugin->PluginInfo->WWW);
break;
}
}
@@ -127,11 +127,11 @@ INT_PTR CALLBACK DlgProcPluginOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM) if (TRUE == (BOOL)wParam) {
{
mir_cslock lck(PluginRegCS);
- for (PYAMN_PROTOPLUGINQUEUE PParser = FirstProtoPlugin; PParser != NULL; PParser = PParser->Next) {
+ for (PYAMN_PROTOPLUGINQUEUE PParser = FirstProtoPlugin; PParser != nullptr; PParser = PParser->Next) {
int index = SendDlgItemMessageA(hDlg, IDC_COMBOPLUGINS, CB_ADDSTRING, 0, (LPARAM)PParser->Plugin->PluginInfo->Name);
SendDlgItemMessage(hDlg, IDC_COMBOPLUGINS, CB_SETITEMDATA, (WPARAM)index, (LPARAM)PParser->Plugin);
}
- for (PYAMN_FILTERPLUGINQUEUE FParser = FirstFilterPlugin; FParser != NULL; FParser = FParser->Next) {
+ for (PYAMN_FILTERPLUGINQUEUE FParser = FirstFilterPlugin; FParser != nullptr; FParser = FParser->Next) {
int index = SendDlgItemMessageA(hDlg, IDC_COMBOPLUGINS, CB_ADDSTRING, 0, (LPARAM)FParser->Plugin->PluginInfo->Name);
SendDlgItemMessage(hDlg, IDC_COMBOPLUGINS, CB_SETITEMDATA, (WPARAM)index, (LPARAM)FParser->Plugin);
}
@@ -448,13 +448,13 @@ BOOL DlgShowAccount(HWND hDlg, WPARAM wParam, LPARAM lParam) }
else //default
{
- DlgSetItemText(hDlg, (WPARAM)IDC_EDITSERVER, 0);
- DlgSetItemText(hDlg, (WPARAM)IDC_EDITNAME, 0);
- DlgSetItemText(hDlg, (WPARAM)IDC_EDITLOGIN, 0);
- DlgSetItemText(hDlg, (WPARAM)IDC_EDITPASS, 0);
- DlgSetItemText(hDlg, (WPARAM)IDC_EDITAPP, 0);
- DlgSetItemText(hDlg, (WPARAM)IDC_EDITAPPPARAM, 0);
- DlgSetItemText(hDlg, (WPARAM)IDC_STTIMELEFT, 0);
+ DlgSetItemText(hDlg, (WPARAM)IDC_EDITSERVER, nullptr);
+ DlgSetItemText(hDlg, (WPARAM)IDC_EDITNAME, nullptr);
+ DlgSetItemText(hDlg, (WPARAM)IDC_EDITLOGIN, nullptr);
+ DlgSetItemText(hDlg, (WPARAM)IDC_EDITPASS, nullptr);
+ DlgSetItemText(hDlg, (WPARAM)IDC_EDITAPP, nullptr);
+ DlgSetItemText(hDlg, (WPARAM)IDC_EDITAPPPARAM, nullptr);
+ DlgSetItemText(hDlg, (WPARAM)IDC_STTIMELEFT, nullptr);
SetDlgItemInt(hDlg, IDC_EDITPORT, 110, FALSE);
SetDlgItemInt(hDlg, IDC_EDITINTERVAL, 30, FALSE);
SetDlgItemInt(hDlg, IDC_EDITPOPS, 0, FALSE);
@@ -543,7 +543,7 @@ BOOL DlgShowAccountColors(HWND hDlg, WPARAM, LPARAM lParam) BOOL DlgSetItemText(HWND hDlg, WPARAM wParam, const char* str)
{
- if (str == NULL)
+ if (str == nullptr)
SetDlgItemTextA(hDlg, wParam, "");
else
SetDlgItemTextA(hDlg, wParam, str);
@@ -552,7 +552,7 @@ BOOL DlgSetItemText(HWND hDlg, WPARAM wParam, const char* str) BOOL DlgSetItemTextW(HWND hDlg, WPARAM wParam, const WCHAR* str)
{
- if (str == NULL)
+ if (str == nullptr)
SetDlgItemTextW(hDlg, wParam, L"");
else
SetDlgItemTextW(hDlg, wParam, str);
@@ -565,7 +565,7 @@ INT_PTR CALLBACK DlgProcPOP3AccStatusOpt(HWND hDlg, UINT msg, WPARAM wParam, LPA switch (msg) {
case WM_INITDIALOG:
ActualAccount = (HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)DlgInput);
- if (ActualAccount != NULL) {
+ if (ActualAccount != nullptr) {
DlgShowAccountStatus(hDlg, (WPARAM)M_SHOWACTUAL, (LPARAM)ActualAccount);
DlgEnableAccountStatus(hDlg, TRUE, TRUE);
}
@@ -639,8 +639,8 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP DebugLog(SynchroFile, "Options:INITDIALOG:AccountBrowserSO-read enter\n");
#endif
- for (ActualAccount = (HPOP3ACCOUNT)POP3Plugin->FirstAccount; ActualAccount != NULL; ActualAccount = (HPOP3ACCOUNT)ActualAccount->Next)
- if (ActualAccount->Name != NULL)
+ for (ActualAccount = (HPOP3ACCOUNT)POP3Plugin->FirstAccount; ActualAccount != nullptr; ActualAccount = (HPOP3ACCOUNT)ActualAccount->Next)
+ if (ActualAccount->Name != nullptr)
SendDlgItemMessageA(hDlg, IDC_COMBOACCOUNT, CB_ADDSTRING, 0, (LPARAM)ActualAccount->Name);
#ifdef DEBUG_SYNCHRO
@@ -656,7 +656,7 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP }
SendDlgItemMessage(hDlg, IDC_COMBOCP, CB_SETCURSEL, (WPARAM)CPDEFINDEX, 0);
- ActualAccount = NULL;
+ ActualAccount = nullptr;
TranslateDialogDefault(hDlg);
SendMessage(GetParent(hDlg), PSM_UNCHANGED, (WPARAM)hDlg, 0);
return TRUE;
@@ -697,8 +697,8 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP case IDC_COMBOACCOUNT:
switch (HIWORD(wParam)) {
case CBN_EDITCHANGE:
- ActualAccount = NULL;
- DlgSetItemText(hDlg, (WPARAM)IDC_STTIMELEFT, 0);
+ ActualAccount = nullptr;
+ DlgSetItemText(hDlg, (WPARAM)IDC_STTIMELEFT, nullptr);
if (GetDlgItemTextA(hDlg, IDC_COMBOACCOUNT, DlgInput, _countof(DlgInput)))
DlgEnableAccount(hDlg, TRUE, FALSE);
@@ -708,8 +708,8 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP case CBN_KILLFOCUS:
GetDlgItemTextA(hDlg, IDC_COMBOACCOUNT, DlgInput, _countof(DlgInput));
- if (NULL == (ActualAccount = (HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)DlgInput))) {
- DlgSetItemText(hDlg, (WPARAM)IDC_STTIMELEFT, 0);
+ if (nullptr == (ActualAccount = (HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)DlgInput))) {
+ DlgSetItemText(hDlg, (WPARAM)IDC_STTIMELEFT, nullptr);
EnableWindow(GetDlgItem(hDlg, IDC_BTNDEL), FALSE);
if (mir_strlen(DlgInput))
DlgEnableAccount(hDlg, TRUE, TRUE);
@@ -727,8 +727,8 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP if (CB_ERR != (Result = SendDlgItemMessage(hDlg, IDC_COMBOACCOUNT, CB_GETCURSEL, 0, 0)))
SendDlgItemMessageA(hDlg, IDC_COMBOACCOUNT, CB_GETLBTEXT, (WPARAM)Result, (LPARAM)DlgInput);
- if ((Result == CB_ERR) || (NULL == (ActualAccount = (HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)DlgInput)))) {
- DlgSetItemText(hDlg, (WPARAM)IDC_STTIMELEFT, 0);
+ if ((Result == CB_ERR) || (nullptr == (ActualAccount = (HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)DlgInput)))) {
+ DlgSetItemText(hDlg, (WPARAM)IDC_STTIMELEFT, nullptr);
EnableWindow(GetDlgItem(hDlg, IDC_BTNDEL), FALSE);
}
else {
@@ -815,7 +815,7 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP break;
case IDC_BTNADD:
- DlgSetItemText(hDlg, (WPARAM)IDC_STTIMELEFT, 0);
+ DlgSetItemText(hDlg, (WPARAM)IDC_STTIMELEFT, nullptr);
DlgShowAccount(hDlg, (WPARAM)M_SHOWDEFAULT, 0);
DlgEnableAccount(hDlg, TRUE, TRUE);
EnableWindow(GetDlgItem(hDlg, IDC_BTNDEL), FALSE);
@@ -860,7 +860,7 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP GetDlgItemTextA(hDlg, IDC_COMBOACCOUNT, DlgInput, _countof(DlgInput));
EnableWindow(GetDlgItem(hDlg, IDC_BTNDEL), FALSE);
if ((CB_ERR == (Result = SendDlgItemMessage(hDlg, IDC_COMBOACCOUNT, CB_GETCURSEL, 0, 0)))
- || (NULL == (ActualAccount = (HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)DlgInput))))
+ || (nullptr == (ActualAccount = (HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)DlgInput))))
return TRUE;
if (IDOK != MessageBox(hDlg, TranslateT("Do you really want to delete this account?"), TranslateT("Delete account confirmation"), MB_OKCANCEL | MB_ICONWARNING))
@@ -876,13 +876,13 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP //We can consider our account as deleted.
SendDlgItemMessage(hDlg, IDC_COMBOACCOUNT, CB_DELETESTRING, (WPARAM)Result, 0);
- DlgSetItemText(hDlg, (WPARAM)IDC_COMBOACCOUNT, 0);
+ DlgSetItemText(hDlg, (WPARAM)IDC_COMBOACCOUNT, nullptr);
DlgEnableAccount(hDlg, FALSE, 0);
DlgShowAccount(hDlg, (WPARAM)M_SHOWDEFAULT, 0);
break;
case IDC_BTNRESET:
- if (ActualAccount != NULL)
+ if (ActualAccount != nullptr)
ActualAccount->TimeLeft = ActualAccount->Interval;
return 1;
}
@@ -955,7 +955,7 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP DlgSetItemTextT(hDlg, IDC_STTIMELEFT, TranslateT("Please wait while no account is in use."));
- if (NULL == (ActualAccount = (HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)Text))) {
+ if (nullptr == (ActualAccount = (HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)Text))) {
NewAcc = TRUE;
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile, "Options:APPLY:AccountBrowserSO-write wait\n");
@@ -964,7 +964,7 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP #ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile, "Options:APPLY:AccountBrowserSO-write enter\n");
#endif
- if (NULL == (ActualAccount = (HPOP3ACCOUNT)CallService(MS_YAMN_GETNEXTFREEACCOUNT, (WPARAM)POP3Plugin, (LPARAM)YAMN_ACCOUNTVERSION))) {
+ if (nullptr == (ActualAccount = (HPOP3ACCOUNT)CallService(MS_YAMN_GETNEXTFREEACCOUNT, (WPARAM)POP3Plugin, (LPARAM)YAMN_ACCOUNTVERSION))) {
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile, "Options:APPLY:AccountBrowserSO-write done\n");
#endif
@@ -1003,37 +1003,37 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP GetDlgItemTextA(hDlg, IDC_EDITNAME, Text, _countof(Text));
if (!(Length = mir_strlen(Text)))
break;
- if (NULL != ActualAccount->Name)
+ if (nullptr != ActualAccount->Name)
delete[] ActualAccount->Name;
ActualAccount->Name = new char[mir_strlen(Text) + 1];
mir_strcpy(ActualAccount->Name, Text);
GetDlgItemTextA(hDlg, IDC_EDITSERVER, Text, _countof(Text));
- if (NULL != ActualAccount->Server->Name)
+ if (nullptr != ActualAccount->Server->Name)
delete[] ActualAccount->Server->Name;
ActualAccount->Server->Name = new char[mir_strlen(Text) + 1];
mir_strcpy(ActualAccount->Server->Name, Text);
GetDlgItemTextA(hDlg, IDC_EDITLOGIN, Text, _countof(Text));
- if (NULL != ActualAccount->Server->Login)
+ if (nullptr != ActualAccount->Server->Login)
delete[] ActualAccount->Server->Login;
ActualAccount->Server->Login = new char[mir_strlen(Text) + 1];
mir_strcpy(ActualAccount->Server->Login, Text);
GetDlgItemTextA(hDlg, IDC_EDITPASS, Text, _countof(Text));
- if (NULL != ActualAccount->Server->Passwd)
+ if (nullptr != ActualAccount->Server->Passwd)
delete[] ActualAccount->Server->Passwd;
ActualAccount->Server->Passwd = new char[mir_strlen(Text) + 1];
mir_strcpy(ActualAccount->Server->Passwd, Text);
GetDlgItemTextW(hDlg, IDC_EDITAPP, TextW, _countof(TextW));
- if (NULL != ActualAccount->NewMailN.App)
+ if (nullptr != ActualAccount->NewMailN.App)
delete[] ActualAccount->NewMailN.App;
ActualAccount->NewMailN.App = new WCHAR[mir_wstrlen(TextW) + 1];
mir_wstrcpy(ActualAccount->NewMailN.App, TextW);
GetDlgItemTextW(hDlg, IDC_EDITAPPPARAM, TextW, _countof(TextW));
- if (NULL != ActualAccount->NewMailN.AppParam)
+ if (nullptr != ActualAccount->NewMailN.AppParam)
delete[] ActualAccount->NewMailN.AppParam;
ActualAccount->NewMailN.AppParam = new WCHAR[mir_wstrlen(TextW) + 1];
mir_wstrcpy(ActualAccount->NewMailN.AppParam, TextW);
@@ -1109,16 +1109,16 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP EnableWindow(GetDlgItem(hDlg, IDC_BTNDEL), TRUE);
- DlgSetItemText(hDlg, (WPARAM)IDC_STTIMELEFT, 0);
+ DlgSetItemText(hDlg, (WPARAM)IDC_STTIMELEFT, nullptr);
index = SendDlgItemMessage(hDlg, IDC_COMBOACCOUNT, CB_GETCURSEL, 0, 0);
HPOP3ACCOUNT temp = ActualAccount;
SendDlgItemMessage(hDlg, IDC_COMBOACCOUNT, CB_RESETCONTENT, 0, 0);
- if (POP3Plugin->FirstAccount != NULL)
- for (ActualAccount = (HPOP3ACCOUNT)POP3Plugin->FirstAccount; ActualAccount != NULL; ActualAccount = (HPOP3ACCOUNT)ActualAccount->Next)
- if (ActualAccount->Name != NULL)
+ if (POP3Plugin->FirstAccount != nullptr)
+ for (ActualAccount = (HPOP3ACCOUNT)POP3Plugin->FirstAccount; ActualAccount != nullptr; ActualAccount = (HPOP3ACCOUNT)ActualAccount->Next)
+ if (ActualAccount->Name != nullptr)
SendDlgItemMessageA(hDlg, IDC_COMBOACCOUNT, CB_ADDSTRING, 0, (LPARAM)ActualAccount->Name);
ActualAccount = temp;
@@ -1157,15 +1157,15 @@ INT_PTR CALLBACK DlgProcPOP3AccPopup(HWND hDlg, UINT msg, WPARAM wParam, LPARAM #ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile, "Options:INITDIALOG:AccountBrowserSO-read enter\n");
#endif
- if (POP3Plugin->FirstAccount != NULL)
- for (ActualAccount = (HPOP3ACCOUNT)POP3Plugin->FirstAccount; ActualAccount != NULL; ActualAccount = (HPOP3ACCOUNT)ActualAccount->Next)
- if (ActualAccount->Name != NULL)
+ if (POP3Plugin->FirstAccount != nullptr)
+ for (ActualAccount = (HPOP3ACCOUNT)POP3Plugin->FirstAccount; ActualAccount != nullptr; ActualAccount = (HPOP3ACCOUNT)ActualAccount->Next)
+ if (ActualAccount->Name != nullptr)
SendDlgItemMessageA(hDlg, IDC_COMBOACCOUNT, CB_ADDSTRING, 0, (LPARAM)ActualAccount->Name);
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile, "Options:INITDIALOG:AccountBrowserSO-read done\n");
#endif
ReadDoneSO(POP3Plugin->AccountBrowserSO);
- ActualAccount = NULL;
+ ActualAccount = nullptr;
TranslateDialogDefault(hDlg);
@@ -1185,14 +1185,14 @@ INT_PTR CALLBACK DlgProcPOP3AccPopup(HWND hDlg, UINT msg, WPARAM wParam, LPARAM HPOP3ACCOUNT temp = ActualAccount;
SendDlgItemMessage(hDlg, IDC_COMBOACCOUNT, CB_RESETCONTENT, 0, 0);
- if (POP3Plugin->FirstAccount != NULL)
- for (ActualAccount = (HPOP3ACCOUNT)POP3Plugin->FirstAccount; ActualAccount != NULL; ActualAccount = (HPOP3ACCOUNT)ActualAccount->Next)
- if (ActualAccount->Name != NULL)
+ if (POP3Plugin->FirstAccount != nullptr)
+ for (ActualAccount = (HPOP3ACCOUNT)POP3Plugin->FirstAccount; ActualAccount != nullptr; ActualAccount = (HPOP3ACCOUNT)ActualAccount->Next)
+ if (ActualAccount->Name != nullptr)
SendDlgItemMessageA(hDlg, IDC_COMBOACCOUNT, CB_ADDSTRING, 0, (LPARAM)ActualAccount->Name);
ActualAccount = temp;
- if (ActualAccount != NULL) {
+ if (ActualAccount != nullptr) {
SendDlgItemMessage(hDlg, IDC_COMBOACCOUNT, CB_SETCURSEL, (WPARAM)index, (LPARAM)ActualAccount->Name);
DlgShowAccount(hDlg, (WPARAM)M_SHOWACTUAL, (LPARAM)ActualAccount);
DlgShowAccountColors(hDlg, 0, (LPARAM)ActualAccount);
@@ -1216,8 +1216,8 @@ INT_PTR CALLBACK DlgProcPOP3AccPopup(HWND hDlg, UINT msg, WPARAM wParam, LPARAM case CBN_KILLFOCUS:
GetDlgItemTextA(hDlg, IDC_COMBOACCOUNT, DlgInput, _countof(DlgInput));
- if (NULL == (ActualAccount = (HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)DlgInput))) {
- DlgSetItemText(hDlg, (WPARAM)IDC_STTIMELEFT, 0);
+ if (nullptr == (ActualAccount = (HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)DlgInput))) {
+ DlgSetItemText(hDlg, (WPARAM)IDC_STTIMELEFT, nullptr);
if (mir_strlen(DlgInput))
DlgEnableAccountPopup(hDlg, TRUE, TRUE);
else
@@ -1232,8 +1232,8 @@ INT_PTR CALLBACK DlgProcPOP3AccPopup(HWND hDlg, UINT msg, WPARAM wParam, LPARAM case CBN_SELCHANGE:
if (CB_ERR != (Result = SendDlgItemMessage(hDlg, IDC_COMBOACCOUNT, CB_GETCURSEL, 0, 0)))
SendDlgItemMessageA(hDlg, IDC_COMBOACCOUNT, CB_GETLBTEXT, (WPARAM)Result, (LPARAM)DlgInput);
- if ((Result == CB_ERR) || (NULL == (ActualAccount = (HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)DlgInput)))) {
- DlgSetItemText(hDlg, (WPARAM)IDC_STTIMELEFT, 0);
+ if ((Result == CB_ERR) || (nullptr == (ActualAccount = (HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)DlgInput)))) {
+ DlgSetItemText(hDlg, (WPARAM)IDC_STTIMELEFT, nullptr);
}
else {
DlgShowAccount(hDlg, (WPARAM)M_SHOWACTUAL, (LPARAM)ActualAccount);
@@ -1319,12 +1319,12 @@ INT_PTR CALLBACK DlgProcPOP3AccPopup(HWND hDlg, UINT msg, WPARAM wParam, LPARAM TesterN.colorBack = GetSysColor(COLOR_BTNFACE);
TesterN.colorText = GetSysColor(COLOR_WINDOWTEXT);
}
- Tester.PluginWindowProc = NULL;
- TesterF.PluginWindowProc = NULL;
- TesterN.PluginWindowProc = NULL;
- Tester.PluginData = NULL;
- TesterF.PluginData = NULL;
- TesterN.PluginData = NULL;
+ Tester.PluginWindowProc = nullptr;
+ TesterF.PluginWindowProc = nullptr;
+ TesterN.PluginWindowProc = nullptr;
+ Tester.PluginData = nullptr;
+ TesterF.PluginData = nullptr;
+ TesterN.PluginData = nullptr;
if (IsDlgButtonChecked(hDlg, IDC_CHECKPOP) == BST_CHECKED)
PUAddPopupT(&Tester);
|