diff options
author | Goraf <22941576+Goraf@users.noreply.github.com> | 2018-02-24 15:32:06 +0100 |
---|---|---|
committer | Goraf <22941576+Goraf@users.noreply.github.com> | 2018-02-24 18:20:46 +0100 |
commit | 1c0172cca4f1e90679321912e20436a7f42f122d (patch) | |
tree | 77a544d2c09332ec176f42ebcf58a40d9c5d2b93 /plugins | |
parent | dff565f40105b20b0e8e4dba1f48ccc9b8e7ff44 (diff) |
more nullptr
Diffstat (limited to 'plugins')
112 files changed, 429 insertions, 427 deletions
diff --git a/plugins/AVS/src/stdafx.h b/plugins/AVS/src/stdafx.h index e0938155ad..14bdbf935e 100644 --- a/plugins/AVS/src/stdafx.h +++ b/plugins/AVS/src/stdafx.h @@ -132,13 +132,13 @@ void UnloadCache(void); int CreateAvatarInCache(MCONTACT hContact, AVATARCACHEENTRY *ace, const char *szProto);
void DeleteAvatarFromCache(MCONTACT hContact, bool bForever);
void PicLoader(LPVOID param);
-void NotifyMetaAware(MCONTACT hContact, CacheNode *node = NULL, AVATARCACHEENTRY *ace = (AVATARCACHEENTRY*)-1);
+void NotifyMetaAware(MCONTACT hContact, CacheNode *node = nullptr, AVATARCACHEENTRY *ace = (AVATARCACHEENTRY*)-1);
void InternalDrawAvatar(AVATARDRAWREQUEST *r, HBITMAP hbm, LONG bmWidth, LONG bmHeight, DWORD dwFlags);
int ChangeAvatar(MCONTACT hContact, bool fLoad, bool fNotifyHist = false, int pa_format = 0);
void DeleteGlobalUserAvatar();
-int FetchAvatarFor(MCONTACT hContact, char *szProto = NULL);
+int FetchAvatarFor(MCONTACT hContact, char *szProto = nullptr);
CacheNode* FindAvatarInCache(MCONTACT hContact, bool add, bool findAny = false);
void PushAvatarRequest(CacheNode *cc);
int SetAvatarAttribute(MCONTACT hContact, DWORD attrib, int mode);
diff --git a/plugins/Alarms/src/alarmlist.h b/plugins/Alarms/src/alarmlist.h index a18b8a4aa1..f1bb2f61d0 100755 --- a/plugins/Alarms/src/alarmlist.h +++ b/plugins/Alarms/src/alarmlist.h @@ -20,7 +20,7 @@ static bool operator<(const ALARM &a1, const ALARM &a2) { class AlarmList {
public:
- AlarmList(): head(0), tail(0), count(0) {}
+ AlarmList(): head(nullptr), tail(nullptr), count(0) {}
virtual ~AlarmList() {clear();}
@@ -50,7 +50,7 @@ public: delete current;
}
count = 0;
- tail = 0;
+ tail = nullptr;
reset();
}
@@ -67,7 +67,7 @@ public: }
void reset() {it_current = head;}
- ALARM *current() {return (it_current ? &it_current->alarm : 0);}
+ ALARM *current() {return (it_current ? &it_current->alarm : nullptr);}
void next() {it_current = it_current->next;}
void erase() {
if (it_current) {
@@ -101,7 +101,7 @@ public: protected:
class Node {
public:
- Node(): next(0), prev(0) {}
+ Node(): next(nullptr), prev(nullptr) {}
ALARM alarm;
Node *next, *prev;
};
diff --git a/plugins/AvatarHistory/src/popup.h b/plugins/AvatarHistory/src/popup.h index bc12bfc544..4ae896d0c7 100644 --- a/plugins/AvatarHistory/src/popup.h +++ b/plugins/AvatarHistory/src/popup.h @@ -61,7 +61,7 @@ void ShowDebugPopup(MCONTACT hContact, const wchar_t *title, const wchar_t *desc void ShowTestPopup(MCONTACT hContact,const wchar_t *title, const wchar_t *description, const Options *op);
// Show an error popup
-void ShowErrPopup(const char *description, const char *title = NULL);
+void ShowErrPopup(const char *description, const char *title = nullptr);
void ShowPopupEx(MCONTACT hContact, const wchar_t *title, const wchar_t *description,
void *plugin_data, int type, const Options *op);
diff --git a/plugins/BasicHistory/src/ExportManager.h b/plugins/BasicHistory/src/ExportManager.h index 73cd4ca1b7..212f76f2ea 100644 --- a/plugins/BasicHistory/src/ExportManager.h +++ b/plugins/BasicHistory/src/ExportManager.h @@ -54,7 +54,7 @@ public: void SetDeleteWithoutExportEvents(int deltaTime, DWORD now);
void DeleteExportedEvents();
int Import(IImport::ImportType type, const std::vector<MCONTACT> &contacts);
- bool Import(IImport::ImportType type, std::vector<IImport::ExternalMessage> &eventList, std::wstring *err = NULL, bool *differentContact = NULL, std::vector<MCONTACT> *contacts = NULL);
+ bool Import(IImport::ImportType type, std::vector<IImport::ExternalMessage> &eventList, std::wstring *err = nullptr, bool *differentContact = nullptr, std::vector<MCONTACT> *contacts = nullptr);
static const wchar_t* GetExt(IImport::ImportType type);
};
diff --git a/plugins/BasicHistory/src/ImageDataObject.h b/plugins/BasicHistory/src/ImageDataObject.h index 4909219683..2e0ef3dd3f 100644 --- a/plugins/BasicHistory/src/ImageDataObject.h +++ b/plugins/BasicHistory/src/ImageDataObject.h @@ -81,12 +81,12 @@ public: STDMETHOD(GetData)(FORMATETC*, STGMEDIUM *pmedium) {
HANDLE hDst;
hDst = ::OleDuplicateData(m_stgmed.hBitmap, CF_BITMAP, 0);
- if (hDst == NULL)
+ if (hDst == nullptr)
return E_HANDLE;
pmedium->tymed = TYMED_GDI;
pmedium->hBitmap = (HBITMAP)hDst;
- pmedium->pUnkForRelease = NULL;
+ pmedium->pUnkForRelease = nullptr;
return S_OK;
}
diff --git a/plugins/BasicHistory/src/Options.h b/plugins/BasicHistory/src/Options.h index 097eec73f7..acb27417f2 100644 --- a/plugins/BasicHistory/src/Options.h +++ b/plugins/BasicHistory/src/Options.h @@ -115,7 +115,7 @@ struct TaskOptions deltaTime = 24;
orderNr = 0;
wchar_t buf[MAX_PATH];
- if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, buf)))
+ if (SUCCEEDED(SHGetFolderPath(nullptr, CSIDL_PERSONAL, nullptr, SHGFP_TYPE_CURRENT, buf)))
{
filePath = buf;
filePath += L"\\";
@@ -123,7 +123,7 @@ struct TaskOptions filePath += TranslateT("History");
filePath += L"_<contact>_<date>.<ext>";
- lastExport = time(NULL);
+ lastExport = time(nullptr);
}
};
diff --git a/plugins/BasicHistory/src/codecvt_CodePage.h b/plugins/BasicHistory/src/codecvt_CodePage.h index 007af11434..1a6b7f3db1 100644 --- a/plugins/BasicHistory/src/codecvt_CodePage.h +++ b/plugins/BasicHistory/src/codecvt_CodePage.h @@ -52,7 +52,7 @@ protected: _Mid1 = _First1;
_Mid2 = _First2;
- int conv = WideCharToMultiByte(codePage, 0, _First1, _Last1 - _First1, _First2, _Last2 - _First2, NULL, NULL);
+ int conv = WideCharToMultiByte(codePage, 0, _First1, _Last1 - _First1, _First2, _Last2 - _First2, nullptr, nullptr);
if (conv == 0)
{
if (GetLastError() == ERROR_INSUFFICIENT_BUFFER)
diff --git a/plugins/Boltun/src/Engine/PerContactData.h b/plugins/Boltun/src/Engine/PerContactData.h index 71dcec126d..f573423bd3 100644 --- a/plugins/Boltun/src/Engine/PerContactData.h +++ b/plugins/Boltun/src/Engine/PerContactData.h @@ -40,7 +40,7 @@ class PerContactData }
inline InternalData()
- : data(NULL)
+ : data(nullptr)
{
assert(false);
}
@@ -78,7 +78,7 @@ PerContactData<Source, Data, ContactHandle>::~PerContactData() mir_cslock mlck(mapLock);
if (timerID)
{
- KillTimer(NULL, timerID);
+ KillTimer(nullptr, timerID);
perContactDataObjects.erase(timerID);
}
while (!datas.empty())
@@ -106,7 +106,7 @@ void PerContactData<Source, Data, ContactHandle>::PutData(ContactHandle Contact) ::time(&(datas[Contact]->time));
if (!timerID)
{
- timerID = SetTimer(NULL, 0, 30000, RunTimerProc<Source, Data, ContactHandle>);
+ timerID = SetTimer(nullptr, 0, 30000, RunTimerProc<Source, Data, ContactHandle>);
assert(timerID);
perContactDataObjects[timerID] = this;
}
@@ -138,7 +138,7 @@ void PerContactData<Source, Data, ContactHandle>::CleanupData() }
if (timerID && datas.empty()) //timerID may become NULL before locking, so should check
{
- KillTimer(NULL, timerID);
+ KillTimer(nullptr, timerID);
perContactDataObjects.erase(timerID);
}
}
diff --git a/plugins/Boltun/src/Engine/ValueChooser.h b/plugins/Boltun/src/Engine/ValueChooser.h index acd63dfd8f..e442f14530 100644 --- a/plugins/Boltun/src/Engine/ValueChooser.h +++ b/plugins/Boltun/src/Engine/ValueChooser.h @@ -37,7 +37,7 @@ public: :data(vec), notifyOnReset(NotifyOnReset)
{
//randomize();
- numbers = NULL;
+ numbers = nullptr;
UpdateLength();
}
diff --git a/plugins/Boltun/src/config.h b/plugins/Boltun/src/config.h index 46fea99ffa..eeb697d4b0 100644 --- a/plugins/Boltun/src/config.h +++ b/plugins/Boltun/src/config.h @@ -84,7 +84,7 @@ private: public:
PtrProperty(Getter g, Setter s)
- :getter(g), setter(s), cacheValid(false), cached(NULL)
+ :getter(g), setter(s), cacheValid(false), cached(nullptr)
{
}
diff --git a/plugins/CSList/src/stdafx.h b/plugins/CSList/src/stdafx.h index c6277a2111..f0ae5f985d 100644 --- a/plugins/CSList/src/stdafx.h +++ b/plugins/CSList/src/stdafx.h @@ -161,8 +161,8 @@ template< class T > struct ListItem ListItem()
{
- m_item = NULL;
- m_next = NULL;
+ m_item = nullptr;
+ m_next = nullptr;
}
~ListItem()
@@ -173,13 +173,13 @@ template< class T > struct ListItem ListItem(StatusItem* si)
{
m_item = si;
- m_next = NULL;
+ m_next = nullptr;
}
ListItem(const ListItem& p)
{
m_item = p.item;
- m_next = NULL;
+ m_next = nullptr;
}
};
@@ -196,7 +196,7 @@ public: List(compareFunc compFnc)
{
- m_items = NULL;
+ m_items = nullptr;
m_count = 0;
m_compare = compFnc;
}
@@ -220,13 +220,13 @@ public: {
int position = 0;
ListItem< T >* item = new ListItem< T >(csi);
- if (m_items == NULL)
+ if (m_items == nullptr)
m_items = item;
else
{
ListItem< T >* help = item;
item->m_next = m_items;
- while (help->m_next != NULL)
+ while (help->m_next != nullptr)
{
int cmp = m_compare(item->m_item, help->m_next->m_item);
if (cmp == 1)
diff --git a/plugins/Clist_nicer/src/rowheight_funcs.h b/plugins/Clist_nicer/src/rowheight_funcs.h index aa49af8a10..11e5d5b391 100644 --- a/plugins/Clist_nicer/src/rowheight_funcs.h +++ b/plugins/Clist_nicer/src/rowheight_funcs.h @@ -30,7 +30,7 @@ public: }
// Avatar size
- if (contact->cFlags & ECF_AVATAR && contact->type == CLCIT_CONTACT && contact->ace != NULL && !(contact->ace->dwFlags & AVS_HIDEONCLIST))
+ if (contact->cFlags & ECF_AVATAR && contact->type == CLCIT_CONTACT && contact->ace != nullptr && !(contact->ace->dwFlags & AVS_HIDEONCLIST))
height = max(height, cfg::dat.avatarSize + cfg::dat.avatarPadding);
}
diff --git a/plugins/ContactsPlus/src/receive.h b/plugins/ContactsPlus/src/receive.h index 286f91ca13..967ae7c12b 100644 --- a/plugins/ContactsPlus/src/receive.h +++ b/plugins/ContactsPlus/src/receive.h @@ -38,7 +38,7 @@ struct TReceivedItem { wchar_t* mcaUIN;
wchar_t* mcaNick;
~TReceivedItem() { mir_free(mcaUIN); mir_free(mcaNick); }
- TReceivedItem() { mcaUIN = NULL; mcaNick = NULL; }
+ TReceivedItem() { mcaUIN = nullptr; mcaNick = nullptr; }
};
struct TRecvContactsData
diff --git a/plugins/ContactsPlus/src/send.h b/plugins/ContactsPlus/src/send.h index 1cd9f2ec04..3a63934ec0 100644 --- a/plugins/ContactsPlus/src/send.h +++ b/plugins/ContactsPlus/src/send.h @@ -73,7 +73,7 @@ struct TAckData MCONTACT hContact; // to whom was it sent
MCONTACT* aContacts; // obj
int nContacts; // how many
- TAckData(MCONTACT contact) { hContact = contact; aContacts = NULL; nContacts = 0;};
+ TAckData(MCONTACT contact) { hContact = contact; aContacts = nullptr; nContacts = 0;};
~TAckData() { mir_free(aContacts); }
};
@@ -94,10 +94,10 @@ struct gAckItem { // some shit here struct gAckList {
gAckItem** Items;
int Count;
- TAckData* Get(HANDLE hProcc) { for (int i=0; i<Count; i++) if (Items[i]->hProcc==hProcc) { return Items[i]->ackData; }; return NULL; };
+ TAckData* Get(HANDLE hProcc) { for (int i=0; i<Count; i++) if (Items[i]->hProcc==hProcc) { return Items[i]->ackData; }; return nullptr; };
TAckData* Add(HANDLE hProcc, TAckData* ackData) { Items=(gAckItem**)mir_realloc(Items, (Count+1)*sizeof(gAckItem*)); Items[Count]=new gAckItem(hProcc, ackData); Count++; return ackData; };
- TAckData* Remove(HANDLE hProcc) { for (int i=0; i<Count; i++) if (Items[i]->hProcc==hProcc) { TAckData* data=Items[i]->ackData; delete Items[i]; memmove(Items+i, Items+i+1, (Count-i-1)*sizeof(gAckItem*)); Count--; return data; }; return NULL; };
- gAckList() { Count = 0; Items = NULL; }
+ TAckData* Remove(HANDLE hProcc) { for (int i=0; i<Count; i++) if (Items[i]->hProcc==hProcc) { TAckData* data=Items[i]->ackData; delete Items[i]; memmove(Items+i, Items+i+1, (Count-i-1)*sizeof(gAckItem*)); Count--; return data; }; return nullptr; };
+ gAckList() { Count = 0; Items = nullptr; }
~gAckList() { if (Count) { for (int i=0; i<Count; i++) delete Items[i]; mir_free(Items); }; }
};
diff --git a/plugins/Dbx_mdbx/src/ui.cpp b/plugins/Dbx_mdbx/src/ui.cpp index 767bc03562..c70823a7fb 100644 --- a/plugins/Dbx_mdbx/src/ui.cpp +++ b/plugins/Dbx_mdbx/src/ui.cpp @@ -146,7 +146,7 @@ static INT_PTR ChangePassword(void* obj, WPARAM, LPARAM) {
CDbxMDBX *db = (CDbxMDBX*)obj;
DlgChangePassParam param = { db };
- DialogBoxParam(g_hInst, MAKEINTRESOURCE(db->usesPassword() ? IDD_CHANGEPASS : IDD_NEWPASS), 0, sttChangePassword, (LPARAM)¶m);
+ DialogBoxParam(g_hInst, MAKEINTRESOURCE(db->usesPassword() ? IDD_CHANGEPASS : IDD_NEWPASS), nullptr, sttChangePassword, (LPARAM)¶m);
return 0;
}
diff --git a/plugins/ExternalAPI/m_account.h b/plugins/ExternalAPI/m_account.h index edffef8d91..c6a342fd3d 100644 --- a/plugins/ExternalAPI/m_account.h +++ b/plugins/ExternalAPI/m_account.h @@ -44,7 +44,7 @@ enum typedef struct CNotification
{
//#define YAMN_NOTIFICATIONVERSION is not implemented, use YAMN_ACCOUNTVERSION instead
- CNotification(): PopupB(0), PopupT(0), PopupTime(0), App(NULL), AppParam(NULL), Sound(NULL), TrayIcon1(NULL), TrayIcon2(NULL) {}
+ CNotification(): PopupB(0), PopupT(0), PopupTime(0), App(nullptr), AppParam(nullptr), Sound(nullptr), TrayIcon1(nullptr), TrayIcon2(nullptr) {}
#define YAMN_ACC_SND 0x00000001 //Plays sound (1)
#define YAMN_ACC_MSG 0x00000002 //Shows dialog
@@ -75,7 +75,7 @@ typedef struct CNotification typedef struct CServer
{
- CServer(): Name(NULL),Login(NULL),Passwd(NULL) {}
+ CServer(): Name(nullptr), Login(nullptr), Passwd(nullptr) {}
char *Name;
DWORD Port;
diff --git a/plugins/ExternalAPI/m_assocmgr.h b/plugins/ExternalAPI/m_assocmgr.h index 64331c368b..eabe570455 100644 --- a/plugins/ExternalAPI/m_assocmgr.h +++ b/plugins/ExternalAPI/m_assocmgr.h @@ -258,7 +258,7 @@ static __inline char *Netlib_UrlDecode(char *str) if (!psz[1] || !psz[2]) break;
MoveMemory(psz,&psz[1],2);
psz[2]=0;
- *psz=(char)strtol(psz,NULL,16);
+ *psz=(char)strtol(psz, nullptr,16);
MoveMemory(&psz[1],&psz[3],mir_strlen(&psz[3])+1);
break;
}
diff --git a/plugins/ExternalAPI/m_flags.h b/plugins/ExternalAPI/m_flags.h index c3b9a2a5d6..663e61ccbd 100644 --- a/plugins/ExternalAPI/m_flags.h +++ b/plugins/ExternalAPI/m_flags.h @@ -28,17 +28,17 @@ To retrieve the country number from a locale, call GetLocaleInfo(). with LOCALE_ICOUNTRY.
wParam=countryNumber
lParam=(BOOL)fReturnHandle (nonzero to to retrieve the icolib handle instead of the icon)
-Returns a icon handle (HICON) on success, NULL on error.
+Returns a icon handle (HICON) on success, nullptr on error.
*/
#define MS_FLAGS_LOADFLAGICON "Flags/LoadFlagIcon"
#if !defined(FLAGS_NOHELPERFUNCTIONS)
__inline static HICON LoadFlagIcon(int countryNumber) {
- if (!ServiceExists(MS_FLAGS_LOADFLAGICON)) return NULL;
+ if (!ServiceExists(MS_FLAGS_LOADFLAGICON)) return nullptr;
return (HICON)CallService(MS_FLAGS_LOADFLAGICON,countryNumber,0);
}
__inline static HANDLE LoadFlagIconHandle(int countryNumber) {
- if (!ServiceExists(MS_FLAGS_LOADFLAGICON)) return NULL;
+ if (!ServiceExists(MS_FLAGS_LOADFLAGICON)) return nullptr;
return (HICON)CallService(MS_FLAGS_LOADFLAGICON,countryNumber,1);
}
#endif
diff --git a/plugins/ExternalAPI/m_folders.h b/plugins/ExternalAPI/m_folders.h index 85173bf7dd..c6b26f0d26 100644 --- a/plugins/ExternalAPI/m_folders.h +++ b/plugins/ExternalAPI/m_folders.h @@ -141,7 +141,9 @@ typedef struct{ __inline static HANDLE FoldersRegisterCustomPath(const char *section, const char *name, const char *defaultPath)
{
- if (!ServiceExists(MS_FOLDERS_REGISTER_PATH)) return 0;
+ if (!ServiceExists(MS_FOLDERS_REGISTER_PATH))
+ return nullptr;
+
FOLDERSDATA fd = { sizeof(fd) };
fd.szSection = section;
fd.szName = name;
@@ -150,9 +152,11 @@ __inline static HANDLE FoldersRegisterCustomPath(const char *section, const char }
#ifdef _UNICODE
-__inline static HANDLE FoldersRegisterCustomPathW(const char *section, const char *name, const wchar_t *defaultPathW, const wchar_t *userNameW = NULL)
+__inline static HANDLE FoldersRegisterCustomPathW(const char *section, const char *name, const wchar_t *defaultPathW, const wchar_t *userNameW = nullptr)
{
- if (!ServiceExists(MS_FOLDERS_REGISTER_PATH)) return 0;
+ if (!ServiceExists(MS_FOLDERS_REGISTER_PATH))
+ return nullptr;
+
FOLDERSDATA fd = { sizeof(fd) };
fd.szSection = section;
fd.szName = name;
diff --git a/plugins/ExternalAPI/m_mails.h b/plugins/ExternalAPI/m_mails.h index d597769b88..e5ef0cc692 100644 --- a/plugins/ExternalAPI/m_mails.h +++ b/plugins/ExternalAPI/m_mails.h @@ -68,7 +68,7 @@ struct CMimeItem char *name;
char *value;
struct CMimeItem *Next;
- CMimeItem(): name(NULL), value(NULL), Next(NULL){}
+ CMimeItem(): name(nullptr), value(nullptr), Next(nullptr){}
};
typedef struct CMailData //this is plugin-independent
@@ -82,7 +82,7 @@ typedef struct CMailData //this is plugin-independent struct CMimeItem *Additional; //MIME items not read from server (custom, for filter plugins etc.)
char *Body; //Message body
- CMailData(): CP(-1), Size(0), TranslatedHeader(NULL), Body(NULL){}
+ CMailData(): CP(-1), Size(0), TranslatedHeader(nullptr), Body(nullptr) {}
} MAILDATA,*PMAILDATA;
typedef struct CMimeMsgQueue
@@ -146,12 +146,12 @@ typedef struct CMimeMsgQueue //plugins can store here its own data
void *PluginData;
- CMimeMsgQueue(): ID(NULL), Number(0), Flags(0), MailData(NULL), MsgWindow(NULL), PluginData(NULL), Next(NULL){}
+ CMimeMsgQueue(): ID(nullptr), Number(0), Flags(0), MailData(nullptr), MsgWindow(nullptr), PluginData(nullptr), Next(nullptr){}
~CMimeMsgQueue() {}
struct CMimeMsgQueue *Next;
} YAMNMAIL,*HYAMNMAIL;
-#define LoadedMailData(x) (x->MailData!=NULL)
+#define LoadedMailData(x) (x->MailData!=nullptr)
//
//================================== YAMN MAIL SERVICES ==================================
diff --git a/plugins/ExternalAPI/m_notify.h b/plugins/ExternalAPI/m_notify.h index 27d92f842e..e286cd4c13 100644 --- a/plugins/ExternalAPI/m_notify.h +++ b/plugins/ExternalAPI/m_notify.h @@ -86,7 +86,7 @@ typedef struct tagMNNOTIFYLINK static void __inline MNotifyGetLink()
{
- notifyLink = ServiceExists(MS_NOTIFY_GETLINK) ? (MNOTIFYLINK *)CallService(MS_NOTIFY_GETLINK,0,0) : 0;
+ notifyLink = ServiceExists(MS_NOTIFY_GETLINK) ? (MNOTIFYLINK *)CallService(MS_NOTIFY_GETLINK,0,0) : nullptr;
}
// get helpers
diff --git a/plugins/ExternalAPI/m_skin_eng.h b/plugins/ExternalAPI/m_skin_eng.h index 8c70226143..af1f8fe347 100644 --- a/plugins/ExternalAPI/m_skin_eng.h +++ b/plugins/ExternalAPI/m_skin_eng.h @@ -334,7 +334,7 @@ int __inline SkinEngInvalidateImageFrame(HWND hwnd, CONST RECT * rcUpdate, DWORD int __inline SkinInvalidateFrame(HWND hWnd, CONST RECT* lpRect)
{
- return SkinEngInvalidateImageFrame(hWnd, lpRect, 0, 0);
+ return SkinEngInvalidateImageFrame(hWnd, lpRect, 0, nullptr);
}
// Alpha channel GDI replacements/helpers
diff --git a/plugins/ExternalAPI/m_statusplugins.h b/plugins/ExternalAPI/m_statusplugins.h index 85e2ab1b84..b47a5fd572 100644 --- a/plugins/ExternalAPI/m_statusplugins.h +++ b/plugins/ExternalAPI/m_statusplugins.h @@ -104,7 +104,7 @@ typedef struct { __inline static int announce_status_change(char *szProto, int newstatus, TCHAR *szMsg) {
PROTOCOLSETTINGEX ps = { 0 };
- ps.m_lastStatus = szProto != NULL ? CallProtoService(szProto, PS_GETSTATUS, 0, 0) : CallService(MS_CLIST_GETSTATUSMODE, 0, 0);
+ ps.m_lastStatus = szProto != nullptr ? CallProtoService(szProto, PS_GETSTATUS, 0, 0) : CallService(MS_CLIST_GETSTATUSMODE, 0, 0);
ps.m_status = newstatus;
ps.m_szMsg = szMsg;
ps.m_szName = szProto;
diff --git a/plugins/ExternalAPI/m_synchro.h b/plugins/ExternalAPI/m_synchro.h index 429c791ca4..33d605bf50 100644 --- a/plugins/ExternalAPI/m_synchro.h +++ b/plugins/ExternalAPI/m_synchro.h @@ -26,7 +26,7 @@ typedef struct SynchronisedCounter SynchronisedCounter(): Number(0)
{
InitializeCriticalSection(&CounterCS);
- Event=CreateEvent(NULL,FALSE,TRUE,NULL);
+ Event = CreateEvent(nullptr, FALSE, TRUE, nullptr);
SetEvent(Event);
}
diff --git a/plugins/ExternalAPI/m_text.h b/plugins/ExternalAPI/m_text.h index 315f6c950c..b098e2dce8 100644 --- a/plugins/ExternalAPI/m_text.h +++ b/plugins/ExternalAPI/m_text.h @@ -104,7 +104,7 @@ typedef struct tagMTEXTCREATE #ifdef __cplusplus
tagMTEXTCREATE():
- text(0), hContact(0), flags(0)
+ text(nullptr), hContact(0), flags(0)
{
cbSize = sizeof(*this);
}
@@ -122,7 +122,7 @@ typedef struct tagMTEXTDISPLAY #ifdef __cplusplus
tagMTEXTDISPLAY():
- dc(0), text(0)
+ dc(nullptr), text(nullptr)
{
cbSize = sizeof(*this);
pos.x = pos.y = 0;
@@ -140,7 +140,7 @@ typedef struct tagMTEXTSETPARENT #ifdef __cplusplus
tagMTEXTSETPARENT():
- hwnd(0), text(0)
+ hwnd(nullptr), text(nullptr)
{
}
#endif
@@ -157,7 +157,7 @@ typedef struct tagMTEXTMESSAGE #ifdef __cplusplus
tagMTEXTMESSAGE():
- hwnd(0), text(0), msg(0), wParam(0), lParam(0)
+ hwnd(nullptr), text(nullptr), msg(0), wParam(0), lParam(0)
{
}
#endif
diff --git a/plugins/ExternalAPI/m_variables.h b/plugins/ExternalAPI/m_variables.h index daadc28c60..6277c84a2e 100644 --- a/plugins/ExternalAPI/m_variables.h +++ b/plugins/ExternalAPI/m_variables.h @@ -507,18 +507,16 @@ __inline static int variables_showhelp(HWND hwndDlg, UINT uIDEdit, int flags, ch #ifndef VARIABLES_NOHELPER
__inline static int variables_skin_helpbutton(HWND hwndDlg, UINT uIDButton) {
- int res;
- HICON hIcon;
TCHAR tszClass[32];
- hIcon = NULL;
- res = 0;
+ HICON hIcon = nullptr;
+ int res = 0;
if (ServiceExists(MS_VARS_GETSKINITEM))
hIcon = (HICON)CallService(MS_VARS_GETSKINITEM, 0, (LPARAM)VSI_HELPICON);
GetClassName(GetDlgItem(hwndDlg, uIDButton), tszClass, _countof(tszClass));
if (!mir_wstrcmp(tszClass, L"Button")) {
- if (hIcon != NULL) {
+ if (hIcon != nullptr) {
SetWindowLongPtr(GetDlgItem(hwndDlg, uIDButton), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, uIDButton), GWL_STYLE)|BS_ICON);
SendMessage(GetDlgItem(hwndDlg, uIDButton), BM_SETIMAGE, (WPARAM)IMAGE_ICON, (LPARAM)hIcon);
}
@@ -528,14 +526,14 @@ __inline static int variables_skin_helpbutton(HWND hwndDlg, UINT uIDButton) { }
}
else if (!mir_wstrcmp(tszClass, MIRANDABUTTONCLASS)) {
- if (hIcon != NULL) {
- char *szTipInfo = NULL;
+ if (hIcon != nullptr) {
+ char *szTipInfo = nullptr;
SendMessage(GetDlgItem(hwndDlg, uIDButton), BM_SETIMAGE, (WPARAM)IMAGE_ICON, (LPARAM)hIcon);
if (ServiceExists(MS_VARS_GETSKINITEM))
szTipInfo = (char *)CallService(MS_VARS_GETSKINITEM, 0, (LPARAM)VSI_HELPTIPTEXT);
- if (szTipInfo == NULL)
+ if (szTipInfo == nullptr)
szTipInfo = Translate("Open String Formatting Help");
SendMessage(GetDlgItem(hwndDlg, uIDButton), BUTTONADDTOOLTIP, (WPARAM)szTipInfo, 0);
diff --git a/plugins/FTPFileYM/src/deletetimer.h b/plugins/FTPFileYM/src/deletetimer.h index 59159aa3da..1daec28b3b 100644 --- a/plugins/FTPFileYM/src/deletetimer.h +++ b/plugins/FTPFileYM/src/deletetimer.h @@ -28,7 +28,7 @@ private: UINT timerId;
DeleteTimer() { };
- ~DeleteTimer() { instance = NULL; };
+ ~DeleteTimer() { instance = nullptr; };
static void CALLBACK AutoDeleteTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime);
diff --git a/plugins/FTPFileYM/src/job_generic.h b/plugins/FTPFileYM/src/job_generic.h index ffc370958d..b81c6e5f5e 100644 --- a/plugins/FTPFileYM/src/job_generic.h +++ b/plugins/FTPFileYM/src/job_generic.h @@ -28,7 +28,7 @@ private: HANDLE handle;
public:
- Event() { handle = CreateEvent (0, FALSE, FALSE, 0); }
+ Event() { handle = CreateEvent(nullptr, FALSE, FALSE, nullptr); }
~Event() { CloseHandle (handle); }
operator HANDLE () { return handle; }
diff --git a/plugins/FTPFileYM/src/manager.h b/plugins/FTPFileYM/src/manager.h index 52983d6f5a..6eb3a541a9 100644 --- a/plugins/FTPFileYM/src/manager.h +++ b/plugins/FTPFileYM/src/manager.h @@ -70,7 +70,7 @@ public: ~Manager();
- void AddRoot(HTREEITEM h) { m_rootItems.push_back(new TreeItem(h,NULL,0)); }
+ void AddRoot(HTREEITEM h) { m_rootItems.push_back(new TreeItem(h, nullptr, 0)); }
void AddLeaf(HTREEITEM h, HTREEITEM p, int id) { m_items.push_back(new TreeItem(h,p,id)); }
static Manager *getInstance()
diff --git a/plugins/FTPFileYM/src/options.h b/plugins/FTPFileYM/src/options.h index 802f3c1e3c..e4bd98fbc8 100644 --- a/plugins/FTPFileYM/src/options.h +++ b/plugins/FTPFileYM/src/options.h @@ -27,7 +27,7 @@ private: static Options *instance;
Options() { };
- ~Options() { instance = NULL; };
+ ~Options() { instance = nullptr; };
public:
enum ETimeRange
diff --git a/plugins/FTPFileYM/src/serverlist.h b/plugins/FTPFileYM/src/serverlist.h index 05b2e66724..0b41d0b4e7 100644 --- a/plugins/FTPFileYM/src/serverlist.h +++ b/plugins/FTPFileYM/src/serverlist.h @@ -25,7 +25,7 @@ class ServerList private:
static ServerList *instance;
ServerList() { };
- ~ServerList() { instance = NULL; };
+ ~ServerList() { instance = nullptr; };
public:
class FTP
diff --git a/plugins/FavContacts/src/favlist.h b/plugins/FavContacts/src/favlist.h index c9ed5bc2c3..394c7fb747 100644 --- a/plugins/FavContacts/src/favlist.h +++ b/plugins/FavContacts/src/favlist.h @@ -20,7 +20,7 @@ public: name = mir_wstrdup(pcli->pfnGetContactDisplayName(hContact, 0));
if (g_Options.bUseGroups) {
- if ((group = db_get_wsa(hContact, "CList", "Group")) == NULL)
+ if ((group = db_get_wsa(hContact, "CList", "Group")) == nullptr)
group = mir_wstrdup(TranslateT("<no group>"));
}
else group = mir_wstrdup(TranslateT("Favorite Contacts"));
@@ -72,7 +72,7 @@ private: int addContact(MCONTACT hContact, bool bManual)
{
DBCachedContact *cc = db->m_cache->GetCachedContact(hContact);
- if (cc == NULL)
+ if (cc == nullptr)
return 0;
if (db_mc_isEnabled()) {
@@ -107,7 +107,7 @@ public: void build()
{
- prevGroup = NULL;
+ prevGroup = nullptr;
nGroups = 1;
diff --git a/plugins/FavContacts/src/stdafx.h b/plugins/FavContacts/src/stdafx.h index c0a65e1908..b66f0242b4 100644 --- a/plugins/FavContacts/src/stdafx.h +++ b/plugins/FavContacts/src/stdafx.h @@ -84,8 +84,8 @@ extern CContactCache *g_contactCache; #include "favlist.h"
-BOOL MenuDrawItem(LPDRAWITEMSTRUCT lpdis, Options *options = NULL);
-BOOL MenuMeasureItem(LPMEASUREITEMSTRUCT lpmis, Options *options = NULL);
+BOOL MenuDrawItem(LPDRAWITEMSTRUCT lpdis, Options *options = nullptr);
+BOOL MenuMeasureItem(LPMEASUREITEMSTRUCT lpmis, Options *options = nullptr);
int ProcessOptInitialise(WPARAM, LPARAM);
int ProcessModulesLoaded(WPARAM, LPARAM);
diff --git a/plugins/FileAsMessage/src/dialog.cpp b/plugins/FileAsMessage/src/dialog.cpp index e935b2204e..5011cb57f8 100644 --- a/plugins/FileAsMessage/src/dialog.cpp +++ b/plugins/FileAsMessage/src/dialog.cpp @@ -124,7 +124,7 @@ int getMsgId(char *msg) int RetrieveFileSize(wchar_t *filename)
{
FILE *hFile = _wfopen(filename, L"rb");
- if (hFile != NULL) {
+ if (hFile != nullptr) {
fseek(hFile, 0, SEEK_END);
int size = ftell(hFile);
fclose(hFile);
diff --git a/plugins/FloatingContacts/src/bitmap_funcs.h b/plugins/FloatingContacts/src/bitmap_funcs.h index 46b749289b..690578dabf 100644 --- a/plugins/FloatingContacts/src/bitmap_funcs.h +++ b/plugins/FloatingContacts/src/bitmap_funcs.h @@ -43,18 +43,18 @@ private: bool loadFromFile_pixel(const char *fn);
bool loadFromFile_gradient(const char *fn);
- bool loadFromFile_png(const char *fn, const char *fnAlpha = 0);
- bool loadFromFile_default(const char *fn, const char *fnAlpha = 0);
+ bool loadFromFile_png(const char *fn, const char *fnAlpha = nullptr);
+ bool loadFromFile_default(const char *fn, const char *fnAlpha = nullptr);
void premultipleChannels();
public:
MyBitmap();
MyBitmap(int w, int h);
- MyBitmap(const char *fn, const char *fnAlpha = 0);
+ MyBitmap(const char *fn, const char *fnAlpha = nullptr);
~MyBitmap();
void allocate(int w, int h);
- bool loadFromFile(const char *fn, const char *fnAlpha = 0);
+ bool loadFromFile(const char *fn, const char *fnAlpha = nullptr);
int getWidth() { return width; }
int getHeight() { return height; }
diff --git a/plugins/HTTPServer/src/FileShareNode.h b/plugins/HTTPServer/src/FileShareNode.h index 7c40bcced1..032bc34510 100644 --- a/plugins/HTTPServer/src/FileShareNode.h +++ b/plugins/HTTPServer/src/FileShareNode.h @@ -61,7 +61,7 @@ public://, DWORD dwAllowedIP, DWORD dwAllowedMask, int nMaxDownloads ); bool bAddUser(CLShareUser * pclUser);
bool bRemoveUser(CLShareUser * pclUser);
bool bAnyUsers() {
- return pclCurrentUsers != 0;
+ return pclCurrentUsers != nullptr;
}
void CloseAllTransfers();
CLShareUser *pclGetUsers() {
diff --git a/plugins/HTTPServer/src/HttpUser.h b/plugins/HTTPServer/src/HttpUser.h index a5a7b2d24c..f44c9a8e71 100644 --- a/plugins/HTTPServer/src/HttpUser.h +++ b/plugins/HTTPServer/src/HttpUser.h @@ -63,8 +63,8 @@ private: HANDLE hFile;
char *apszParam[eLastParam];
- void SendError(int iErrorCode, const char * pszError, const char * pszDescription = NULL);
- void SendRedir(int iErrorCode, const char * pszError, const char * pszDescription = NULL, const char * pszRedirect = NULL);
+ void SendError(int iErrorCode, const char * pszError, const char * pszDescription = nullptr);
+ void SendRedir(int iErrorCode, const char * pszError, const char * pszDescription = nullptr, const char * pszRedirect = nullptr);
};
#endif
\ No newline at end of file diff --git a/plugins/HistoryStats/src/bandctrl.h b/plugins/HistoryStats/src/bandctrl.h index 4917545c87..a94544b358 100644 --- a/plugins/HistoryStats/src/bandctrl.h +++ b/plugins/HistoryStats/src/bandctrl.h @@ -16,7 +16,7 @@ private: HWND m_hBandWnd;
public:
- explicit BandCtrl(HWND hBandWnd = NULL) : m_hBandWnd(hBandWnd) { }
+ explicit BandCtrl(HWND hBandWnd = nullptr) : m_hBandWnd(hBandWnd) { }
~BandCtrl() { }
public:
@@ -25,7 +25,7 @@ public: public:
void setLayout(int nLayout);
- HANDLE addButton(DWORD dwFlags, HICON hIcon, INT_PTR dwData, const wchar_t* szTooltip = NULL, const wchar_t* szText = NULL);
+ HANDLE addButton(DWORD dwFlags, HICON hIcon, INT_PTR dwData, const wchar_t* szTooltip = nullptr, const wchar_t* szText = nullptr);
bool isButtonChecked(HANDLE hButton);
void checkButton(HANDLE hButton, bool bCheck);
DWORD getButtonData(HANDLE hButton);
diff --git a/plugins/HistoryStats/src/column.h b/plugins/HistoryStats/src/column.h index acd99f933e..6586beacb5 100644 --- a/plugins/HistoryStats/src/column.h +++ b/plugins/HistoryStats/src/column.h @@ -139,7 +139,7 @@ public: Column()
: m_bEnabled(true), m_CustomTitle(L""),
m_nContactDataSlot(-1), m_nContactDataTransformSlot(-1),
- m_pStatistic(NULL), m_pSettings(NULL), m_pCharMapper(NULL),
+ m_pStatistic(nullptr), m_pSettings(nullptr), m_pCharMapper(nullptr),
m_bUsePNG(false)
{
}
diff --git a/plugins/HistoryStats/src/message.h b/plugins/HistoryStats/src/message.h index 686ee103ee..39e8af549e 100644 --- a/plugins/HistoryStats/src/message.h +++ b/plugins/HistoryStats/src/message.h @@ -43,7 +43,7 @@ private: public:
explicit Message(bool bStripRawRTF, bool bStripBBCodes)
- : m_RawSource(NULL), m_Available(0),
+ : m_RawSource(nullptr), m_Available(0),
m_bStripRawRTF(bStripRawRTF), m_bStripBBCodes(bStripBBCodes),
m_bOutgoing(false), m_Timestamp(0), m_nLength(0)
{
diff --git a/plugins/HistoryStats/src/mu_common.h b/plugins/HistoryStats/src/mu_common.h index 11905e187d..875fbfa01d 100644 --- a/plugins/HistoryStats/src/mu_common.h +++ b/plugins/HistoryStats/src/mu_common.h @@ -13,7 +13,7 @@ namespace mu namespace clist
{
- HGENMENU addMainMenuItem(const wchar_t* pszName, DWORD flags, int position, HICON hIcon, const char* pszService, HGENMENU hRoot = 0);
+ HGENMENU addMainMenuItem(const wchar_t* pszName, DWORD flags, int position, HICON hIcon, const char* pszService, HGENMENU hRoot = nullptr);
HGENMENU addContactMenuItem(const wchar_t* pszName, DWORD flags, int position, HICON hIcon, const char* pszService);
}
diff --git a/plugins/HistoryStats/src/optionsctrl.h b/plugins/HistoryStats/src/optionsctrl.h index 629249e99b..13889ed564 100644 --- a/plugins/HistoryStats/src/optionsctrl.h +++ b/plugins/HistoryStats/src/optionsctrl.h @@ -31,7 +31,7 @@ private: const OptionsCtrl& operator =(const OptionsCtrl& other); // no implementation
public:
- explicit OptionsCtrl(HWND hOptWnd = NULL) : m_hOptWnd(hOptWnd) { }
+ explicit OptionsCtrl(HWND hOptWnd = nullptr) : m_hOptWnd(hOptWnd) { }
~OptionsCtrl() { }
public:
@@ -78,7 +78,7 @@ public: void setScrollPos(int nBar, int nPos);
bool isDateTimeNone(HANDLE hDateTime);
void setDateTimeNone(HANDLE hDateTime);
- DWORD getDateTime(HANDLE hDateTime, bool* pbNone = NULL);
+ DWORD getDateTime(HANDLE hDateTime, bool* pbNone = nullptr);
void setDateTime(HANDLE hDateTime, DWORD dwDateTime);
ext::string getDateTimeStr(HANDLE hDateTime);
void setDateTimeStr(HANDLE hDateTime, const ext::string& strDateTime);
diff --git a/plugins/HistoryStats/src/statistic.h b/plugins/HistoryStats/src/statistic.h index b3dbe6fc2a..e05254b5d7 100644 --- a/plugins/HistoryStats/src/statistic.h +++ b/plugins/HistoryStats/src/statistic.h @@ -167,14 +167,14 @@ public: ~Statistic();
public:
- static void run(const Settings& settings, InvocationSource invokedFrom, HINSTANCE hInst, HWND hWndParent = NULL);
+ static void run(const Settings& settings, InvocationSource invokedFrom, HINSTANCE hInst, HWND hWndParent = nullptr);
int countContacts() const { return m_Contacts.size(); }
const Contact& getContact(int index) const;
const Contact& getTotals() const { assert(m_pTotals); return *m_pTotals; }
const Contact& getOmitted() const { assert(m_pOmitted); return *m_pOmitted; }
- bool hasTotals() const { return (m_pTotals != NULL) && m_Settings.m_CalcTotals; } // MEMO: only makes sense after 'calc totals'-step
- bool hasOmitted() const { return (m_pOmitted != NULL) && m_Settings.m_OmitContacts && m_Settings.m_OmittedInExtraRow && m_bActuallyOmitted; } // MEMO: only makes sense after 'omit'-step
+ bool hasTotals() const { return (m_pTotals != nullptr) && m_Settings.m_CalcTotals; } // MEMO: only makes sense after 'calc totals'-step
+ bool hasOmitted() const { return (m_pOmitted != nullptr) && m_Settings.m_OmitContacts && m_Settings.m_OmittedInExtraRow && m_bActuallyOmitted; } // MEMO: only makes sense after 'omit'-step
DWORD getFirstTime(); // MEMO: only makes sense after 'calc totals'-step
DWORD getLastTime(); // MEMO: only makes sense after 'calc totals'-step
DWORD getHistoryTime(); // MEMO: only makes sense after 'calc totals'-step
diff --git a/plugins/HistoryStats/src/utf8buffer.h b/plugins/HistoryStats/src/utf8buffer.h index 56342adbf7..8f7d3cdddc 100644 --- a/plugins/HistoryStats/src/utf8buffer.h +++ b/plugins/HistoryStats/src/utf8buffer.h @@ -48,7 +48,7 @@ protected: {
return _Tr::not_eof(_C);
}
- else if (pptr() != 0 && pptr() < epptr())
+ else if (pptr() != nullptr && pptr() < epptr())
{
*pptr() = _Tr::to_char_type(_C);
pbump(1);
diff --git a/plugins/HistoryStats/src/utils.h b/plugins/HistoryStats/src/utils.h index 884b1c7302..daae031316 100644 --- a/plugins/HistoryStats/src/utils.h +++ b/plugins/HistoryStats/src/utils.h @@ -96,7 +96,7 @@ namespace utils ext::string getGUID();
// window positioning
- void centerDialog(HWND hDlg, HWND hParent = NULL);
+ void centerDialog(HWND hDlg, HWND hParent = nullptr);
RECT getWindowRect(HWND hParent, HWND hWnd);
inline RECT getWindowRect(HWND hParent, int nID) { return getWindowRect(hParent, GetDlgItem(hParent, nID)); }
void moveWindow(HWND hWnd, const RECT& rWnd);
diff --git a/plugins/ListeningTo/src/stdafx.h b/plugins/ListeningTo/src/stdafx.h index c8b4d5ca1f..9aa52d28ea 100644 --- a/plugins/ListeningTo/src/stdafx.h +++ b/plugins/ListeningTo/src/stdafx.h @@ -100,18 +100,18 @@ void m_log(const wchar_t *function, const wchar_t *fmt, ...); static bool IsEmpty(const char *str)
{
- return str == NULL || str[0] == 0;
+ return str == nullptr || str[0] == 0;
}
static bool IsEmpty(const WCHAR *str)
{
- return str == NULL || str[0] == 0;
+ return str == nullptr || str[0] == 0;
}
-#define DUP(_X_) ( IsEmpty(_X_) ? NULL : mir_wstrdup(_X_))
+#define DUP(_X_) ( IsEmpty(_X_) ? nullptr : mir_wstrdup(_X_))
#define DUPD(_X_, _DEF_) ( IsEmpty(_X_) ? mir_wstrdup(_DEF_) : mir_wstrdup(_X_))
-#define U2T(_X_) ( IsEmpty(_X_) ? NULL : mir_wstrdup(_X_))
+#define U2T(_X_) ( IsEmpty(_X_) ? nullptr : mir_wstrdup(_X_))
#define U2TD(_X_, _DEF_) ( IsEmpty(_X_) ? mir_wstrdup(_DEF_) : mir_wstrdup(_X_))
-#define UNKNOWN(_X_) ( _X_ == NULL || _X_[0] == '\0' ? opts.unknown : _X_ )
+#define UNKNOWN(_X_) ( _X_ == nullptr || _X_[0] == '\0' ? opts.unknown : _X_ )
void InitServices();
diff --git a/plugins/MirLua/src/mlua.h b/plugins/MirLua/src/mlua.h index 06f4fe2287..21ace43dc6 100644 --- a/plugins/MirLua/src/mlua.h +++ b/plugins/MirLua/src/mlua.h @@ -6,7 +6,7 @@ struct HandleRefParam HANDLE h;
int ref;
lua_State *L;
- HandleRefParam(HANDLE h) : L(NULL), h(h), ref(0) { }
+ HandleRefParam(HANDLE h) : L(nullptr), h(h), ref(0) { }
HandleRefParam(lua_State *L, HANDLE h, int ref = 0) : L(L), h(h), ref(ref) { }
};
diff --git a/plugins/MirLua/src/mlua_metatable.h b/plugins/MirLua/src/mlua_metatable.h index 7fb8c27578..c46d397dbb 100644 --- a/plugins/MirLua/src/mlua_metatable.h +++ b/plugins/MirLua/src/mlua_metatable.h @@ -120,7 +120,7 @@ private: static void Free(lua_State* /*L*/, T **obj)
{
- *obj = NULL;
+ *obj = nullptr;
}
static int lua__new(lua_State *L)
@@ -128,7 +128,7 @@ private: T **udata = (T**)lua_newuserdata(L, sizeof(T*));
*udata = Init(L);
- if (*udata == NULL)
+ if (*udata == nullptr)
{
lua_pushnil(L);
return 1;
@@ -319,7 +319,7 @@ public: static void Apply(lua_State *L, T *obj)
{
- if (obj == NULL) {
+ if (obj == nullptr) {
lua_pushnil(L);
return;
}
diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDGfx.h b/plugins/MirandaG15/src/LCDFramework/CLCDGfx.h index 9ac2288262..cc43966413 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDGfx.h +++ b/plugins/MirandaG15/src/LCDFramework/CLCDGfx.h @@ -45,7 +45,7 @@ public: BITMAPINFO *GetBitmapInfo(void);
HBITMAP GetHBITMAP(void);
- void StartTransition(ETransitionType eType = TRANSITION_RANDOM,LPRECT rect = NULL);
+ void StartTransition(ETransitionType eType = TRANSITION_RANDOM,LPRECT rect = nullptr);
protected:
void Cache();
diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDList.h b/plugins/MirandaG15/src/LCDFramework/CLCDList.h index 93284ba71a..84be7da53a 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDList.h +++ b/plugins/MirandaG15/src/LCDFramework/CLCDList.h @@ -15,9 +15,9 @@ public: { m_iIndex = -1; m_iEntryCount = 0; - m_Position = NULL; + m_Position = nullptr; m_pParent = pParent; - if(pParent == NULL) + if(pParent == nullptr) { m_iLevel = 0; m_eType = ROOT; @@ -39,28 +39,28 @@ public: virtual CListEntry<T,G> *GetNextEntry() { - if(m_pParent == NULL) - return NULL; + if(m_pParent == nullptr) + return nullptr; return m_pParent->GetNextEntry(this); } virtual CListEntry<T,G> *GetPreviousEntry() { - if(m_pParent == NULL) - return NULL; + if(m_pParent == nullptr) + return nullptr; return m_pParent->GetPreviousEntry(this); } virtual CListEntry<T,G> *GetNextEntry(CListEntry<T,G>*) { - return NULL; + return nullptr; } virtual CListEntry<T,G> *GetPreviousEntry(CListEntry<T,G>*) { - return NULL; + return nullptr; } EListEntryType GetType() @@ -175,7 +175,7 @@ public: CListContainer(CListEntry<T,G> *pParent) : CListEntry<T,G>(pParent) { - if(m_pParent != NULL) + if(m_pParent != nullptr) { m_eType = CONTAINER; m_bOpen = false; @@ -186,7 +186,7 @@ public: ~CListContainer() { - if(m_pRoot != NULL) { + if(m_pRoot != nullptr) { m_pRoot->DeleteGroup(GetGroupData()); } Clear(); @@ -202,7 +202,7 @@ public: if(m_pRoot && m_pRoot->GetPosition() == *iter) { if(GetType() == ROOT) - m_pRoot->SetPosition(NULL); + m_pRoot->SetPosition(nullptr); else m_pRoot->SetPosition(this); } @@ -225,7 +225,7 @@ public: CListEntry<T,G> *GetLastOwnEntry() { if(m_Entrys.empty()) - return NULL; + return nullptr; return *(--m_Entrys.end()); } @@ -240,14 +240,14 @@ public: return pEntry; return ((CListContainer<T,G>*)pEntry)->GetLastEntry(); } - return NULL; + return nullptr; } CListEntry<T,G> *GetFirstEntry() { if(!m_Entrys.empty()) return *(m_Entrys.begin()); - return NULL; + return nullptr; } CListEntry<T,G> *GetNextEntry() @@ -255,7 +255,7 @@ public: if(!IsOpen() || m_Entrys.empty()) { if(!m_pParent) - return NULL; + return nullptr; return m_pParent->GetNextEntry(this); } @@ -271,8 +271,8 @@ public: { if(++iter == m_Entrys.end()) { - if(m_pParent == NULL) - return NULL; + if(m_pParent == nullptr) + return nullptr; return m_pParent->GetNextEntry(this); } else @@ -280,7 +280,7 @@ public: } iter++; } - return NULL; + return nullptr; } CListEntry<T,G> *GetPreviousEntry(CListEntry<T,G> *pEntry) @@ -293,8 +293,8 @@ public: { if(iter == m_Entrys.begin()) { - if(m_pParent == NULL) - return NULL; + if(m_pParent == nullptr) + return nullptr; return this; } else @@ -311,7 +311,7 @@ public: } iter++; } - return NULL; + return nullptr; } virtual CListItem<T,G> *InsertItem(iterator _Where,T Entry) @@ -352,7 +352,7 @@ public: virtual void RemoveGroup(G Group) { list< CListEntry<T,G>* >::iterator iter = m_Entrys.begin(); - CListContainer<T,G> *pContainer = NULL; + CListContainer<T,G> *pContainer = nullptr; while(iter != m_Entrys.end()) { if((*iter)->GetType() == CONTAINER) @@ -382,7 +382,7 @@ public: virtual void RemoveItem(T Entry) { list< CListEntry<T,G>* >::iterator iter = m_Entrys.begin(); - CListItem<T,G> *pItem = NULL; + CListItem<T,G> *pItem = nullptr; while(iter != m_Entrys.end()) { if((*iter)->GetType() == ITEM) @@ -412,7 +412,7 @@ public: CListContainer<T,G> *GetGroup(G Group) { list< CListEntry<T,G>* >::iterator iter = m_Entrys.begin(); - CListContainer<T,G> *pContainer = NULL; + CListContainer<T,G> *pContainer = nullptr; while(iter != m_Entrys.end()) { if((*iter)->GetType() == CONTAINER) @@ -423,7 +423,7 @@ public: } iter++; } - return NULL; + return nullptr; } G GetGroupData() @@ -462,7 +462,7 @@ public: void CollapseAll() { list< CListEntry<T,G>* >::iterator iter = m_Entrys.begin(); - CListContainer<T,G>* pContainer = NULL; + CListContainer<T,G>* pContainer = nullptr; while(iter != m_Entrys.end()) { if((*iter)->GetType() == CONTAINER) @@ -478,7 +478,7 @@ public: void ExpandAll() { list< CListEntry<T,G>* >::iterator iter = m_Entrys.begin(); - CListContainer<T,G>* pContainer = NULL; + CListContainer<T,G>* pContainer = nullptr; while(iter != m_Entrys.end()) { if((*iter)->GetType() == CONTAINER) @@ -512,7 +512,7 @@ public: if(GetType() == ROOT) { - if(GetPosition() == NULL && !m_Entrys.empty()) + if(GetPosition() == nullptr && !m_Entrys.empty()) SetPosition(*m_Entrys.begin()); else SetPosition(GetPosition()); @@ -541,9 +541,9 @@ public: //************************************************************************ // Constructor //************************************************************************ - CLCDList() : CListContainer<T,G>(NULL) + CLCDList() : CListContainer<T,G>(nullptr) { - m_pScrollbar = NULL; + m_pScrollbar = nullptr; m_iIndention = 10; m_iColumns = 1; m_bDrawTreeLines = true; @@ -613,7 +613,7 @@ public: CListEntry<T,G> *pPosition = m_Position; // if nothing is selected, skip drawing - if(pPosition == NULL) + if(pPosition == nullptr) return true; bool bDrawGroup = false; @@ -642,7 +642,7 @@ public: } // bottom selection - while(pPosition != NULL ) + while(pPosition != nullptr) { iYOffset = iHeight; @@ -757,7 +757,7 @@ public: { CListContainer<T,G>::SetPosition(pEntry); - if(pEntry == NULL) + if(pEntry == nullptr) return; int iPerPage = (GetHeight()/m_iEntryHeight)*m_iColumns; @@ -773,10 +773,10 @@ public: //************************************************************************ bool ScrollUp() { - if(m_Position != NULL) + if(m_Position != nullptr) { CListEntry<T,G> *pEntry = m_Position->GetPreviousEntry(); - if(pEntry != NULL) + if(pEntry != nullptr) { m_Position = pEntry; @@ -793,10 +793,10 @@ public: //************************************************************************ bool ScrollDown() { - if(m_Position != NULL) + if(m_Position != nullptr) { CListEntry<T,G> *pEntry = m_Position->GetNextEntry(); - if(pEntry != NULL) + if(pEntry != nullptr) { m_Position = pEntry; @@ -825,8 +825,8 @@ public: m_pScrollbar = pScrollbar; if(m_pScrollbar) { - m_pScrollbar->SetRange(0,m_iEntryCount-1); - m_pScrollbar->ScrollTo(m_Position != NULL?m_Position->GetIndex():0); + m_pScrollbar->SetRange(0, m_iEntryCount - 1); + m_pScrollbar->ScrollTo(m_Position != nullptr ? m_Position->GetIndex() : 0); m_pScrollbar->SetAlignment(TOP); } @@ -892,7 +892,7 @@ protected: if(m_pScrollbar) { m_pScrollbar->SetRange(0,m_iEntryCount-1); - if(GetPosition() != NULL) + if(GetPosition() != nullptr) m_pScrollbar->ScrollTo(GetPosition()->GetIndex()); } } diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDOutputManager.h b/plugins/MirandaG15/src/LCDFramework/CLCDOutputManager.h index 1011e5d551..adb338c7c6 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDOutputManager.h +++ b/plugins/MirandaG15/src/LCDFramework/CLCDOutputManager.h @@ -49,7 +49,7 @@ public: void SetButtonRepeatDelay(DWORD dwDelay);
// starts a screen transition
- void StartTransition(ETransitionType eTransition = TRANSITION_RANDOM,LPRECT rect = NULL);
+ void StartTransition(ETransitionType eTransition = TRANSITION_RANDOM,LPRECT rect = nullptr);
// called by CLCDConnection when connected to a device
void OnDeviceConnected();
diff --git a/plugins/MirandaG15/src/LCDFramework/misc.h b/plugins/MirandaG15/src/LCDFramework/misc.h index c5f2bb4f06..0ff1a01668 100644 --- a/plugins/MirandaG15/src/LCDFramework/misc.h +++ b/plugins/MirandaG15/src/LCDFramework/misc.h @@ -52,7 +52,7 @@ inline std::string toNarrowString( const std::string& str ) }
inline std::tstring toTstring( const wchar_t* p , int len=-1 )
{
- return p == NULL?L"":((len < 0) ? p : std::wstring(p,len));
+ return p == nullptr ?L"":((len < 0) ? p : std::wstring(p,len));
}
extern tstring Utf8_Decode(const char *str);
@@ -75,7 +75,7 @@ inline std::string toNarrowString( const std::string& str ) }
inline std::tstring toTstring( const char* p , int len=-1 )
{
- if(p == NULL)
+ if(p == nullptr)
return "";
return (len < 0) ? p : std::string(p,len) ;
}
diff --git a/plugins/MyDetails/src/stdafx.h b/plugins/MyDetails/src/stdafx.h index 0417f65813..1b0a10892e 100644 --- a/plugins/MyDetails/src/stdafx.h +++ b/plugins/MyDetails/src/stdafx.h @@ -84,7 +84,7 @@ static __inline int DRAW_TEXT(HDC hDC, LPCTSTR lpString, int nCount, LPRECT lpRe return DrawText(hDC, lpString, nCount, lpRect, uFormat);
return Smileys_DrawText(hDC, lpString, nCount, lpRect, uFormat | (opts.resize_smileys ? DT_RESIZE_SMILEYS : 0),
- opts.use_contact_list_smileys ? "clist" : protocol, NULL);
+ opts.use_contact_list_smileys ? "clist" : protocol, nullptr);
}
#endif // __COMMONS_H__
diff --git a/plugins/NewAwaySysMod/src/AwayOpt.cpp b/plugins/NewAwaySysMod/src/AwayOpt.cpp index 3ded4b59c6..0b413d290e 100644 --- a/plugins/NewAwaySysMod/src/AwayOpt.cpp +++ b/plugins/NewAwaySysMod/src/AwayOpt.cpp @@ -31,7 +31,7 @@ CIconList g_IconList; // Set window size and center its controls
void MySetPos(HWND hwndParent)
{
- HWND hWndTab = FindWindowEx(GetParent(hwndParent), NULL, L"SysTabControl32", L"");
+ HWND hWndTab = FindWindowEx(GetParent(hwndParent), nullptr, L"SysTabControl32", L"");
if (!hWndTab) {
_ASSERT(0);
return;
@@ -64,7 +64,7 @@ void MySetPos(HWND hwndParent) // ================================================ Message options ================================================
-COptPage g_MessagesOptPage(MOD_NAME, NULL);
+COptPage g_MessagesOptPage(MOD_NAME, nullptr);
void EnableMessagesOptDlgControls(CMsgTree* MsgTree)
{
@@ -318,7 +318,7 @@ static INT_PTR CALLBACK MessagesOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LP case WM_DESTROY:
delete MsgTree;
MsgTree = nullptr;
- g_MessagesOptPage.SetWnd(NULL);
+ g_MessagesOptPage.SetWnd(nullptr);
break;
}
return 0;
@@ -326,7 +326,7 @@ static INT_PTR CALLBACK MessagesOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LP // ================================================ Main options ================================================
-COptPage g_MoreOptPage(MOD_NAME, NULL);
+COptPage g_MoreOptPage(MOD_NAME, nullptr);
void EnableMoreOptDlgControls()
{
@@ -337,7 +337,7 @@ void EnableMoreOptDlgControls() g_MoreOptPage.Enable(IDC_MOREOPTDLG_USEDEFMSG, bEnabled);
g_MoreOptPage.Enable(IDC_MOREOPTDLG_PERSTATUSPERSONAL, g_MoreOptPage.GetWndValue(IDC_MOREOPTDLG_SAVEPERSONALMSGS) != 0);
g_MoreOptPage.Enable(IDC_MOREOPTDLG_UPDATEMSGSPERIOD, g_MoreOptPage.GetWndValue(IDC_MOREOPTDLG_UPDATEMSGS) != 0);
- InvalidateRect(GetDlgItem(g_MoreOptPage.GetWnd(), IDC_MOREOPTDLG_UPDATEMSGSPERIOD_SPIN), NULL, false); // update spin control
+ InvalidateRect(GetDlgItem(g_MoreOptPage.GetWnd(), IDC_MOREOPTDLG_UPDATEMSGSPERIOD_SPIN), nullptr, false); // update spin control
g_MoreOptPage.MemToPage(true);
}
@@ -438,7 +438,7 @@ static INT_PTR CALLBACK MoreOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM break;
case WM_DESTROY:
- g_MoreOptPage.SetWnd(NULL);
+ g_MoreOptPage.SetWnd(nullptr);
break;
}
return 0;
@@ -446,7 +446,7 @@ static INT_PTR CALLBACK MoreOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM // ================================================ Autoreply options ================================================
-COptPage g_AutoreplyOptPage(MOD_NAME, NULL);
+COptPage g_AutoreplyOptPage(MOD_NAME, nullptr);
void EnableAutoreplyOptDlgControls()
{
@@ -464,7 +464,7 @@ void EnableAutoreplyOptDlgControls() }
}
g_AutoreplyOptPage.MemToPage(true);
- InvalidateRect(GetDlgItem(g_AutoreplyOptPage.GetWnd(), IDC_REPLYDLG_SENDCOUNT_SPIN), NULL, 0); // update spin control
+ InvalidateRect(GetDlgItem(g_AutoreplyOptPage.GetWnd(), IDC_REPLYDLG_SENDCOUNT_SPIN), nullptr, 0); // update spin control
}
static struct {
@@ -549,7 +549,7 @@ INT_PTR CALLBACK AutoreplyOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l IDC_MOREOPTDLG_EVNTURL, LPGENW("URL"),
IDC_MOREOPTDLG_EVNTFILE, LPGENW("File")
};
- hWndTooltips = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, L"", WS_POPUP | TTS_NOPREFIX, 0, 0, 0, 0, NULL, NULL, GetModuleHandleA("mir_app.mir"), NULL);
+ hWndTooltips = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, L"", WS_POPUP | TTS_NOPREFIX, 0, 0, 0, 0, nullptr, nullptr, GetModuleHandleA("mir_app.mir"), nullptr);
TOOLINFO ti = { 0 };
ti.cbSize = sizeof(ti);
ti.uFlags = TTF_IDISHWND | TTF_SUBCLASS;
@@ -637,7 +637,7 @@ INT_PTR CALLBACK AutoreplyOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l break;
case WM_DESTROY:
- g_AutoreplyOptPage.SetWnd(NULL);
+ g_AutoreplyOptPage.SetWnd(nullptr);
if (s_hDrawFont)
DeleteObject(s_hDrawFont);
@@ -1048,8 +1048,8 @@ int OptsDlgInit(WPARAM wParam, LPARAM) return 0;
}
-COptPage g_SetAwayMsgPage(MOD_NAME, NULL);
-COptPage g_MsgTreePage(MOD_NAME, NULL);
+COptPage g_SetAwayMsgPage(MOD_NAME, nullptr);
+COptPage g_MsgTreePage(MOD_NAME, nullptr);
void InitOptions()
{
@@ -1057,15 +1057,15 @@ void InitOptions() g_MessagesOptPage.Items.AddElem(new COptItem_Generic(IDC_MESSAGEDLG_DEL));
g_MessagesOptPage.Items.AddElem(new COptItem_Generic(IDC_MESSAGEDLG_MSGTITLE));
g_MessagesOptPage.Items.AddElem(new COptItem_Generic(IDC_MESSAGEDLG_MSGDATA));
- g_MessagesOptPage.Items.AddElem(new COptItem_Checkbox(IDC_MESSAGEDLG_DEF_ONL, NULL, DBVT_BYTE, 0, 0, IDC_MESSAGEDLG_MSGTREE));
- g_MessagesOptPage.Items.AddElem(new COptItem_Checkbox(IDC_MESSAGEDLG_DEF_AWAY, NULL, DBVT_BYTE, 0, 0, IDC_MESSAGEDLG_MSGTREE));
- g_MessagesOptPage.Items.AddElem(new COptItem_Checkbox(IDC_MESSAGEDLG_DEF_NA, NULL, DBVT_BYTE, 0, 0, IDC_MESSAGEDLG_MSGTREE));
- g_MessagesOptPage.Items.AddElem(new COptItem_Checkbox(IDC_MESSAGEDLG_DEF_OCC, NULL, DBVT_BYTE, 0, 0, IDC_MESSAGEDLG_MSGTREE));
- g_MessagesOptPage.Items.AddElem(new COptItem_Checkbox(IDC_MESSAGEDLG_DEF_DND, NULL, DBVT_BYTE, 0, 0, IDC_MESSAGEDLG_MSGTREE));
- g_MessagesOptPage.Items.AddElem(new COptItem_Checkbox(IDC_MESSAGEDLG_DEF_FFC, NULL, DBVT_BYTE, 0, 0, IDC_MESSAGEDLG_MSGTREE));
- g_MessagesOptPage.Items.AddElem(new COptItem_Checkbox(IDC_MESSAGEDLG_DEF_INV, NULL, DBVT_BYTE, 0, 0, IDC_MESSAGEDLG_MSGTREE));
- g_MessagesOptPage.Items.AddElem(new COptItem_Checkbox(IDC_MESSAGEDLG_DEF_OTP, NULL, DBVT_BYTE, 0, 0, IDC_MESSAGEDLG_MSGTREE));
- g_MessagesOptPage.Items.AddElem(new COptItem_Checkbox(IDC_MESSAGEDLG_DEF_OTL, NULL, DBVT_BYTE, 0, 0, IDC_MESSAGEDLG_MSGTREE));
+ g_MessagesOptPage.Items.AddElem(new COptItem_Checkbox(IDC_MESSAGEDLG_DEF_ONL, nullptr, DBVT_BYTE, 0, 0, IDC_MESSAGEDLG_MSGTREE));
+ g_MessagesOptPage.Items.AddElem(new COptItem_Checkbox(IDC_MESSAGEDLG_DEF_AWAY, nullptr, DBVT_BYTE, 0, 0, IDC_MESSAGEDLG_MSGTREE));
+ g_MessagesOptPage.Items.AddElem(new COptItem_Checkbox(IDC_MESSAGEDLG_DEF_NA, nullptr, DBVT_BYTE, 0, 0, IDC_MESSAGEDLG_MSGTREE));
+ g_MessagesOptPage.Items.AddElem(new COptItem_Checkbox(IDC_MESSAGEDLG_DEF_OCC, nullptr, DBVT_BYTE, 0, 0, IDC_MESSAGEDLG_MSGTREE));
+ g_MessagesOptPage.Items.AddElem(new COptItem_Checkbox(IDC_MESSAGEDLG_DEF_DND, nullptr, DBVT_BYTE, 0, 0, IDC_MESSAGEDLG_MSGTREE));
+ g_MessagesOptPage.Items.AddElem(new COptItem_Checkbox(IDC_MESSAGEDLG_DEF_FFC, nullptr, DBVT_BYTE, 0, 0, IDC_MESSAGEDLG_MSGTREE));
+ g_MessagesOptPage.Items.AddElem(new COptItem_Checkbox(IDC_MESSAGEDLG_DEF_INV, nullptr, DBVT_BYTE, 0, 0, IDC_MESSAGEDLG_MSGTREE));
+ g_MessagesOptPage.Items.AddElem(new COptItem_Checkbox(IDC_MESSAGEDLG_DEF_OTP, nullptr, DBVT_BYTE, 0, 0, IDC_MESSAGEDLG_MSGTREE));
+ g_MessagesOptPage.Items.AddElem(new COptItem_Checkbox(IDC_MESSAGEDLG_DEF_OTL, nullptr, DBVT_BYTE, 0, 0, IDC_MESSAGEDLG_MSGTREE));
TreeItemArray DefMsgTree;
int ParentID1;
int ID = 0;
diff --git a/plugins/NewAwaySysMod/src/AwaySys.cpp b/plugins/NewAwaySysMod/src/AwaySys.cpp index eef50f0655..fd339acc69 100644 --- a/plugins/NewAwaySysMod/src/AwaySys.cpp +++ b/plugins/NewAwaySysMod/src/AwaySys.cpp @@ -107,16 +107,16 @@ TCString GetDynamicStatMsg(MCONTACT hContact, char *szProto, DWORD UIN, int iSta {
// hContact is the contact that requests the status message
if (hContact != INVALID_CONTACT_ID)
- VarParseData.Message = CContactSettings(iStatus, hContact).GetMsgFormat(GMF_ANYCURRENT, NULL, szProto);
+ VarParseData.Message = CContactSettings(iStatus, hContact).GetMsgFormat(GMF_ANYCURRENT, nullptr, szProto);
else // contact is unknown
VarParseData.Message = CProtoSettings(szProto, iStatus).GetMsgFormat(iStatus ? GMF_LASTORDEFAULT : GMF_ANYCURRENT);
TCString sTime;
- VarParseData.szProto = szProto ? szProto : ((hContact && hContact != INVALID_CONTACT_ID) ? GetContactProto(hContact) : NULL);
+ VarParseData.szProto = szProto ? szProto : ((hContact && hContact != INVALID_CONTACT_ID) ? GetContactProto(hContact) : nullptr);
VarParseData.UIN = UIN;
VarParseData.Flags = 0;
if (ServiceExists(MS_VARS_FORMATSTRING) && !g_SetAwayMsgPage.GetDBValueCopy(IDS_SAWAYMSG_DISABLEVARIABLES)) {
- wchar_t *szResult = variables_parse(VarParseData.Message, 0, hContact);
+ wchar_t *szResult = variables_parse(VarParseData.Message, nullptr, hContact);
if (szResult) {
VarParseData.Message = szResult;
mir_free(szResult);
@@ -155,7 +155,7 @@ int StatusMsgReq(WPARAM wParam, LPARAM lParam, CString &szProto) hContactForSettings = INVALID_CONTACT_ID; // INVALID_HANDLE_VALUE means the contact is not-on-list
if (g_SetAwayMsgPage.GetWnd()) {
- CallAllowedPS_SETAWAYMSG(szProto, iMode, NULL); // we can set status messages to NULL here, as they'll be changed again when the SAM dialog closes.
+ CallAllowedPS_SETAWAYMSG(szProto, iMode, nullptr); // we can set status messages to NULL here, as they'll be changed again when the SAM dialog closes.
return 0;
}
if (CContactSettings(iMode, hContactForSettings).Ignore) {
@@ -345,10 +345,10 @@ int PreBuildContactMenu(WPARAM hContact, LPARAM) case 0: hIcon = iconList[0].hIcolib; break;
default: iAutoreply = 1; hIcon = iconList[1].hIcolib; break;
}
- Menu_ModifyItem(g_hToggleSOEContactMenuItem, NULL, hIcon, 0);
- Menu_ModifyItem(g_hAutoreplyOnContactMenuItem, NULL, iconList[1].hIcolib, (iAutoreply == 1) ? CMIF_CHECKED : 0);
- Menu_ModifyItem(g_hAutoreplyOffContactMenuItem, NULL, iconList[0].hIcolib, (iAutoreply == 0) ? CMIF_CHECKED : 0);
- Menu_ModifyItem(g_hAutoreplyUseDefaultContactMenuItem, NULL, iconList[5].hIcolib, (iAutoreply == VAL_USEDEFAULT) ? CMIF_CHECKED : 0);
+ Menu_ModifyItem(g_hToggleSOEContactMenuItem, nullptr, hIcon, 0);
+ Menu_ModifyItem(g_hAutoreplyOnContactMenuItem, nullptr, iconList[1].hIcolib, (iAutoreply == 1) ? CMIF_CHECKED : 0);
+ Menu_ModifyItem(g_hAutoreplyOffContactMenuItem, nullptr, iconList[0].hIcolib, (iAutoreply == 0) ? CMIF_CHECKED : 0);
+ Menu_ModifyItem(g_hAutoreplyUseDefaultContactMenuItem, nullptr, iconList[5].hIcolib, (iAutoreply == VAL_USEDEFAULT) ? CMIF_CHECKED : 0);
}
else // hide the Autoreply menu item
Menu_ShowItem(g_hToggleSOEContactMenuItem, false);
@@ -389,7 +389,7 @@ static INT_PTR SetContactStatMsg(WPARAM hContact, LPARAM) INT_PTR ToggleSendOnEvent(WPARAM hContact, LPARAM)
{
// used only for the global setting
- CContactSettings(g_ProtoStates[hContact ? GetContactProto(hContact) : NULL].m_status, hContact).Autoreply.Toggle();
+ CContactSettings(g_ProtoStates[hContact ? GetContactProto(hContact) : nullptr].m_status, hContact).Autoreply.Toggle();
if (hContact == NULL) {
int SendOnEvent = CContactSettings(g_ProtoStates[(LPSTR)NULL].m_status).Autoreply;
@@ -490,7 +490,7 @@ INT_PTR srvVariablesHandler(WPARAM, LPARAM lParam) Result.ReleaseBuffer();
}
else if (!mir_wstrcmp(ai->targv[0], VAR_AWAYSINCE_DATE)) {
- GetDateFormat(LOCALE_USER_DEFAULT, 0, g_ProtoStates[VarParseData.szProto].m_awaySince, (ai->argc > 1 && *ai->targv[1]) ? ai->targv[1] : NULL, Result.GetBuffer(256), 256);
+ GetDateFormat(LOCALE_USER_DEFAULT, 0, g_ProtoStates[VarParseData.szProto].m_awaySince, (ai->argc > 1 && *ai->targv[1]) ? ai->targv[1] : nullptr, Result.GetBuffer(256), 256);
Result.ReleaseBuffer();
}
else if (!mir_wstrcmp(ai->targv[0], VAR_STATDESC)) {
@@ -498,12 +498,12 @@ INT_PTR srvVariablesHandler(WPARAM, LPARAM lParam) }
else if (!mir_wstrcmp(ai->targv[0], VAR_MYNICK)) {
if (g_MoreOptPage.GetDBValueCopy(IDC_MOREOPTDLG_MYNICKPERPROTO) && VarParseData.szProto)
- Result = db_get_s(NULL, VarParseData.szProto, "Nick", (wchar_t*)NULL);
+ Result = db_get_s(NULL, VarParseData.szProto, "Nick", (wchar_t*)nullptr);
- if (Result == NULL)
+ if (Result == nullptr)
Result = pcli->pfnGetContactDisplayName(NULL, 0);
- if (Result == NULL)
+ if (Result == nullptr)
Result = TranslateT("Stranger");
}
else if (!mir_wstrcmp(ai->targv[0], VAR_REQUESTCOUNT)) {
@@ -546,7 +546,7 @@ INT_PTR srvVariablesHandler(WPARAM, LPARAM lParam) break;
}
}
- if (Result == NULL) // if we didn't find a message with specified title
+ if (Result == nullptr) // if we didn't find a message with specified title
return NULL; // return it now, as later we change NULL to ""
}
else if (!mir_wstrcmp(ai->targv[0], VAR_PROTOCOL)) {
@@ -556,14 +556,14 @@ INT_PTR srvVariablesHandler(WPARAM, LPARAM lParam) AnsiResult.ReleaseBuffer();
Result = _A2T(AnsiResult);
}
- if (Result == NULL) // if we didn't find a message with specified title
+ if (Result == nullptr) // if we didn't find a message with specified title
return NULL; // return it now, as later we change NULL to ""
}
wchar_t *szResult = (wchar_t*)malloc((Result.GetLen() + 1) * sizeof(wchar_t));
if (!szResult)
return NULL;
- mir_wstrcpy(szResult, (Result != NULL) ? Result : L"");
+ mir_wstrcpy(szResult, (Result != nullptr) ? Result : L"");
return (INT_PTR)szResult;
}
@@ -657,7 +657,7 @@ int MirandaLoaded(WPARAM, LPARAM) memset(&mi, 0, sizeof(mi));
SET_UID(mi, 0x47a3c631, 0x8ca9, 0x4b7e, 0x84, 0x6e, 0x29, 0xbf, 0x53, 0x30, 0x6f, 0x83);
mi.flags = CMIF_UNICODE;
- mi.hIcolibItem = NULL;
+ mi.hIcolibItem = nullptr;
mi.position = 1000020000;
mi.name.w = LPGENW("Autoreply");
g_hToggleSOEContactMenuItem = Menu_AddContactMenuItem(&mi);
diff --git a/plugins/NewAwaySysMod/src/CString.cpp b/plugins/NewAwaySysMod/src/CString.cpp index 727ea9fb41..5a61b36edb 100644 --- a/plugins/NewAwaySysMod/src/CString.cpp +++ b/plugins/NewAwaySysMod/src/CString.cpp @@ -38,7 +38,7 @@ void TString<T>::Free() {
// HeapFree(GetProcessHeap(), 0, pBuf);
free(pBuf);
- pBuf = NULL;
+ pBuf = nullptr;
nBufSize = 0;
nAllocSize = 0;
}
diff --git a/plugins/NewAwaySysMod/src/CString.h b/plugins/NewAwaySysMod/src/CString.h index decedaaac7..22cb0dd4c3 100644 --- a/plugins/NewAwaySysMod/src/CString.h +++ b/plugins/NewAwaySysMod/src/CString.h @@ -45,9 +45,9 @@ template <class T> class TString
{
public:
- TString(): pBuf(NULL), nBufSize(0), nAllocSize(0) {}
- TString(const T *pStr): pBuf(NULL), nBufSize(0), nAllocSize(0) {*this = pStr;}
- TString(const TString<T> &Str): pBuf(NULL), nBufSize(0), nAllocSize(0) {*this = Str.pBuf;}
+ TString(): pBuf(nullptr), nBufSize(0), nAllocSize(0) {}
+ TString(const T *pStr): pBuf(nullptr), nBufSize(0), nAllocSize(0) {*this = pStr;}
+ TString(const TString<T> &Str): pBuf(nullptr), nBufSize(0), nAllocSize(0) {*this = Str.pBuf;}
~TString() {Free();}
int GetLen() const {return (nBufSize) ? (nBufSize - 1) : 0;};
@@ -183,7 +183,7 @@ private: class UTF8DecodeA
{
public:
- UTF8DecodeA(const char *str) { p = mir_strdup(str); mir_utf8decode(p, NULL); }
+ UTF8DecodeA(const char *str) { p = mir_strdup(str); mir_utf8decode(p, nullptr); }
~UTF8DecodeA() { mir_free(p); }
operator char*() { return p; }
diff --git a/plugins/NewAwaySysMod/src/Client.cpp b/plugins/NewAwaySysMod/src/Client.cpp index 92dbffb9c4..a062efb8ac 100644 --- a/plugins/NewAwaySysMod/src/Client.cpp +++ b/plugins/NewAwaySysMod/src/Client.cpp @@ -76,7 +76,7 @@ void InitUpdateMsgs() }
else if (!g_hUpdateMsgsThread && UpdateMsgs) {
g_hTerminateUpdateMsgsThread = CreateEvent(nullptr, TRUE, FALSE, nullptr);
- g_hUpdateMsgsThread = (HANDLE)mir_forkthread(UpdateMsgsThreadProc, NULL);
+ g_hUpdateMsgsThread = (HANDLE)mir_forkthread(UpdateMsgsThreadProc, nullptr);
}
}
@@ -85,7 +85,7 @@ void ChangeProtoMessages(char* szProto, int iMode, const TCString &Msg) {
TCString CurMsg(Msg);
if (szProto) {
- if (Msg == NULL)
+ if (Msg == nullptr)
CurMsg = GetDynamicStatMsg(INVALID_CONTACT_ID, szProto);
CallAllowedPS_SETAWAYMSG(szProto, iMode, CurMsg);
@@ -98,7 +98,7 @@ void ChangeProtoMessages(char* szProto, int iMode, const TCString &Msg) for (int i = 0; i < numAccs; i++) {
PROTOACCOUNT *p = accs[i];
if (!db_get_b(NULL, p->szModuleName, "LockMainStatus", 0)) {
- if (Msg == NULL)
+ if (Msg == nullptr)
CurMsg = GetDynamicStatMsg(INVALID_CONTACT_ID, p->szModuleName);
CallAllowedPS_SETAWAYMSG(p->szModuleName, iMode, CurMsg);
diff --git a/plugins/NewAwaySysMod/src/ContactList.cpp b/plugins/NewAwaySysMod/src/ContactList.cpp index 99a50335fa..464a2881cf 100644 --- a/plugins/NewAwaySysMod/src/ContactList.cpp +++ b/plugins/NewAwaySysMod/src/ContactList.cpp @@ -176,7 +176,7 @@ LRESULT CALLBACK ContactListSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, LPA break;
case INTM_INVALIDATE:
- InvalidateRect(hWnd, NULL, true);
+ InvalidateRect(hWnd, nullptr, true);
break;
case WM_RBUTTONDOWN:
@@ -317,7 +317,7 @@ LRESULT CALLBACK ContactListSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, LPA HMENU hMenu = Menu_BuildContactMenu(hContact);
if (hMenu) {
ClientToScreen(hWnd, &pt);
- Clist_MenuProcessCommand(TrackPopupMenu(hMenu, TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD, pt.x, pt.y, 0, hWnd, NULL), MPCF_CONTACTMENU, hContact);
+ Clist_MenuProcessCommand(TrackPopupMenu(hMenu, TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD, pt.x, pt.y, 0, hWnd, nullptr), MPCF_CONTACTMENU, hContact);
DestroyMenu(hMenu);
return 0;
}
diff --git a/plugins/NewAwaySysMod/src/ContactList.h b/plugins/NewAwaySysMod/src/ContactList.h index b85df45a01..e6467c282f 100644 --- a/plugins/NewAwaySysMod/src/ContactList.h +++ b/plugins/NewAwaySysMod/src/ContactList.h @@ -51,7 +51,7 @@ public: HTREEITEM AddContact(MCONTACT hContact);
HTREEITEM AddGroup(TCString GroupName);
- HTREEITEM AddInfo(TCString Title, HTREEITEM hParent, HTREEITEM hInsertAfter, LPARAM lParam = NULL, HICON hIcon = NULL);
+ HTREEITEM AddInfo(TCString Title, HTREEITEM hParent, HTREEITEM hInsertAfter, LPARAM lParam = NULL, HICON hIcon = nullptr);
void SetInfoIcon(HTREEITEM hItem, HICON hIcon);
int GetExtraImage(HTREEITEM hItem, int iColumn); // returns iImage, or CLC_EXTRAICON_EMPTY
void SetExtraImage(HTREEITEM hItem, int iColumn, int iImage); // set iImage to CLC_EXTRAICON_EMPTY to reset image
@@ -61,7 +61,7 @@ public: void SortContacts();
MCONTACT GethContact(HTREEITEM hItem); // returns hContact, hGroup or hInfo
HTREEITEM HitTest(LPPOINT pt, PDWORD hitFlags); // pt is relative to control; returns hItem or NULL
- void EnsureVisible(HTREEITEM hItem) {TreeView_EnsureVisible(hTreeView, hItem); InvalidateRect(hTreeView, NULL, false);} // sometimes horizontal scrollbar position changes too, so we must redraw extra icons - that's why here is InvalidateRect. TODO: try to find a way to invalidate it on _every_ horizontal scrollbar position change, instead of just here - unfortunately the scrollbar doesn't notify the tree control of its position change through WM_HSCROLL in some cases
+ void EnsureVisible(HTREEITEM hItem) {TreeView_EnsureVisible(hTreeView, hItem); InvalidateRect(hTreeView, nullptr, false);} // sometimes horizontal scrollbar position changes too, so we must redraw extra icons - that's why here is InvalidateRect. TODO: try to find a way to invalidate it on _every_ horizontal scrollbar position change, instead of just here - unfortunately the scrollbar doesn't notify the tree control of its position change through WM_HSCROLL in some cases
int SelectItem(HTREEITEM hItem) {return TreeView_SelectItem(hTreeView, hItem);}
void SetItemParam(HTREEITEM hItem, LPARAM lParam) {GetItemData(hItem).lParam = lParam;}
LPARAM GetItemParam(HTREEITEM hItem) {return GetItemData(hItem).lParam;}
diff --git a/plugins/NewAwaySysMod/src/MsgEventAdded.cpp b/plugins/NewAwaySysMod/src/MsgEventAdded.cpp index 6316a5d50f..0fee8edf25 100644 --- a/plugins/NewAwaySysMod/src/MsgEventAdded.cpp +++ b/plugins/NewAwaySysMod/src/MsgEventAdded.cpp @@ -69,7 +69,7 @@ void __cdecl AutoreplyDelayThread(void *_ad) dbeo.eventType = EVENTTYPE_MESSAGE;
dbeo.flags = DBEF_SENT | DBEF_UTF;
dbeo.szModule = szProto;
- dbeo.timestamp = time(NULL);
+ dbeo.timestamp = time(nullptr);
dbeo.cbBlob = ReplyLen;
dbeo.pBlob = (PBYTE)(char*)pszReply;
@@ -114,7 +114,7 @@ int MsgEventAdded(WPARAM hContact, LPARAM lParam) if (dbei->flags & DBEF_SENT || (dbei->eventType != EVENTTYPE_MESSAGE && dbei->eventType != EVENTTYPE_URL && dbei->eventType != EVENTTYPE_FILE))
return 0;
- if (time(NULL) - dbei->timestamp > MAX_REPLY_TIMEDIFF) // don't reply to offline messages
+ if (time(nullptr) - dbei->timestamp > MAX_REPLY_TIMEDIFF) // don't reply to offline messages
return 0;
char *szProto = GetContactProto(hContact);
@@ -222,7 +222,7 @@ int MsgEventAdded(WPARAM hContact, LPARAM lParam) db_set_b(hContact, MOD_NAME, DB_SENDCOUNT, db_get_b(hContact, MOD_NAME, DB_SENDCOUNT, 0) + 1);
GetDynamicStatMsg(hContact); // it updates VarParseData.Message needed for %extratext% in the format
TCString Reply(*(TCString*)AutoreplyOptData.GetValue(IDC_REPLYDLG_PREFIX));
- if (Reply != NULL && ServiceExists(MS_VARS_FORMATSTRING) && !g_SetAwayMsgPage.GetDBValueCopy(IDS_SAWAYMSG_DISABLEVARIABLES)) {
+ if (Reply != nullptr && ServiceExists(MS_VARS_FORMATSTRING) && !g_SetAwayMsgPage.GetDBValueCopy(IDS_SAWAYMSG_DISABLEVARIABLES)) {
wchar_t *szResult = variables_parse(Reply, VarParseData.Message, hContact);
if (szResult != nullptr) {
Reply = szResult;
diff --git a/plugins/NewAwaySysMod/src/MsgTree.cpp b/plugins/NewAwaySysMod/src/MsgTree.cpp index 3dc99705b2..647f6bbff4 100644 --- a/plugins/NewAwaySysMod/src/MsgTree.cpp +++ b/plugins/NewAwaySysMod/src/MsgTree.cpp @@ -176,7 +176,7 @@ static LRESULT CALLBACK ParentSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, L int x = rc.left - iSize - 5;
for (int i = 0; i < _countof(SettingsList); i++) {
if (lpNMCD->nmcd.lItemlParam == (LPARAM)dat->MsgTreePage.GetValue(SettingsList[i].DBSetting)) {
- DrawIconEx(lpNMCD->nmcd.hdc, x, rc.top, Skin_LoadProtoIcon(NULL, SettingsList[i].Status), iSize, iSize, 0, GetSysColorBrush(COLOR_WINDOW), DI_NORMAL);
+ DrawIconEx(lpNMCD->nmcd.hdc, x, rc.top, Skin_LoadProtoIcon(nullptr, SettingsList[i].Status), iSize, iSize, 0, GetSysColorBrush(COLOR_WINDOW), DI_NORMAL);
x -= iSize + 1;
}
}
@@ -506,7 +506,7 @@ bool CMsgTree::SetSelection(int ID, int Flags) // set ID = -1 to unselect; retur if (Order == -1 && ID != -1)
return false;
- TreeView_SelectItem(hTreeView, (Order == -1) ? NULL : ((Order <= TREECTRL_ROOTORDEROFFS) ? TreeCtrl->RootItems[ROOT_ORDER_TO_INDEX(Order)].hItem : TreeCtrl->m_value[Order].hItem));
+ TreeView_SelectItem(hTreeView, (Order == -1) ? nullptr : ((Order <= TREECTRL_ROOTORDEROFFS) ? TreeCtrl->RootItems[ROOT_ORDER_TO_INDEX(Order)].hItem : TreeCtrl->m_value[Order].hItem));
return true;
}
diff --git a/plugins/NewAwaySysMod/src/Notification.cpp b/plugins/NewAwaySysMod/src/Notification.cpp index 56ee9cf2cd..27445ccb66 100644 --- a/plugins/NewAwaySysMod/src/Notification.cpp +++ b/plugins/NewAwaySysMod/src/Notification.cpp @@ -25,7 +25,7 @@ void ShowMsg(wchar_t *FirstLine, wchar_t *SecondLine, bool IsErrorMsg, int Timeo {
if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
POPUPDATAT ppd = { 0 };
- ppd.lchIcon = LoadIcon(NULL, IsErrorMsg ? IDI_EXCLAMATION : IDI_INFORMATION);
+ ppd.lchIcon = LoadIcon(nullptr, IsErrorMsg ? IDI_EXCLAMATION : IDI_INFORMATION);
mir_wstrncpy(ppd.lptzContactName, FirstLine, MAX_CONTACTNAME);
mir_wstrncpy(ppd.lptzText, SecondLine, MAX_SECONDLINE);
ppd.colorBack = IsErrorMsg ? 0x0202E3 : 0xE8F1FD;
@@ -33,7 +33,7 @@ void ShowMsg(wchar_t *FirstLine, wchar_t *SecondLine, bool IsErrorMsg, int Timeo ppd.iSeconds = Timeout;
PUAddPopupT(&ppd);
}
- else MessageBox(NULL, SecondLine, FirstLine, MB_OK | (IsErrorMsg ? MB_ICONEXCLAMATION : MB_ICONINFORMATION));
+ else MessageBox(nullptr, SecondLine, FirstLine, MB_OK | (IsErrorMsg ? MB_ICONEXCLAMATION : MB_ICONINFORMATION));
}
@@ -53,12 +53,12 @@ static int CALLBACK MenuWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar static VOID CALLBACK ShowContactMenu(MCONTACT hContact)
{
POINT pt;
- HWND hMenuWnd = CreateWindowEx(WS_EX_TOOLWINDOW, L"static", MOD_NAMEW L"_MenuWindow", 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, NULL, g_hInstance, NULL);
+ HWND hMenuWnd = CreateWindowEx(WS_EX_TOOLWINDOW, L"static", MOD_NAMEW L"_MenuWindow", 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, nullptr, g_hInstance, nullptr);
SetWindowLongPtr(hMenuWnd, GWLP_WNDPROC, (LONG_PTR)MenuWndProc);
HMENU hMenu = Menu_BuildContactMenu(hContact);
GetCursorPos(&pt);
SetForegroundWindow(hMenuWnd);
- Clist_MenuProcessCommand(TrackPopupMenu(hMenu, TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD, pt.x, pt.y, 0, hMenuWnd, NULL), MPCF_CONTACTMENU, hContact);
+ Clist_MenuProcessCommand(TrackPopupMenu(hMenu, TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD, pt.x, pt.y, 0, hMenuWnd, nullptr), MPCF_CONTACTMENU, hContact);
PostMessage(hMenuWnd, WM_NULL, 0, 0);
DestroyMenu(hMenu);
DestroyWindow(hMenuWnd);
@@ -66,7 +66,7 @@ static VOID CALLBACK ShowContactMenu(MCONTACT hContact) void ShowLog(TCString &LogFilePath)
{
- INT_PTR Result = (INT_PTR)ShellExecute(NULL, L"open", LogFilePath, NULL, NULL, SW_SHOW);
+ INT_PTR Result = (INT_PTR)ShellExecute(nullptr, L"open", LogFilePath, nullptr, nullptr, SW_SHOW);
if (Result <= 32) {
wchar_t szError[64];
mir_snwprintf(szError, TranslateT("Error #%d"), Result);
diff --git a/plugins/NewAwaySysMod/src/Options.cpp b/plugins/NewAwaySysMod/src/Options.cpp index 9b4ead3136..f0cac57fb3 100644 --- a/plugins/NewAwaySysMod/src/Options.cpp +++ b/plugins/NewAwaySysMod/src/Options.cpp @@ -116,7 +116,7 @@ COptPage& COptPage::operator = (const COptPage& Page) int COptItem::GetIntDBVal(const CString &sModule, int bSigned, CString*)
{ // default procedure for reading value from DB; used only for integral types
- if (sDBSetting != NULL) {
+ if (sDBSetting != nullptr) {
_ASSERT(nValueSize == DBVT_BYTE || nValueSize == DBVT_WORD || nValueSize == DBVT_DWORD);
DBVARIANT dbv;
if (db_get(NULL, sModule, sDBSetting, &dbv))
@@ -129,7 +129,7 @@ int COptItem::GetIntDBVal(const CString &sModule, int bSigned, CString*) void COptItem::SetIntDBVal(const CString &sModule, int m_value, CString*)
{ // default procedure for writing value to the DB; used only for integral types
- if (sDBSetting != NULL && !m_bReadOnly) {
+ if (sDBSetting != nullptr && !m_bReadOnly) {
_ASSERT(nValueSize == DBVT_BYTE || nValueSize == DBVT_WORD || nValueSize == DBVT_DWORD);
DBVARIANT dbv;
@@ -141,7 +141,7 @@ void COptItem::SetIntDBVal(const CString &sModule, int m_value, CString*) TCString COptItem::GetStrDBVal(const CString &sModule, CString *sDBSettingPrefix)
{
- if (sDBSetting != NULL) {
+ if (sDBSetting != nullptr) {
_ASSERT(GetDefValue());
return db_get_s(NULL, sModule, sDBSettingPrefix ? (*sDBSettingPrefix + sDBSetting) : sDBSetting, *(TCString*)GetDefValue());
}
@@ -150,7 +150,7 @@ TCString COptItem::GetStrDBVal(const CString &sModule, CString *sDBSettingPrefix void COptItem::SetStrDBVal(const CString &sModule, TCString &Str, CString *sDBSettingPrefix)
{
- if (sDBSetting != NULL && !m_bReadOnly) {
+ if (sDBSetting != nullptr && !m_bReadOnly) {
db_set_ws(NULL, sModule, sDBSettingPrefix ? (*sDBSettingPrefix + sDBSetting) : sDBSetting, Str);
}
}
@@ -284,9 +284,9 @@ int TreeReadEnum(const char *szSetting, void *lParam) pItem.Flags = Flags;
pItem.hItem = nullptr;
pItem.Title = db_get_s(NULL, pData->sModule, *pData->sDBSettingPrefix + szSetting, L"");
- pItem.User_Str1 = (pData->TreeCtrl->User_Str1_DBName == NULL) ? NULL :
+ pItem.User_Str1 = (pData->TreeCtrl->User_Str1_DBName == nullptr) ? nullptr :
db_get_s(NULL, pData->sModule,
- *pData->sDBSettingPrefix + pData->TreeCtrl->sDBSetting + pData->TreeCtrl->User_Str1_DBName + (szSetting + Len), (wchar_t*)NULL);
+ *pData->sDBSettingPrefix + pData->TreeCtrl->sDBSetting + pData->TreeCtrl->User_Str1_DBName + (szSetting + Len), (wchar_t*)nullptr);
}
}
return 0;
@@ -306,7 +306,7 @@ void COptItem_TreeCtrl::DBToMem(const CString &sModule, CString *sDBSettingPrefi }
else {
for (int i = 0; i < m_value.GetSize(); i++) {
- if (m_value[i].Title == NULL) {
+ if (m_value[i].Title == nullptr) {
m_value.RemoveElem(i);
i--;
}
@@ -334,7 +334,7 @@ void COptItem_TreeCtrl::MemToDB(const CString &sModule, CString *sDBSettingPrefi if (!(TreeFlags & TREECTRL_FLAG_IS_SINGLE_LEVEL) || TreeFlags & TREECTRL_FLAG_HAS_CHECKBOXES)
db_set_b(NULL, sModule, *sDBSettingPrefix + sDBSetting + TREEITEM_DBSTR_FLAGS + StrID, m_value[i].Flags);
- if (User_Str1_DBName != NULL && m_value[i].User_Str1 != NULL)
+ if (User_Str1_DBName != nullptr && m_value[i].User_Str1 != nullptr)
db_set_ws(NULL, sModule, *sDBSettingPrefix + sDBSetting + User_Str1_DBName + StrID, m_value[i].User_Str1);
}
COptItem::MemToDB(sModule, sDBSettingPrefix);
@@ -414,7 +414,7 @@ void COptItem_TreeCtrl::MemToWnd(HWND hWnd) i--;
}
}
- TreeView_SelectItem(hTreeView, (SelectOrder >= 0) ? m_value[SelectOrder].hItem : ((SelectOrder <= TREECTRL_ROOTORDEROFFS) ? RootItems[ROOT_ORDER_TO_INDEX(SelectOrder)].hItem : NULL));
+ TreeView_SelectItem(hTreeView, (SelectOrder >= 0) ? m_value[SelectOrder].hItem : ((SelectOrder <= TREECTRL_ROOTORDEROFFS) ? RootItems[ROOT_ORDER_TO_INDEX(SelectOrder)].hItem : nullptr));
SendMessage(hTreeView, WM_SETREDRAW, true, 0);
SCROLLBARINFO sbi;
sbi.cbSize = sizeof(sbi);
@@ -460,7 +460,7 @@ int TreeDeleteEnum(const char *szSetting, void *lParam) if (!strncmp(szSetting, CurSetting, CurSetting.GetLen()))
TreeDeleteEnumData->TreeSettings.AddElem(szSetting);
- if (TreeDeleteEnumData->TreeCtrl->User_Str1_DBName != NULL) {
+ if (TreeDeleteEnumData->TreeCtrl->User_Str1_DBName != nullptr) {
CurSetting = *TreeDeleteEnumData->sDBSettingPrefix + TreeDeleteEnumData->TreeCtrl->sDBSetting + TreeDeleteEnumData->TreeCtrl->User_Str1_DBName;
if (!strncmp(szSetting, CurSetting, CurSetting.GetLen()))
TreeDeleteEnumData->TreeSettings.AddElem(szSetting);
@@ -668,7 +668,7 @@ void COptItem_ListCtrl::DBToMem(const CString &sModule, CString *sDBSettingPrefi m_value = m_defValue;
else {
for (int i = 0; i < m_value.GetSize(); i++) {
- if (m_value[i].Text == NULL) {
+ if (m_value[i].Text == nullptr) {
m_value.RemoveElem(i);
i--;
}
diff --git a/plugins/NewAwaySysMod/src/Options.h b/plugins/NewAwaySysMod/src/Options.h index aac3e9d1c0..2b06244c44 100644 --- a/plugins/NewAwaySysMod/src/Options.h +++ b/plugins/NewAwaySysMod/src/Options.h @@ -33,23 +33,23 @@ public: virtual ~COptItem() {}
- virtual void DBToMem(const CString&, CString* = NULL) { m_bModified = false; }
- virtual void MemToDB(const CString&, CString* = NULL) { m_bModified = false; }
+ virtual void DBToMem(const CString&, CString* = nullptr) { m_bModified = false; }
+ virtual void MemToDB(const CString&, CString* = nullptr) { m_bModified = false; }
virtual void WndToMem(HWND) {}
virtual void MemToWnd(HWND hWnd) { EnableWindow(GetDlgItem(hWnd, m_dlgItemID), m_bEnabled); }
- void DBToMemToWnd(const CString &sModule, HWND hWnd, CString *sDBSettingPrefix = NULL) { DBToMem(sModule, sDBSettingPrefix); MemToWnd(hWnd); }
- void WndToMemToDB(HWND hWnd, const CString &sModule, CString *sDBSettingPrefix = NULL) { WndToMem(hWnd); MemToDB(sModule, sDBSettingPrefix); }
- virtual void CleanDBSettings(const CString &sModule, CString *sDBSettingPrefix = NULL) { db_unset(NULL, sModule, sDBSettingPrefix ? (*sDBSettingPrefix + sDBSetting) : sDBSetting); }; // TODO: also set m_value to m_defValue?
+ void DBToMemToWnd(const CString &sModule, HWND hWnd, CString *sDBSettingPrefix = nullptr) { DBToMem(sModule, sDBSettingPrefix); MemToWnd(hWnd); }
+ void WndToMemToDB(HWND hWnd, const CString &sModule, CString *sDBSettingPrefix = nullptr) { WndToMem(hWnd); MemToDB(sModule, sDBSettingPrefix); }
+ virtual void CleanDBSettings(const CString &sModule, CString *sDBSettingPrefix = nullptr) { db_unset(NULL, sModule, sDBSettingPrefix ? (*sDBSettingPrefix + sDBSetting) : sDBSetting); }; // TODO: also set m_value to m_defValue?
virtual void SetValue(INT_PTR) { m_bModified = true; }
virtual void SetDefValue(INT_PTR) {}
virtual INT_PTR GetValue() { return 0; }
virtual INT_PTR GetDefValue() { return 0; }
- INT_PTR GetDBValue(const CString &sModule, CString *sDBSettingPrefix = NULL) { DBToMem(sModule, sDBSettingPrefix); return GetValue(); }
- void SetDBValue(const CString &sModule, INT_PTR m_value, CString *sDBSettingPrefix = NULL) { SetValue(m_value); MemToDB(sModule, sDBSettingPrefix); }
- INT_PTR GetDBValueCopy(const CString &sModule, CString *sDBSettingPrefix = NULL) { COptItem* Item = Copy(); Item->DBToMem(sModule, sDBSettingPrefix); INT_PTR m_value = Item->GetValue(); delete Item; return m_value; } // retrieves DB value, but doesn't affect current page/item state; beware! it doesn't work with string values / other dynamic pointers
- void SetDBValueCopy(const CString &sModule, INT_PTR m_value, CString *sDBSettingPrefix = NULL) { COptItem* Item = Copy(); Item->SetValue(m_value); Item->MemToDB(sModule, sDBSettingPrefix); delete Item; }
+ INT_PTR GetDBValue(const CString &sModule, CString *sDBSettingPrefix = nullptr) { DBToMem(sModule, sDBSettingPrefix); return GetValue(); }
+ void SetDBValue(const CString &sModule, INT_PTR m_value, CString *sDBSettingPrefix = nullptr) { SetValue(m_value); MemToDB(sModule, sDBSettingPrefix); }
+ INT_PTR GetDBValueCopy(const CString &sModule, CString *sDBSettingPrefix = nullptr) { COptItem* Item = Copy(); Item->DBToMem(sModule, sDBSettingPrefix); INT_PTR m_value = Item->GetValue(); delete Item; return m_value; } // retrieves DB value, but doesn't affect current page/item state; beware! it doesn't work with string values / other dynamic pointers
+ void SetDBValueCopy(const CString &sModule, INT_PTR m_value, CString *sDBSettingPrefix = nullptr) { COptItem* Item = Copy(); Item->SetValue(m_value); Item->MemToDB(sModule, sDBSettingPrefix); delete Item; }
INT_PTR GetWndValue(HWND hWnd) { WndToMem(hWnd); return GetValue(); }
void SetWndValue(HWND hWnd, INT_PTR m_value) { SetValue(m_value); MemToWnd(hWnd); }
@@ -62,15 +62,15 @@ public: int GetID() { return m_dlgItemID; }
// virtual COptItem& operator = (const COptItem& Item) {return *this;};
- virtual COptItem* Copy() { _ASSERT(0); return NULL; } // Attention! Free Copy() result when it's not needed anymore!
+ virtual COptItem* Copy() { _ASSERT(0); return nullptr; } // Attention! Free Copy() result when it's not needed anymore!
CString sDBSetting;
protected:
- int GetIntDBVal(const CString &sModule, int bSigned = false, CString *sDBSettingPrefix = NULL);
- void SetIntDBVal(const CString &sModule, int m_value, CString *sDBSettingPrefix = NULL);
- TCString GetStrDBVal(const CString &sModule, CString *sDBSettingPrefix = NULL);
- void SetStrDBVal(const CString &sModule, TCString &Str, CString *sDBSettingPrefix = NULL);
+ int GetIntDBVal(const CString &sModule, int bSigned = false, CString *sDBSettingPrefix = nullptr);
+ void SetIntDBVal(const CString &sModule, int m_value, CString *sDBSettingPrefix = nullptr);
+ TCString GetStrDBVal(const CString &sModule, CString *sDBSettingPrefix = nullptr);
+ void SetStrDBVal(const CString &sModule, TCString &Str, CString *sDBSettingPrefix = nullptr);
int m_dlgItemID;
bool m_bEnabled;
@@ -84,7 +84,7 @@ class COptItem_Generic : public COptItem {
public:
COptItem_Generic() {}
- COptItem_Generic(int m_dlgItemID, int lParam = 0) : COptItem(m_dlgItemID, NULL, 0, lParam) {}
+ COptItem_Generic(int m_dlgItemID, int lParam = 0) : COptItem(m_dlgItemID, nullptr, 0, lParam) {}
virtual COptItem* Copy() { return new COptItem_Generic(*this); }
};
@@ -96,8 +96,8 @@ public: : COptItem(m_dlgItemID, szDBSetting, nMaxLen, lParam, m_bReadOnly), sDefValue(szDefValue)
{}
- void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL) { sValue = GetStrDBVal(sModule, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
- void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL) { SetStrDBVal(sModule, sValue, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
+ void DBToMem(const CString &sModule, CString *sDBSettingPrefix = nullptr) { sValue = GetStrDBVal(sModule, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
+ void MemToDB(const CString &sModule, CString *sDBSettingPrefix = nullptr) { SetStrDBVal(sModule, sValue, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
void WndToMem(HWND hWnd) { GetDlgItemText(hWnd, m_dlgItemID, sValue.GetBuffer(nValueSize), nValueSize); sValue.ReleaseBuffer(); COptItem::MemToWnd(hWnd); }
void MemToWnd(HWND hWnd) { SetDlgItemText(hWnd, m_dlgItemID, sValue); COptItem::MemToWnd(hWnd); }
@@ -123,9 +123,9 @@ public: : COptItem(m_dlgItemID, szDBSetting, nValueSize, lParam, m_bReadOnly), m_defValue(m_defValue), m_value(0), bSigned(bSigned)
{}
- void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL) { m_value = GetIntDBVal(sModule, bSigned, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
- void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL) { SetIntDBVal(sModule, m_value, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
- void WndToMem(HWND hWnd) { m_value = GetDlgItemInt(hWnd, m_dlgItemID, NULL, bSigned); COptItem::WndToMem(hWnd); }
+ void DBToMem(const CString &sModule, CString *sDBSettingPrefix = nullptr) { m_value = GetIntDBVal(sModule, bSigned, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
+ void MemToDB(const CString &sModule, CString *sDBSettingPrefix = nullptr) { SetIntDBVal(sModule, m_value, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
+ void WndToMem(HWND hWnd) { m_value = GetDlgItemInt(hWnd, m_dlgItemID, nullptr, bSigned); COptItem::WndToMem(hWnd); }
void MemToWnd(HWND hWnd) { SetDlgItemInt(hWnd, m_dlgItemID, m_value, bSigned); COptItem::MemToWnd(hWnd); }
virtual void SetValue(INT_PTR _Value) { this->m_value = _Value; COptItem::SetValue(_Value); }
@@ -149,8 +149,8 @@ public: : COptItem(m_dlgItemID, szDBSetting, nValueSize, lParam, m_bReadOnly), m_defValue(m_defValue), m_value(0), m_valueMask(m_valueMask)
{}
- void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL);
- void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL);
+ void DBToMem(const CString &sModule, CString *sDBSettingPrefix = nullptr);
+ void MemToDB(const CString &sModule, CString *sDBSettingPrefix = nullptr);
void WndToMem(HWND hWnd);
void MemToWnd(HWND hWnd);
@@ -175,8 +175,8 @@ public: : COptItem(m_dlgItemID, szDBSetting, nValueSize, lParam, m_bReadOnly), m_defValue(m_defValue), m_value(0), m_valueMask(m_valueMask)
{}
- void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL) { m_value = (GetIntDBVal(sModule, false, sDBSettingPrefix) == m_valueMask) ? BST_CHECKED : BST_UNCHECKED; COptItem::DBToMem(sModule, sDBSettingPrefix); }
- void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL) { if ((m_value == BST_CHECKED)) SetIntDBVal(sModule, m_valueMask, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
+ void DBToMem(const CString &sModule, CString *sDBSettingPrefix = nullptr) { m_value = (GetIntDBVal(sModule, false, sDBSettingPrefix) == m_valueMask) ? BST_CHECKED : BST_UNCHECKED; COptItem::DBToMem(sModule, sDBSettingPrefix); }
+ void MemToDB(const CString &sModule, CString *sDBSettingPrefix = nullptr) { if ((m_value == BST_CHECKED)) SetIntDBVal(sModule, m_valueMask, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
void WndToMem(HWND hWnd) { m_value = IsDlgButtonChecked(hWnd, m_dlgItemID); COptItem::WndToMem(hWnd); }
void MemToWnd(HWND hWnd) { CheckDlgButton(hWnd, m_dlgItemID, m_value ? BST_CHECKED : BST_UNCHECKED); COptItem::MemToWnd(hWnd); }
@@ -201,8 +201,8 @@ public: : COptItem(m_dlgItemID, szDBSetting, nValueSize, lParam, m_bReadOnly), m_defValue(m_defValue), m_value(0)
{}
- void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL) { m_value = GetIntDBVal(sModule, false, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
- void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL) { SetIntDBVal(sModule, m_value, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
+ void DBToMem(const CString &sModule, CString *sDBSettingPrefix = nullptr) { m_value = GetIntDBVal(sModule, false, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
+ void MemToDB(const CString &sModule, CString *sDBSettingPrefix = nullptr) { SetIntDBVal(sModule, m_value, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
void WndToMem(HWND hWnd) { m_value = SendDlgItemMessage(hWnd, m_dlgItemID, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hWnd, m_dlgItemID, CB_GETCURSEL, 0, 0), 0); COptItem::WndToMem(hWnd); }
void MemToWnd(HWND hWnd) { SendDlgItemMessage(hWnd, m_dlgItemID, CB_SETCURSEL, m_value, 0); COptItem::MemToWnd(hWnd); }
@@ -226,8 +226,8 @@ public: : COptItem(m_dlgItemID, szDBSetting, DBVT_DWORD, lParam, m_bReadOnly), m_defValue(m_defValue), m_value(0)
{}
- void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL) { m_value = GetIntDBVal(sModule, false, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
- void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL) { SetIntDBVal(sModule, m_value, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
+ void DBToMem(const CString &sModule, CString *sDBSettingPrefix = nullptr) { m_value = GetIntDBVal(sModule, false, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
+ void MemToDB(const CString &sModule, CString *sDBSettingPrefix = nullptr) { SetIntDBVal(sModule, m_value, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
void WndToMem(HWND hWnd) { m_value = SendDlgItemMessage(hWnd, m_dlgItemID, CPM_GETCOLOUR, 0, 0); COptItem::WndToMem(hWnd); }
void MemToWnd(HWND hWnd) { SendDlgItemMessage(hWnd, m_dlgItemID, CPM_SETCOLOUR, 0, m_value); COptItem::MemToWnd(hWnd); }
@@ -252,8 +252,8 @@ public: : COptItem(m_dlgItemID, szDBSetting, nValueSize, lParam, m_bReadOnly), m_defValue(m_defValue), m_value(0)
{}
- void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL) { m_value = GetIntDBVal(sModule, false, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
- void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL) { SetIntDBVal(sModule, m_value, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
+ void DBToMem(const CString &sModule, CString *sDBSettingPrefix = nullptr) { m_value = GetIntDBVal(sModule, false, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
+ void MemToDB(const CString &sModule, CString *sDBSettingPrefix = nullptr) { SetIntDBVal(sModule, m_value, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
void WndToMem(HWND hWnd) { m_value = SendDlgItemMessage(hWnd, m_dlgItemID, TBM_GETPOS, 0, 0); COptItem::WndToMem(hWnd); }
void MemToWnd(HWND hWnd) { SendDlgItemMessage(hWnd, m_dlgItemID, TBM_SETPOS, true, m_value); COptItem::MemToWnd(hWnd); }
@@ -277,8 +277,8 @@ public: : COptItem(m_dlgItemID, szDBSetting, nValueSize, lParam, m_bReadOnly), m_defValue(m_defValue), m_value(0), bSigned(bSigned)
{}
- void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL) { m_value = GetIntDBVal(sModule, bSigned, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
- void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL) { SetIntDBVal(sModule, m_value, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
+ void DBToMem(const CString &sModule, CString *sDBSettingPrefix = nullptr) { m_value = GetIntDBVal(sModule, bSigned, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
+ void MemToDB(const CString &sModule, CString *sDBSettingPrefix = nullptr) { SetIntDBVal(sModule, m_value, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
void WndToMem(HWND hWnd) { COptItem::WndToMem(hWnd); }
void MemToWnd(HWND hWnd) { COptItem::MemToWnd(hWnd); }
@@ -301,8 +301,8 @@ public: COptItem_BitDBSetting() {}
COptItem_BitDBSetting(int m_dlgItemID, char *szDBSetting, int nValueSize = DBVT_BYTE, int m_defValue = 0, int m_valueMask = 0, int lParam = 0, bool m_bReadOnly = false) : COptItem(m_dlgItemID, szDBSetting, nValueSize, lParam, m_bReadOnly), m_defValue(m_defValue), m_value(0), m_valueMask(m_valueMask) {}
- void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL);
- void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL);
+ void DBToMem(const CString &sModule, CString *sDBSettingPrefix = nullptr);
+ void MemToDB(const CString &sModule, CString *sDBSettingPrefix = nullptr);
void WndToMem(HWND hWnd) { COptItem::WndToMem(hWnd); }
void MemToWnd(HWND hWnd) { COptItem::MemToWnd(hWnd); }
@@ -324,8 +324,8 @@ class COptItem_StrDBSetting : public COptItem public:
COptItem_StrDBSetting() {}
COptItem_StrDBSetting(int m_dlgItemID, char *szDBSetting, int nMaxLen, wchar_t *szDefValue, int lParam = 0, bool m_bReadOnly = false) : COptItem(m_dlgItemID, szDBSetting, nMaxLen, lParam, m_bReadOnly), sDefValue(szDefValue) {}
- void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL) { sValue = GetStrDBVal(sModule, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
- void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL) { SetStrDBVal(sModule, sValue, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
+ void DBToMem(const CString &sModule, CString *sDBSettingPrefix = nullptr) { sValue = GetStrDBVal(sModule, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
+ void MemToDB(const CString &sModule, CString *sDBSettingPrefix = nullptr) { SetStrDBVal(sModule, sValue, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
void WndToMem(HWND hWnd) { COptItem::WndToMem(hWnd); }
void MemToWnd(HWND hWnd) { COptItem::MemToWnd(hWnd); }
@@ -352,7 +352,7 @@ class CBaseTreeItem {
public:
CBaseTreeItem();
- CBaseTreeItem(TCString Title, int ID, int Flags) : Title(Title), ID(ID), Flags(Flags), hItem(NULL) {}
+ CBaseTreeItem(TCString Title, int ID, int Flags) : Title(Title), ID(ID), Flags(Flags), hItem(nullptr) {}
TCString Title;
int ID;
@@ -364,7 +364,7 @@ class CTreeItem : public CBaseTreeItem {
public:
CTreeItem();
- CTreeItem(TCString Title, int ParentID, int ID, int Flags = 0, TCString User_Str1 = NULL) :
+ CTreeItem(TCString Title, int ParentID, int ID, int Flags = 0, TCString User_Str1 = nullptr) :
CBaseTreeItem(Title, ID, Flags & ~TIF_ROOTITEM), ParentID(ParentID), User_Str1(User_Str1)
{
}
@@ -402,7 +402,7 @@ class COptItem_TreeCtrl : public COptItem {
public:
COptItem_TreeCtrl() {}
- COptItem_TreeCtrl(int m_dlgItemID, char *szDBSetting, TreeItemArray &m_defValue, TreeRootItemArray RootItems, int lParam = 0, CString User_Str1_DBName = NULL, bool m_bReadOnly = false, int TreeFlags = 0) : COptItem(m_dlgItemID, szDBSetting, DBVT_DWORD, lParam, m_bReadOnly), m_defValue(m_defValue), RootItems(RootItems), User_Str1_DBName(User_Str1_DBName), TreeFlags(TreeFlags)
+ COptItem_TreeCtrl(int m_dlgItemID, char *szDBSetting, TreeItemArray &m_defValue, TreeRootItemArray RootItems, int lParam = 0, CString User_Str1_DBName = nullptr, bool m_bReadOnly = false, int TreeFlags = 0) : COptItem(m_dlgItemID, szDBSetting, DBVT_DWORD, lParam, m_bReadOnly), m_defValue(m_defValue), RootItems(RootItems), User_Str1_DBName(User_Str1_DBName), TreeFlags(TreeFlags)
{
if (TreeFlags & TREECTRL_FLAG_IS_SINGLE_LEVEL) {
_ASSERT(!RootItems.GetSize()); // there can't be any root items when the tree is a plain list
@@ -411,11 +411,11 @@ public: }
}
~COptItem_TreeCtrl() {}
- void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL);
- void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL);
+ void DBToMem(const CString &sModule, CString *sDBSettingPrefix = nullptr);
+ void MemToDB(const CString &sModule, CString *sDBSettingPrefix = nullptr);
void WndToMem(HWND hWnd);
void MemToWnd(HWND hWnd);
- void CleanDBSettings(const CString &sModule, CString *sDBSettingPrefix = NULL);
+ void CleanDBSettings(const CString &sModule, CString *sDBSettingPrefix = nullptr);
virtual void SetValue(INT_PTR _Value) { this->m_value = *(TreeItemArray*)_Value; COptItem::SetValue(_Value); }
virtual void SetDefValue(INT_PTR _DefValue) { this->m_defValue = *(TreeItemArray*)_DefValue; COptItem::SetDefValue(_DefValue); }
@@ -463,11 +463,11 @@ public: COptItem_ListCtrl() {}
COptItem_ListCtrl(int m_dlgItemID, char *szDBSetting, ListItemArray &m_defValue, int lParam = 0, bool m_bReadOnly = false) : COptItem(m_dlgItemID, szDBSetting, DBVT_DWORD, lParam, m_bReadOnly), m_defValue(m_defValue) {}
~COptItem_ListCtrl() {}
- void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL);
- void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL);
+ void DBToMem(const CString &sModule, CString *sDBSettingPrefix = nullptr);
+ void MemToDB(const CString &sModule, CString *sDBSettingPrefix = nullptr);
void WndToMem(HWND hWnd);
void MemToWnd(HWND hWnd);
- void CleanDBSettings(const CString &sModule, CString *sDBSettingPrefix = NULL);
+ void CleanDBSettings(const CString &sModule, CString *sDBSettingPrefix = nullptr);
virtual void SetValue(INT_PTR _Value) { this->m_value = *(ListItemArray*)_Value; COptItem::SetValue(_Value); }
virtual void SetDefValue(INT_PTR _DefValue) { this->m_defValue = *(ListItemArray*)_DefValue; COptItem::SetDefValue(_DefValue); }
@@ -490,7 +490,7 @@ public: class COptPage
{
public:
- COptPage() : hWnd(NULL), sDBSettingPrefix("") {}
+ COptPage() : hWnd(nullptr), sDBSettingPrefix("") {}
COptPage(char *szModule, HWND hWnd, CString sDBSettingPrefix = "") : sModule(szModule), hWnd(hWnd), sDBSettingPrefix(sDBSettingPrefix) {}
COptPage(const COptPage &Item);
~COptPage();
diff --git a/plugins/NewAwaySysMod/src/Properties.cpp b/plugins/NewAwaySysMod/src/Properties.cpp index a48da5b3ee..7fc0fa32a5 100644 --- a/plugins/NewAwaySysMod/src/Properties.cpp +++ b/plugins/NewAwaySysMod/src/Properties.cpp @@ -40,7 +40,7 @@ void ResetSettingsOnStatusChange(const char *szProto = nullptr, int bResetPerson if (!szProto || ((szCurProto = GetContactProto(hContact)) && !mir_strcmp(szProto, szCurProto))) {
ResetContactSettingsOnStatusChange(hContact);
if (bResetPersonalMsgs) {
- CContactSettings(Status, hContact).SetMsgFormat(SMF_PERSONAL, NULL); // TODO: delete only when SAM dialog opens?
+ CContactSettings(Status, hContact).SetMsgFormat(SMF_PERSONAL, nullptr); // TODO: delete only when SAM dialog opens?
}
}
hContact = db_find_next(hContact);
@@ -83,7 +83,7 @@ CProtoState::CStatus& CProtoState::CStatus::operator = (int Status) bModified = true;
}
if (g_MoreOptPage.GetDBValueCopy(IDC_MOREOPTDLG_RESETPROTOMSGS))
- CProtoSettings(State.m_szProto, Status).SetMsgFormat(SMF_PERSONAL, NULL);
+ CProtoSettings(State.m_szProto, Status).SetMsgFormat(SMF_PERSONAL, nullptr);
}
}
if (bStatusModified)
@@ -107,12 +107,12 @@ void CProtoState::CAwaySince::Reset() void CContactSettings::SetMsgFormat(int Flags, TCString Message)
{
if (Flags & SMF_PERSONAL) { // set a personal message for a contact. also it's used to set global status message (hContact = NULL).
- // if Message == NULL, then the function deletes the message.
+ // if Message == nullptr, then the function deletes the message.
CString DBSetting(StatusToDBSetting(Status, DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPERSONAL));
if (g_AutoreplyOptPage.GetDBValueCopy(IDC_REPLYDLG_RESETCOUNTERWHENSAMEICON) && GetMsgFormat(SMF_PERSONAL) != (const wchar_t*)Message)
ResetContactSettingsOnStatusChange(m_hContact);
- if (Message != NULL)
+ if (Message != nullptr)
db_set_ws(m_hContact, MOD_NAME, DBSetting, Message);
else
db_unset(m_hContact, MOD_NAME, DBSetting);
@@ -130,7 +130,7 @@ TCString CContactSettings::GetMsgFormat(int Flags, int *pOrder, char *szProtoOve // szProtoOverride is needed only to get status message of the right protocol when the ICQ contact is on list, but not with the same
// protocol on which it requests the message - this way we can still get contact details.
{
- TCString Message = NULL;
+ TCString Message = nullptr;
if (pOrder)
*pOrder = -1;
@@ -138,7 +138,7 @@ TCString CContactSettings::GetMsgFormat(int Flags, int *pOrder, char *szProtoOve Message = db_get_s(m_hContact, MOD_NAME, StatusToDBSetting(Status, DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPERSONAL), (wchar_t*)NULL);
if (Flags & (GMF_LASTORDEFAULT | GMF_PROTOORGLOBAL | GMF_TEMPORARY) && Message.IsEmpty()) {
- char *szProto = szProtoOverride ? szProtoOverride : (m_hContact ? GetContactProto(m_hContact) : NULL);
+ char *szProto = szProtoOverride ? szProtoOverride : (m_hContact ? GetContactProto(m_hContact) : nullptr);
// we mustn't pass here by GMF_TEMPORARY flag, as otherwise we'll handle GMF_TEMPORARY | GMF_PERSONAL combination incorrectly,
// which is supposed to get only per-contact messages, and at the same time also may be used with NULL contact to get the global status message
@@ -159,18 +159,18 @@ void CProtoSettings::SetMsgFormat(int Flags, TCString Message) if (Flags & SMF_TEMPORARY) {
_ASSERT(!Status || Status == g_ProtoStates[szProto].m_status);
- g_ProtoStates[szProto].TempMsg = (szProto || Message != NULL) ? Message : CProtoSettings(NULL, Status).GetMsgFormat(GMF_LASTORDEFAULT);
+ g_ProtoStates[szProto].TempMsg = (szProto || Message != nullptr) ? Message : CProtoSettings(nullptr, Status).GetMsgFormat(GMF_LASTORDEFAULT);
}
if (Flags & SMF_PERSONAL) { // set a "personal" message for a protocol. also it's used to set global status message (hContact = NULL).
// if Message == NULL, then we'll use the "default" message - i.e. it's either the global message for szProto != NULL (we delete the per-proto DB setting), or it's just a default message for a given status for szProto == NULL.
g_ProtoStates[szProto].TempMsg.Unset();
CString DBSetting(ProtoStatusToDBSetting(DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPROTOMSGS));
- if (Message != NULL)
+ if (Message != nullptr)
db_set_ws(NULL, MOD_NAME, DBSetting, Message);
else {
if (!szProto)
- db_set_ws(NULL, MOD_NAME, DBSetting, CProtoSettings(NULL, Status).GetMsgFormat(GMF_LASTORDEFAULT)); // global message can't be NULL; we can use an empty string instead if it's really necessary
+ db_set_ws(NULL, MOD_NAME, DBSetting, CProtoSettings(nullptr, Status).GetMsgFormat(GMF_LASTORDEFAULT)); // global message can't be NULL; we can use an empty string instead if it's really necessary
else
db_unset(NULL, MOD_NAME, DBSetting);
}
@@ -254,7 +254,7 @@ void CProtoSettings::SetMsgFormat(int Flags, TCString Message) // returns the requested message; sets Order to the order of the message in the message tree, if available; or to -1 otherwise.
TCString CProtoSettings::GetMsgFormat(int Flags, int *pOrder)
{
- TCString Message = NULL;
+ TCString Message = nullptr;
if (pOrder)
*pOrder = -1;
@@ -265,23 +265,23 @@ TCString CProtoSettings::GetMsgFormat(int Flags, int *pOrder) Flags &= ~GMF_PERSONAL; // don't allow personal message to overwrite our NULL temporary message
}
}
- if (Flags & GMF_PERSONAL && Message == NULL) // try getting personal message (it overrides global)
- Message = db_get_s(NULL, MOD_NAME, ProtoStatusToDBSetting(DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPROTOMSGS), (wchar_t*)NULL);
+ if (Flags & GMF_PERSONAL && Message == nullptr) // try getting personal message (it overrides global)
+ Message = db_get_s(NULL, MOD_NAME, ProtoStatusToDBSetting(DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPROTOMSGS), (wchar_t*)nullptr);
- if (Flags & GMF_PROTOORGLOBAL && Message == NULL) {
+ if (Flags & GMF_PROTOORGLOBAL && Message == nullptr) {
Message = CProtoSettings().GetMsgFormat(GMF_PERSONAL | (Flags & GMF_TEMPORARY), pOrder);
- return (Message == NULL) ? L"" : Message; // global message can't be NULL
+ return (Message == nullptr) ? L"" : Message; // global message can't be NULL
}
- if (Flags & GMF_LASTORDEFAULT && Message == NULL) { // try to get the last or default message, depending on current settings
+ if (Flags & GMF_LASTORDEFAULT && Message == nullptr) { // try to get the last or default message, depending on current settings
COptPage MsgTreeData(g_MsgTreePage);
COptItem_TreeCtrl *TreeCtrl = (COptItem_TreeCtrl*)MsgTreeData.Find(IDV_MSGTREE);
TreeCtrl->DBToMem(CString(MOD_NAME));
- Message = NULL;
+ Message = nullptr;
if (g_MoreOptPage.GetDBValueCopy(IDC_MOREOPTDLG_USELASTMSG)) { // if using last message by default...
- Message = db_get_s(NULL, MOD_NAME, ProtoStatusToDBSetting(DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPROTOMSGS), (wchar_t*)NULL); // try per-protocol message first
+ Message = db_get_s(NULL, MOD_NAME, ProtoStatusToDBSetting(DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPROTOMSGS), (wchar_t*)nullptr); // try per-protocol message first
if (Message.IsEmpty()) {
- Message = NULL; // to be sure it's NULL, not "" - as we're checking 'Message == NULL' later
+ Message = nullptr; // to be sure it's NULL, not "" - as we're checking 'Message == NULL' later
int RecentGroupID = GetRecentGroupID(Status);
if (RecentGroupID != -1) {
for (int i = 0; i < TreeCtrl->m_value.GetSize(); i++) { // find first message in the group
@@ -296,7 +296,7 @@ TCString CProtoSettings::GetMsgFormat(int Flags, int *pOrder) }
} // else, if using default message by default...
- if (Message == NULL) { // ...or we didn't succeed retrieving the last message
+ if (Message == nullptr) { // ...or we didn't succeed retrieving the last message
// get default message for this status
int DefMsgID = -1;
static struct {
@@ -330,7 +330,7 @@ TCString CProtoSettings::GetMsgFormat(int Flags, int *pOrder) if (pOrder)
*pOrder = Order;
}
- if (Message == NULL)
+ if (Message == nullptr)
Message = L""; // last or default message can't be NULL.. otherwise ICQ won't reply to status message requests and won't notify us of status message requests at all
}
return Message;
diff --git a/plugins/NewAwaySysMod/src/Properties.h b/plugins/NewAwaySysMod/src/Properties.h index e31053ef42..64180a6405 100644 --- a/plugins/NewAwaySysMod/src/Properties.h +++ b/plugins/NewAwaySysMod/src/Properties.h @@ -33,7 +33,7 @@ class _CWndUserData
{
public:
- _CWndUserData(): MsgTree(NULL), CList(NULL) {}
+ _CWndUserData(): MsgTree(nullptr), CList(nullptr) {}
CMsgTree *MsgTree;
CCList *CList;
@@ -129,7 +129,7 @@ public: if (Icons[i] & IL_SKINICON)
IconList.SetAtGrow(i) = (HICON)CopyImage(Skin_LoadIcon(Icons[i] & ~IL_SKINICON), IMAGE_ICON, cxIcon, cyIcon, LR_COPYFROMRESOURCE);
else if (Icons[i] & IL_PROTOICON)
- IconList.SetAtGrow(i) = (HICON)CopyImage(Skin_LoadProtoIcon(NULL, Icons[i] & ~IL_PROTOICON), IMAGE_ICON, cxIcon, cyIcon, LR_COPYFROMRESOURCE);
+ IconList.SetAtGrow(i) = (HICON)CopyImage(Skin_LoadProtoIcon(nullptr, Icons[i] & ~IL_PROTOICON), IMAGE_ICON, cxIcon, cyIcon, LR_COPYFROMRESOURCE);
else
IconList.SetAtGrow(i) = (HICON)GetIcon(Icons[i]);
}
@@ -178,7 +178,7 @@ public: class CCurStatusMsg
{
public:
- CCurStatusMsg() {*this = NULL;}
+ CCurStatusMsg() {*this = nullptr;}
CCurStatusMsg& operator = (TCString Msg)
{
CurStatusMsg = Msg;
@@ -306,7 +306,7 @@ class CProtoSettings LPCSTR szProto;
public:
- CProtoSettings(LPCSTR szProto = NULL, int iStatus = 0) :
+ CProtoSettings(LPCSTR szProto = nullptr, int iStatus = 0) :
szProto(szProto),
Status(iStatus, szProto)
{
@@ -349,7 +349,7 @@ public: {
_ASSERT(Parent->szProto);
int m_value = *this;
- return (m_value == VAL_USEDEFAULT) ? CProtoSettings(NULL).Autoreply : m_value;
+ return (m_value == VAL_USEDEFAULT) ? CProtoSettings(nullptr).Autoreply : m_value;
}
friend class CProtoSettings;
private:
@@ -359,7 +359,7 @@ public: class CStatus
{
public:
- CStatus(int iStatus = 0, const char *szProto = NULL): Status(iStatus), szProto(szProto) {}
+ CStatus(int iStatus = 0, const char *szProto = nullptr): Status(iStatus), szProto(szProto) {}
CStatus& operator = (int _Status) {this->Status = _Status; return *this;}
operator int()
{
@@ -373,7 +373,7 @@ public: } Status;
void SetMsgFormat(int Flags, TCString Message);
- TCString GetMsgFormat(int Flags, int *pOrder = NULL);
+ TCString GetMsgFormat(int Flags, int *pOrder = nullptr);
};
@@ -458,7 +458,7 @@ public: return *this;
}
operator int() {return db_get_b((Parent->m_hContact != INVALID_CONTACT_ID) ? Parent->m_hContact : NULL, MOD_NAME, Parent->ContactStatusToDBSetting(DB_ENABLEREPLY, IDC_MOREOPTDLG_PERSTATUSPERSONALSETTINGS), Parent->m_hContact ? VAL_USEDEFAULT : AUTOREPLY_DEF_REPLY);}
- int IncludingParents(const char *szProtoOverride = NULL) // takes into account protocol and global data also, if per-contact setting is not defined
+ int IncludingParents(const char *szProtoOverride = nullptr) // takes into account protocol and global data also, if per-contact setting is not defined
{
_ASSERT((Parent->m_hContact && Parent->m_hContact != INVALID_CONTACT_ID) || szProtoOverride); // we need either correct protocol or a correct hContact to determine its protocol
int m_value = *this;
@@ -491,7 +491,7 @@ public: {
if (!Status) {
_ASSERT(m_hContact != INVALID_CONTACT_ID);
- char *szProto = m_hContact ? GetContactProto(m_hContact) : NULL;
+ char *szProto = m_hContact ? GetContactProto(m_hContact) : nullptr;
Status = (szProto || !m_hContact) ? g_ProtoStates[szProto].m_status : ID_STATUS_AWAY;
}
return Status;
@@ -504,5 +504,5 @@ public: } Status;
void SetMsgFormat(int Flags, TCString Message);
- TCString GetMsgFormat(int Flags, int *pOrder = NULL, char *szProtoOverride = NULL);
+ TCString GetMsgFormat(int Flags, int *pOrder = nullptr, char *szProtoOverride = nullptr);
};
diff --git a/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp b/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp index 75c0c05758..dbe67a24b5 100644 --- a/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp +++ b/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp @@ -30,7 +30,7 @@ struct READAWAYMSGDATA #define RAMDLGSIZESETTING "ReadAwayMsgDlg"
-MWindowList g_hReadWndList = NULL;
+MWindowList g_hReadWndList = nullptr;
static int ReadAwayMsgDlgResize(HWND, LPARAM, UTILRESIZECONTROL *urc)
{
diff --git a/plugins/NewAwaySysMod/src/Services.cpp b/plugins/NewAwaySysMod/src/Services.cpp index 9f5ea5db36..c807905c73 100644 --- a/plugins/NewAwaySysMod/src/Services.cpp +++ b/plugins/NewAwaySysMod/src/Services.cpp @@ -53,7 +53,7 @@ __inline void PSSetStatus(char *szProto, WORD Status, int bNoClistSetStatusMode INT_PTR GetStatusMsgW(WPARAM wParam, LPARAM)
{
LogMessage("MS_AWAYMSG_GETSTATUSMSGW called. status=%d", wParam);
- WCHAR *szMsg = mir_wstrdup(GetDynamicStatMsg(INVALID_CONTACT_ID, NULL, 0, wParam));
+ WCHAR *szMsg = mir_wstrdup(GetDynamicStatMsg(INVALID_CONTACT_ID, nullptr, 0, wParam));
LogMessage("returned szMsgW:\n%S", szMsg ? szMsg : L"NULL");
return (INT_PTR)szMsg;
}
@@ -66,10 +66,10 @@ INT_PTR SetStatusMode(WPARAM wParam, LPARAM lParam) // called by GamerStatus and g_fNoProcessing = true;
Clist_SetStatusMode(wParam);
- _ASSERT(!g_fNoProcessing && g_ProtoStates[(char*)NULL].m_status == wParam);
+ _ASSERT(!g_fNoProcessing && g_ProtoStates[(char*)nullptr].m_status == wParam);
g_fNoProcessing = false;
- CProtoSettings(NULL, wParam).SetMsgFormat(SMF_TEMPORARY, lParam ? (wchar_t*)_A2T((char*)lParam) : CProtoSettings(NULL, wParam).GetMsgFormat(GMF_LASTORDEFAULT));
- ChangeProtoMessages(NULL, wParam, TCString());
+ CProtoSettings(nullptr, wParam).SetMsgFormat(SMF_TEMPORARY, lParam ? (wchar_t*)_A2T((char*)lParam) : CProtoSettings(nullptr, wParam).GetMsgFormat(GMF_LASTORDEFAULT));
+ ChangeProtoMessages(nullptr, wParam, TCString());
return 0;
}
@@ -88,18 +88,18 @@ int GetState(WPARAM wParam, LPARAM lParam, int Widechar) LogMessage("%d (received): cbSize=%d, status=%d, szProto=%s, Flags=0x%x", i + 1, pi->cbSize, pi->status, pi->szProto ? pi->szProto : "NULL", Flags);
if ((pi->status >= ID_STATUS_ONLINE && pi->status <= ID_STATUS_OUTTOLUNCH) || !pi->status) {
TCString Msg(pi->status ? CProtoSettings(pi->szProto, pi->status).GetMsgFormat(GMF_LASTORDEFAULT) : CProtoSettings(pi->szProto).GetMsgFormat(((Flags & PIF_NOTTEMPORARY) ? 0 : GMF_TEMPORARY) | GMF_PERSONAL));
- if (Msg != NULL) {
+ if (Msg != nullptr) {
if (Widechar)
pi->tszMsg = mir_wstrdup(Msg);
else
pi->szMsg = mir_strdup(_T2A(Msg));
}
- else pi->szMsg = NULL;
+ else pi->szMsg = nullptr;
if (!pi->status)
pi->status = g_ProtoStates[pi->szProto].m_status;
}
- else pi->szMsg = NULL;
+ else pi->szMsg = nullptr;
LogMessage("%d (returned): status=%d, Flags=0x%x, szMsg:\n%s", i + 1, pi->status, (pi->cbSize > sizeof(NAS_PROTOINFOv1)) ? pi->Flags : 0, pi->szMsg ? (Widechar ? _T2A(pi->wszMsg) : pi->szMsg) : "NULL");
*(char**)&pi += pi->cbSize;
diff --git a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp index 56aedf56e1..26fb5a2db7 100644 --- a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp +++ b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp @@ -259,7 +259,7 @@ void SetExtraIcon(CCList *CList, int nColumn, HTREEITEM hItem, int nIcon) }
}
if (nColumn == EXTRACOLUMN_IGNORE && nIcon != EXTRAIMGLIST_IGNORE)
- nIcon = (CContactSettings(0, hContact).GetMsgFormat(GMF_PERSONAL) == NULL) ? EXTRAIMGLIST_DOT : EXTRAIMGLIST_MSG;
+ nIcon = (CContactSettings(0, hContact).GetMsgFormat(GMF_PERSONAL) == nullptr) ? EXTRAIMGLIST_DOT : EXTRAIMGLIST_MSG;
}
else if (ItemType == MCLCIT_INFO) {
char *szProto = (char*)CList->GetItemParam(hItem);
@@ -272,7 +272,7 @@ void SetExtraIcon(CCList *CList, int nColumn, HTREEITEM hItem, int nIcon) if (!szProto && nIcon == EXTRAIMGLIST_DOT)
nIcon = EXTRAIMGLIST_AUTOREPLY_OFF;
}
- else nIcon = (CProtoSettings(szProto).GetMsgFormat(GMF_TEMPORARY | GMF_PERSONAL) == NULL) ? EXTRAIMGLIST_DOT : EXTRAIMGLIST_MSG;
+ else nIcon = (CProtoSettings(szProto).GetMsgFormat(GMF_TEMPORARY | GMF_PERSONAL) == nullptr) ? EXTRAIMGLIST_DOT : EXTRAIMGLIST_MSG;
}
int Ignore = (nColumn == EXTRACOLUMN_IGNORE) ? (nIcon == EXTRAIMGLIST_IGNORE) : ((ItemType == MCLCIT_CONTACT) ? CContactSettings(0, hContact).Ignore : ((ItemType == MCLCIT_GROUP) ? CList->GetExtraImage(hItem, EXTRACOLUMN_IGNORE) : false));
@@ -369,7 +369,7 @@ void ApplySelContactsMessage(SetAwayMsgData* dat, CCList *CList, PTREEITEMARRAY GetDlgItemText(hwndDlg, IDC_SAWAYMSG_MSGDATA, Message.GetBuffer(AWAY_MSGDATA_MAX), AWAY_MSGDATA_MAX);
Message.ReleaseBuffer();
if (!mir_wstrlen(Message))
- Message = NULL; // delete personal message if it's empty
+ Message = nullptr; // delete personal message if it's empty
if (CList) {
if (!Selection)
@@ -384,7 +384,7 @@ void ApplySelContactsMessage(SetAwayMsgData* dat, CCList *CList, PTREEITEMARRAY }
else if (ItemType == MCLCIT_INFO) {
char *szProto = (char*)CList->GetItemParam(hItem);
- CProtoSettings(szProto).SetMsgFormat(SMF_PERSONAL, (szProto || Message != NULL) ? Message : L""); // "szProto || Message != NULL..." means that we'll set an empty message instead of NULL for the global status, if the message is empty (NULL for the global status has a special meaning - SetMsgFormat will set the default message instead of NULL)
+ CProtoSettings(szProto).SetMsgFormat(SMF_PERSONAL, (szProto || Message != nullptr) ? Message : L""); // "szProto || Message != NULL..." means that we'll set an empty message instead of NULL for the global status, if the message is empty (NULL for the global status has a special meaning - SetMsgFormat will set the default message instead of NULL)
}
else continue;
@@ -395,7 +395,7 @@ void ApplySelContactsMessage(SetAwayMsgData* dat, CCList *CList, PTREEITEMARRAY if (dat->hInitContact)
CContactSettings(0, dat->hInitContact).SetMsgFormat(SMF_PERSONAL, Message);
else
- CProtoSettings(dat->szProtocol).SetMsgFormat(SMF_PERSONAL, (dat->szProtocol || Message != NULL) ? Message : L"");
+ CProtoSettings(dat->szProtocol).SetMsgFormat(SMF_PERSONAL, (dat->szProtocol || Message != nullptr) ? Message : L"");
}
SendDlgItemMessage(hwndDlg, IDC_SAWAYMSG_MSGDATA, EM_SETMODIFY, false, 0);
SetDlgItemText(hwndDlg, IDC_OK, TranslateT("OK"));
@@ -579,7 +579,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA if (Order >= 0) // so just select an appropriate message tree item; MSGDATA text is filled automatically through SELCHANGED notification
MsgTree->SetSelection(Order, MTSS_BYORDER);
- if (dat->Message != NULL) { // this allows to override the default message
+ if (dat->Message != nullptr) { // this allows to override the default message
SetDlgItemText(hwndDlg, IDC_SAWAYMSG_MSGDATA, dat->Message);
SendDlgItemMessage(hwndDlg, IDC_SAWAYMSG_MSGDATA, EM_SETMODIFY, true, 0);
}
@@ -603,7 +603,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA // init tooltips
TOOLINFO ti = { 0 };
- hWndTooltips = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, L"", WS_POPUP, 0, 0, 0, 0, NULL, NULL, GetModuleHandleA("mir_app.mir"), NULL);
+ hWndTooltips = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, L"", WS_POPUP, 0, 0, 0, 0, nullptr, nullptr, GetModuleHandleA("mir_app.mir"), nullptr);
ti.cbSize = sizeof(ti);
ti.uFlags = TTF_IDISHWND | TTF_SUBCLASS;
for (int i = 0; i < _countof(Tooltips); i++) {
@@ -707,7 +707,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA for (int i = 0; i < pnm->NewSelection->GetSize(); i++) {
HTREEITEM hItem = (*pnm->NewSelection)[i];
MCONTACT hContact = 0;
- char *szProto = NULL;
+ char *szProto = nullptr;
int ItemType = CList->GetItemType(hItem);
if (ItemType == MCLCIT_CONTACT) {
hContact = CList->GethContact(hItem);
@@ -722,10 +722,10 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA int CurStatus = g_ProtoStates[szProto].m_status;
if (!MessageDetermined) {
TCString CurMessage((ItemType == MCLCIT_CONTACT) ? CContactSettings(0, hContact).GetMsgFormat(GMF_PERSONAL) : CProtoSettings(szProto).GetMsgFormat(GMF_TEMPORARY | GMF_PERSONAL));
- if (CurMessage == NULL)
+ if (CurMessage == nullptr)
CurMessage = L"";
- if (Message == NULL)
+ if (Message == nullptr)
Message = CurMessage;
else if (CurMessage != (const wchar_t*)Message) {
Message = L"";
@@ -750,7 +750,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA }
if (!bLeaveOldMessage)
- SetDlgItemText(hwndDlg, IDC_SAWAYMSG_MSGDATA, (Message == NULL) ? L"" : Message);
+ SetDlgItemText(hwndDlg, IDC_SAWAYMSG_MSGDATA, (Message == nullptr) ? L"" : Message);
SetDlgItemText(hwndDlg, IDC_OK, BtnTitle);
TCString WindowTitle(TranslateT("Set message for"));
@@ -863,7 +863,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA CList->SetExtraImageList(hil);
HTREEITEM hSelItem;
- HTREEITEM hItem = hSelItem = CList->AddInfo(TranslateT("** All contacts **"), CLC_ROOT, CLC_ROOT, NULL, Skin_LoadProtoIcon(NULL, g_ProtoStates[(char*)NULL].m_status));
+ HTREEITEM hItem = hSelItem = CList->AddInfo(TranslateT("** All contacts **"), CLC_ROOT, CLC_ROOT, NULL, Skin_LoadProtoIcon(nullptr, g_ProtoStates[(char*)nullptr].m_status));
int numAccs;
PROTOACCOUNT **accs;
Proto_EnumAccounts(&numAccs, &accs);
@@ -927,13 +927,13 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA PROTOACCOUNT *p = accs[i];
if (CallProtoService(p->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND) {
TCString Message(CProtoSettings(p->szModuleName).GetMsgFormat(GMF_PERSONAL)); // yes, we don't specify GMF_TEMPORARY here, because we don't need to save it
- if (Message != NULL)
+ if (Message != nullptr)
CProtoSettings(p->szModuleName).SetMsgFormat(SMF_LAST, Message); // if the user set a message for this protocol, save it to the recent messages
- ChangeProtoMessages(p->szModuleName, g_ProtoStates[p->szModuleName].m_status, TCString(NULL)); // and actual setting of a status message for the protocol
+ ChangeProtoMessages(p->szModuleName, g_ProtoStates[p->szModuleName].m_status, TCString(nullptr)); // and actual setting of a status message for the protocol
}
}
TCString Message(CProtoSettings().GetMsgFormat(GMF_PERSONAL));
- if (Message != NULL)
+ if (Message != nullptr)
CProtoSettings().SetMsgFormat(SMF_LAST, Message); // save the global message to the recent messages
if (g_SetAwayMsgPage.GetValue(IDS_SAWAYMSG_AUTOSAVEDLGSETTINGS))
diff --git a/plugins/NewAwaySysMod/src/TMyArray.h b/plugins/NewAwaySysMod/src/TMyArray.h index 68ca908fe1..45eeaf1563 100644 --- a/plugins/NewAwaySysMod/src/TMyArray.h +++ b/plugins/NewAwaySysMod/src/TMyArray.h @@ -41,7 +41,7 @@ public: void MoveElem(int nIndex, int nMoveTo);
T& SetAtGrow(int nIndex);
int Find(ARG_T pElem); // returns an index of the specified item, or -1 if the array doesn't contain the item
- int BinarySearch(int (*CmpFunc)(ARG_T pItem, LPARAM lParam), LPARAM lParam, int *pIndex = NULL); // returns an index of the specified item, or -1 if the array doesn't contain the item;
+ int BinarySearch(int (*CmpFunc)(ARG_T pItem, LPARAM lParam), LPARAM lParam, int *pIndex = nullptr); // returns an index of the specified item, or -1 if the array doesn't contain the item;
// also it's possible to specify pIndex so that even if the array doesn't contain the item, the function will set *pIndex to a position where the item can be inserted;
// CmpFunc must return -1, 0 and 1 depending whether pItem is lesser, equal or greater than needed;
// BinarySearch() requires the array to be sorted in an ascending order
@@ -65,7 +65,7 @@ TMyArray<T, ARG_T, GrowBy, FreeThreshold>::TMyArray() {
nElemNum = 0;
nAllocNum = 0;
- pData = NULL;
+ pData = nullptr;
}
template <class T, class ARG_T, int GrowBy, int FreeThreshold>
@@ -73,7 +73,7 @@ TMyArray<T, ARG_T, GrowBy, FreeThreshold>::TMyArray(const TMyArray<T, ARG_T, Gro {
nElemNum = 0;
nAllocNum = 0;
- pData = NULL;
+ pData = nullptr;
*this = A;
}
@@ -99,7 +99,7 @@ template <class T, class ARG_T, int GrowBy, int FreeThreshold> __forceinline int TMyArray<T, ARG_T, GrowBy, FreeThreshold>::SetAllocNum(int nNewAllocNum)
{
_ASSERT(nNewAllocNum >= nElemNum);
- T*pNewData = (nNewAllocNum) ? (T*)malloc(sizeof(T) * nNewAllocNum) : NULL;
+ T*pNewData = (nNewAllocNum) ? (T*)malloc(sizeof(T) * nNewAllocNum) : nullptr;
if (pData)
{
if (pNewData)
diff --git a/plugins/NewAwaySysMod/src/stdafx.h b/plugins/NewAwaySysMod/src/stdafx.h index b64cb3a13f..8596cf2377 100644 --- a/plugins/NewAwaySysMod/src/stdafx.h +++ b/plugins/NewAwaySysMod/src/stdafx.h @@ -277,7 +277,7 @@ extern bool g_fNoProcessing; extern int g_bIsIdle;
// AwaySys.cpp
-TCString GetDynamicStatMsg(MCONTACT hContact, char *szProto = NULL, DWORD UIN = 0, int iStatus = 0);
+TCString GetDynamicStatMsg(MCONTACT hContact, char *szProto = nullptr, DWORD UIN = 0, int iStatus = 0);
int IsAnICQProto(char *szProto);
// Client.cpp
@@ -319,7 +319,7 @@ static __inline int LogMessage(const char *Format, ...) va_start(va, Format);
mir_vsnprintf(szText + (_countof(LOG_PREFIX) - 1), sizeof(szText) - (_countof(LOG_PREFIX) - 1), Format, va);
va_end(va);
- return Netlib_Log(NULL, szText);
+ return Netlib_Log(nullptr, szText);
}
__inline int CallAllowedPS_SETAWAYMSG(const char *szProto, int iMode, const wchar_t *szMsg)
@@ -328,7 +328,7 @@ __inline int CallAllowedPS_SETAWAYMSG(const char *szProto, int iMode, const wcha return CallProtoService(szProto, PS_SETAWAYMSG, iMode, (LPARAM)szMsg);
}
-static __inline int my_variables_showhelp(HWND hwndDlg, UINT uIDEdit, int flags = 0, char *szSubjectDesc = NULL, char *szExtraDesc = NULL)
+static __inline int my_variables_showhelp(HWND hwndDlg, UINT uIDEdit, int flags = 0, char *szSubjectDesc = nullptr, char *szExtraDesc = NULL)
{
if (ServiceExists(MS_VARS_SHOWHELPEX)) {
return variables_showhelp(hwndDlg, uIDEdit, flags, szSubjectDesc,szExtraDesc);
diff --git a/plugins/NewXstatusNotify/src/popup.h b/plugins/NewXstatusNotify/src/popup.h index 1ffc9b7875..5e0c70d00e 100644 --- a/plugins/NewXstatusNotify/src/popup.h +++ b/plugins/NewXstatusNotify/src/popup.h @@ -58,7 +58,7 @@ static struct { LPGENW("Do nothing"), PCA_DONOTHING
};
-void ShowChangePopup(MCONTACT hContact, HICON hIcon, WORD newStatus, const wchar_t *stzText, PLUGINDATA *pdp = NULL);
+void ShowChangePopup(MCONTACT hContact, HICON hIcon, WORD newStatus, const wchar_t *stzText, PLUGINDATA *pdp = nullptr);
LRESULT CALLBACK PopupDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
#endif
\ No newline at end of file diff --git a/plugins/NotesAndReminders/src/miscutils.h b/plugins/NotesAndReminders/src/miscutils.h index a9ac99f318..692de31a1f 100644 --- a/plugins/NotesAndReminders/src/miscutils.h +++ b/plugins/NotesAndReminders/src/miscutils.h @@ -31,6 +31,6 @@ static void __inline SAFE_FREE(void** p) if (*p)
{
free(*p);
- *p = NULL;
+ *p = nullptr;
}
}
diff --git a/plugins/Ping/src/collection.h b/plugins/Ping/src/collection.h index 73e36fe704..e19c5874d4 100644 --- a/plugins/Ping/src/collection.h +++ b/plugins/Ping/src/collection.h @@ -28,7 +28,7 @@ template<class T> class ListNode : public Node < T > public:
ListNode<T> *next, *prev;
- ListNode(const T &v) : Node<T>(v), next(0), prev(0) {}
+ ListNode(const T &v) : Node<T>(v), next(nullptr), prev(nullptr) {}
virtual ~ListNode()
{
if (next) next->prev = prev;
@@ -57,8 +57,8 @@ public: virtual const bool has_val() { return (n ? true : false); }
};
- LinkedList() : Collection<T>(), head(0), tail(0) {};
- LinkedList(const LinkedList<T> &other) : Collection<T>(), head(0), tail(0)
+ LinkedList() : Collection<T>(), head(nullptr), tail(nullptr) {};
+ LinkedList(const LinkedList<T> &other) : Collection<T>(), head(nullptr), tail(nullptr)
{
for (Iterator i = other.begin(); i.has_val(); i.next())
add(i.val());
@@ -81,7 +81,7 @@ public: head = head->next;
delete n;
}
- tail = 0;
+ tail = nullptr;
Collection<T>::count = 0;
}
@@ -160,7 +160,7 @@ public: ListNode<T> *n = head;
if (head) {
head = head->next;
- if (n == tail) tail = 0;
+ if (n == tail) tail = nullptr;
val = n->val;
delete n;
Collection<T>::count--;
@@ -399,7 +399,7 @@ protected: n->left->parent = n->parent;
}
else {
- if (n == root) root = 0;
+ if (n == root) root = nullptr;
}
delete n;
Collection<T>::count--;
@@ -407,7 +407,7 @@ protected: virtual void insert_node(N *n)
{
- N *current = root, *parent = 0;
+ N *current = root, *parent = nullptr;
while (current) {
parent = current;
if (n->val < current->val)
@@ -482,8 +482,8 @@ public: virtual const bool has_val() { return (n ? true : false); }
};
- BinaryTree() : Collection<T>(), root(0) {};
- BinaryTree(BinaryTree<T> &other) : Collection<T>(), root(0)
+ BinaryTree() : Collection<T>(), root(nullptr) {};
+ BinaryTree(BinaryTree<T> &other) : Collection<T>(), root(nullptr)
{
for (Iterator i = other.begin(); i != pl.end(); ++i)
add(i.val());
@@ -500,7 +500,7 @@ public: virtual void clear()
{
- N *current = root, *parent = 0;
+ N *current = root, *parent = nullptr;
while (current) {
if (current->left) current = current->left;
else if (current->right) current = current->right;
@@ -511,7 +511,7 @@ public: }
}
- root = 0;
+ root = nullptr;
Collection<T>::count = 0;
}
@@ -569,12 +569,12 @@ public: ColouredTreeNode<T> *parent, *left, *right;
char color;
- ColouredTreeNode(const T &v, ColouredTreeNode<T> *par) : Node<T>(v), parent(par), left(0), right(0), color(BLACK) {}
+ ColouredTreeNode(const T &v, ColouredTreeNode<T> *par) : Node<T>(v), parent(par), left(nullptr), right(nullptr), color(BLACK) {}
virtual ~ColouredTreeNode()
{
if (parent) {
- if (parent->left == this) parent->left = 0;
- if (parent->right == this)parent->right = 0;
+ if (parent->left == this) parent->left = nullptr;
+ if (parent->right == this)parent->right = nullptr;
}
}
};
diff --git a/plugins/PluginUpdater/src/stdafx.h b/plugins/PluginUpdater/src/stdafx.h index 2efd9cb392..e3a4f0a354 100644 --- a/plugins/PluginUpdater/src/stdafx.h +++ b/plugins/PluginUpdater/src/stdafx.h @@ -183,7 +183,7 @@ public: {
if (m_handle) {
::CloseHandle(m_handle);
- m_handle = 0;
+ m_handle = nullptr;
}
}
};
diff --git a/plugins/Popup/src/common.h b/plugins/Popup/src/common.h index ca632bac41..e09dc23f61 100644 --- a/plugins/Popup/src/common.h +++ b/plugins/Popup/src/common.h @@ -42,7 +42,7 @@ inline void GetBmpSize(HBITMAP hbm, SIZE *sz) inline void DebugMsg(LPTSTR msg){
if (PopupOptions.debug){
- MessageBox(NULL, msg, L"debug", MB_OK);
+ MessageBox(nullptr, msg, L"debug", MB_OK);
}
}
diff --git a/plugins/Popup/src/formula.h b/plugins/Popup/src/formula.h index 6de6ac625d..fdb4612bc1 100644 --- a/plugins/Popup/src/formula.h +++ b/plugins/Popup/src/formula.h @@ -36,12 +36,12 @@ public: int value;
Item *next;
- Item(char *aName, int aValue, Item *aNext) : value(aValue), next(aNext) { name = aName ? mir_strdup(aName) : 0; }
+ Item(char *aName, int aValue, Item *aNext) : value(aValue), next(aNext) { name = aName ? mir_strdup(aName) : nullptr; }
~Item() { if (name) mir_free(name); }
};
Item *items;
public:
- Args() :items(0){}
+ Args() :items(nullptr){}
~Args(){ clear(); }
void add(char *name, int value)
{
@@ -83,7 +83,7 @@ public: Formula(wchar_t *s) :m_str(mir_wstrdup(s)) {}
~Formula() { mir_free(m_str); }
void set(wchar_t *s){ mir_free(m_str); m_str = mir_wstrdup(s); }
- int eval(Args *args, bool *vars = 0) const;
+ int eval(Args *args, bool *vars = nullptr) const;
};
#endif // __formula_h__
\ No newline at end of file diff --git a/plugins/Popup/src/opt_gen.h b/plugins/Popup/src/opt_gen.h index f97d056306..41e2d245b8 100644 --- a/plugins/Popup/src/opt_gen.h +++ b/plugins/Popup/src/opt_gen.h @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define __opt_gen_h__
void LoadOption_General();
-void Check_ReorderPopups(HWND hwnd = 0);
+void Check_ReorderPopups(HWND hwnd = nullptr);
INT_PTR CALLBACK DlgProcPopupGeneral(HWND, UINT, WPARAM, LPARAM);
void ErrorMSG(int minValue, int maxValue);
diff --git a/plugins/Popup/src/opttree.h b/plugins/Popup/src/opttree.h index 3dd63d3e0d..c13087b072 100644 --- a/plugins/Popup/src/opttree.h +++ b/plugins/Popup/src/opttree.h @@ -38,8 +38,8 @@ typedef struct { } OPTTREE_OPTION;
BOOL OptTree_ProcessMessage(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, BOOL *result, int idcTree, OPTTREE_OPTION *options, int optionCount);
-DWORD OptTree_GetOptions(HWND hwnd, int idcTree, OPTTREE_OPTION *options, int optionCount, LPTSTR pszSettingName = NULL);
-void OptTree_SetOptions(HWND hwnd, int idcTree, OPTTREE_OPTION *options, int optionCount, DWORD dwOptions, LPTSTR pszSettingName = NULL);
+DWORD OptTree_GetOptions(HWND hwnd, int idcTree, OPTTREE_OPTION *options, int optionCount, LPTSTR pszSettingName = nullptr);
+void OptTree_SetOptions(HWND hwnd, int idcTree, OPTTREE_OPTION *options, int optionCount, DWORD dwOptions, LPTSTR pszSettingName = nullptr);
void OptTree_Translate(HWND hwndTree);
HTREEITEM OptTree_FindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, LPCTSTR name);
diff --git a/plugins/Popup/src/popup_wnd2.h b/plugins/Popup/src/popup_wnd2.h index 57061569ee..bed4bd7ba2 100644 --- a/plugins/Popup/src/popup_wnd2.h +++ b/plugins/Popup/src/popup_wnd2.h @@ -107,7 +107,7 @@ private: int fixActions(POPUPACTION *theActions, int count, int additional);
public:
- PopupWnd2(POPUPDATA2 *ppd, POPUPOPTIONS *theCustomOptions = NULL, bool renderOnly = false);
+ PopupWnd2(POPUPDATA2 *ppd, POPUPOPTIONS *theCustomOptions = nullptr, bool renderOnly = false);
~PopupWnd2();
void startThread();
@@ -174,7 +174,7 @@ public: this->m_sz = sz;
if (m_hwnd)
{
- SetWindowPos(m_hwnd, 0, 0, 0, sz.cx, sz.cy, SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE | SWP_DEFERERASE | SWP_NOSENDCHANGING);
+ SetWindowPos(m_hwnd, nullptr, 0, 0, sz.cx, sz.cy, SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE | SWP_DEFERERASE | SWP_NOSENDCHANGING);
if (!m_customPopup)
PopupThreadUpdateWindow(this);
}
@@ -189,7 +189,7 @@ public: if (m_bSlide)
m_ptPosition1 = pt;
else
- SetWindowPos(m_hwnd, 0, pt.x, pt.y, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE | SWP_DEFERERASE | SWP_NOSENDCHANGING);
+ SetWindowPos(m_hwnd, nullptr, pt.x, pt.y, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE | SWP_DEFERERASE | SWP_NOSENDCHANGING);
}
// Thread-related methods
diff --git a/plugins/Popup/src/skin.h b/plugins/Popup/src/skin.h index 8c903a9ca8..7b410151db 100644 --- a/plugins/Popup/src/skin.h +++ b/plugins/Popup/src/skin.h @@ -124,7 +124,7 @@ private: void drawActionBar(MyBitmap *bmp, PopupWnd2 *wnd, int x, int y) const;
public:
- PopupSkin(LPCTSTR aName = 0);
+ PopupSkin(LPCTSTR aName = nullptr);
~PopupSkin();
void measure(HDC hdc, PopupWnd2 *wnd, int maxw, POPUPOPTIONS *options) const;
diff --git a/plugins/SMS/src/AdditionalFunctions/MemoryFindByte.h b/plugins/SMS/src/AdditionalFunctions/MemoryFindByte.h index 98fed3c44e..e2efab157a 100644 --- a/plugins/SMS/src/AdditionalFunctions/MemoryFindByte.h +++ b/plugins/SMS/src/AdditionalFunctions/MemoryFindByte.h @@ -7,7 +7,7 @@ __inline LPVOID MemoryFindByte(size_t dwFrom,LPCVOID lpcSource,size_t dwSourceSi if (dwFrom < dwSourceSize)
return memchr((BYTE*)lpcSource + dwFrom, chWhatFind, dwSourceSize-dwFrom);
- return NULL;
+ return nullptr;
}
#endif // !defined(AFX_MEMORYFINDBYTE__H__INCLUDED_)
diff --git a/plugins/SendScreenshotPlus/src/CSend.h b/plugins/SendScreenshotPlus/src/CSend.h index 534a96e7cc..15d92a5572 100644 --- a/plugins/SendScreenshotPlus/src/CSend.h +++ b/plugins/SendScreenshotPlus/src/CSend.h @@ -99,7 +99,7 @@ class CSend { wchar_t* m_ErrorMsg; wchar_t* m_ErrorTitle; - void Unhook(){if(m_hOnSend) {UnhookEvent(m_hOnSend);m_hOnSend = NULL;}} + void Unhook(){if(m_hOnSend) {UnhookEvent(m_hOnSend);m_hOnSend = nullptr;}} void DB_EventAdd(WORD EventType); static INT_PTR CALLBACK ResultDialogProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam); diff --git a/plugins/SendScreenshotPlus/src/UMainForm.h b/plugins/SendScreenshotPlus/src/UMainForm.h index 3a0a7435bd..995a56b4dd 100644 --- a/plugins/SendScreenshotPlus/src/UMainForm.h +++ b/plugins/SendScreenshotPlus/src/UMainForm.h @@ -87,7 +87,7 @@ public: void Close(){ SendMessage(m_hWnd, WM_CLOSE, 0, 0); } void Show(){ ShowWindow(m_hWnd, SW_SHOW); } void Hide(){ ShowWindow(m_hWnd, SW_HIDE); } - void SetTargetWindow(HWND hwnd = NULL); + void SetTargetWindow(HWND hwnd = nullptr); void btnCaptureClick(); void cboxSendByChange(void *param); diff --git a/plugins/SendScreenshotPlus/src/Utils.h b/plugins/SendScreenshotPlus/src/Utils.h index bd2d38f240..7d5f051ff9 100644 --- a/plugins/SendScreenshotPlus/src/Utils.h +++ b/plugins/SendScreenshotPlus/src/Utils.h @@ -49,7 +49,7 @@ int ComboBox_SelectItemData(HWND hwndCtl, LPARAM data); size_t MonitorInfoEnum(MONITORINFOEX* &myMonitors, RECT &virtualScreen); FIBITMAP* CaptureWindow(HWND hCapture, BOOL bClientArea, BOOL bIndirectCapture); -FIBITMAP* CaptureMonitor(const wchar_t *pwszDevice, const RECT *cropRect = NULL); +FIBITMAP* CaptureMonitor(const wchar_t *pwszDevice, const RECT *cropRect = nullptr); char* GetFileNameA(const wchar_t *pwszPath); @@ -64,7 +64,7 @@ class EventHandle { HANDLE _hEvent; public: - inline EventHandle() { _hEvent = CreateEvent(NULL, 0, 0, NULL); } + inline EventHandle() { _hEvent = CreateEvent(nullptr, 0, 0, nullptr); } inline ~EventHandle() { CloseHandle(_hEvent); } inline void Set() { SetEvent(_hEvent); } inline void Wait() { WaitForSingleObject(_hEvent, INFINITE); } diff --git a/plugins/SmileyAdd/src/imagecache.h b/plugins/SmileyAdd/src/imagecache.h index cc0ef2cf3b..229af79a27 100644 --- a/plugins/SmileyAdd/src/imagecache.h +++ b/plugins/SmileyAdd/src/imagecache.h @@ -38,7 +38,7 @@ public: virtual void GetSize(SIZE&) {};
virtual int GetFrameCount(void) const { return 0; }
virtual int GetFrameDelay(void) const { return 0; }
- virtual HICON GetIcon(void) { return NULL; };
+ virtual HICON GetIcon(void) { return nullptr; };
virtual void DrawInternal(HDC, int, int, int, int) {};
virtual void SelectFrame(int) {}
diff --git a/plugins/SmileyAdd/src/services.h b/plugins/SmileyAdd/src/services.h index 113485429b..6a877d63e8 100644 --- a/plugins/SmileyAdd/src/services.h +++ b/plugins/SmileyAdd/src/services.h @@ -39,7 +39,7 @@ int AccountListChanged(WPARAM wParam, LPARAM lParam); int DbSettingChanged(WPARAM wParam, LPARAM lParam);
int ReloadColour(WPARAM, LPARAM);
-SmileyPackType* GetSmileyPack(const char* proto, MCONTACT hContact = NULL, SmileyPackCType** smlc = NULL);
+SmileyPackType* GetSmileyPack(const char* proto, MCONTACT hContact = NULL, SmileyPackCType** smlc = nullptr);
#endif // SMILEYADD_SERVICES_H_
diff --git a/plugins/SmileyAdd/src/smileys.h b/plugins/SmileyAdd/src/smileys.h index c44f1858fb..4f02daed07 100644 --- a/plugins/SmileyAdd/src/smileys.h +++ b/plugins/SmileyAdd/src/smileys.h @@ -143,7 +143,7 @@ public: };
typedef SMOBJLIST<SmileyLocType> SmileyLocVecType;
- SmileyLookup() : m_pattern(L"") { m_ind = 0; m_valid = false; m_pattern = NULL; };
+ SmileyLookup() : m_pattern(L"") { m_ind = 0; m_valid = false; m_pattern = nullptr; };
SmileyLookup(const CMStringW &str, const bool regexs, const int ind, const CMStringW &smpt);
~SmileyLookup();
@@ -251,7 +251,7 @@ private: bool visible;
public:
- SmileyCategoryType() { type = smcNone; m_pSmileyPackStore = NULL; visible = true; };
+ SmileyCategoryType() { type = smcNone; m_pSmileyPackStore = nullptr; visible = true; };
SmileyCategoryType(SmileyPackListType *pSPS, const CMStringW &name, const CMStringW &displayName, const CMStringW &defaultFilename, SmcType typ);
const CMStringW& GetDisplayName(void) const { return m_DisplayName; }
diff --git a/plugins/StopSpamMod/src/utilities.cpp b/plugins/StopSpamMod/src/utilities.cpp index 3e1c95e655..535a800174 100755 --- a/plugins/StopSpamMod/src/utilities.cpp +++ b/plugins/StopSpamMod/src/utilities.cpp @@ -84,7 +84,7 @@ void DeleteCListGroupsByName(wchar_t* szGroupName) int RemoveTmp(WPARAM, LPARAM)
{
- CleanThread(0);
+ CleanThread(nullptr);
return 0;
}
diff --git a/plugins/TabSRMM/src/contactcache.h b/plugins/TabSRMM/src/contactcache.h index 21e3779c30..b322848628 100644 --- a/plugins/TabSRMM/src/contactcache.h +++ b/plugins/TabSRMM/src/contactcache.h @@ -104,8 +104,8 @@ struct CContactCache : public MZeroedObject bool updateNick();
void updateMeta();
bool updateUIN();
- void updateStatusMsg(const char *szKey = 0);
- void setWindowData(CSrmmWindow *dat = 0);
+ void updateStatusMsg(const char *szKey = nullptr);
+ void setWindowData(CSrmmWindow *dat = nullptr);
void resetMeta();
void closeWindow();
void deletedHandler();
diff --git a/plugins/TabSRMM/src/controls.h b/plugins/TabSRMM/src/controls.h index daf9174c7b..1bd0d75847 100644 --- a/plugins/TabSRMM/src/controls.h +++ b/plugins/TabSRMM/src/controls.h @@ -42,7 +42,7 @@ public: const RECT& getClientRect();
void Resize(WORD wWidth) const
{
- ::SetWindowPos(m_hwndToolbar, 0, 4, 0, wWidth, m_size_y, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOCOPYBITS | SWP_NOREDRAW);
+ ::SetWindowPos(m_hwndToolbar, nullptr, 4, 0, wWidth, m_size_y, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOCOPYBITS | SWP_NOREDRAW);
}
LONG getHeight() const;
diff --git a/plugins/TabSRMM/src/infopanel.h b/plugins/TabSRMM/src/infopanel.h index cb9966d9a4..d449b02874 100644 --- a/plugins/TabSRMM/src/infopanel.h +++ b/plugins/TabSRMM/src/infopanel.h @@ -75,12 +75,12 @@ public: LEFT_BAR_WIDTH = 20
};
- CTip(const HWND hwndParent, const MCONTACT hContact, const wchar_t *pszText = 0, const CInfoPanel *panel = 0);
+ CTip(const HWND hwndParent, const MCONTACT hContact, const wchar_t *pszText = nullptr, const CInfoPanel *panel = nullptr);
~CTip()
{
mir_free(m_pszText);
}
- void show(const RECT& rc, POINT& pt, const HICON hIcon = 0, const wchar_t *szTitle = 0);
+ void show(const RECT& rc, POINT& pt, const HICON hIcon = nullptr, const wchar_t *szTitle = nullptr);
const HWND getHwnd() const { return(m_hwnd); }
static void registerClass();
diff --git a/plugins/TabSRMM/src/mim.h b/plugins/TabSRMM/src/mim.h index 91d3b13f67..0aea60b9e5 100644 --- a/plugins/TabSRMM/src/mim.h +++ b/plugins/TabSRMM/src/mim.h @@ -84,9 +84,9 @@ public: ~CMimAPI() {
if (m_haveBufferedPaint)
m_pfnBufferedPaintUninit();
- if (m_hUxTheme != 0)
+ if (m_hUxTheme != nullptr)
FreeLibrary(m_hUxTheme);
- if (m_hDwmApi != 0)
+ if (m_hDwmApi != nullptr)
FreeLibrary(m_hDwmApi);
if (m_hChatLogLock != INVALID_HANDLE_VALUE)
@@ -150,7 +150,7 @@ public: INT_PTR foldersPathChanged();
void startTimer();
- void stopTimer(const char *szMsg = 0);
+ void stopTimer(const char *szMsg = nullptr);
__forceinline __int64 getTimerStart() const { return m_tStart; }
__forceinline __int64 getTimerStop() const { return m_tStop; }
diff --git a/plugins/TabSRMM/src/muchighlight.h b/plugins/TabSRMM/src/muchighlight.h index 340b9e53f6..51bcd3ec79 100644 --- a/plugins/TabSRMM/src/muchighlight.h +++ b/plugins/TabSRMM/src/muchighlight.h @@ -41,8 +41,8 @@ public: CMUCHighlight()
{
m_fInitialized = false;
- m_TextPatternString = m_NickPatternString = 0;
- m_NickPatterns = m_TextPatterns = 0;
+ m_TextPatternString = m_NickPatternString = nullptr;
+ m_NickPatterns = m_TextPatterns = nullptr;
m_iNickPatterns = m_iTextPatterns = 0;
m_dwFlags = 0;
m_Valid = true;
diff --git a/plugins/TabSRMM/src/sidebar.h b/plugins/TabSRMM/src/sidebar.h index 4d3cc13762..4380ca0a4f 100644 --- a/plugins/TabSRMM/src/sidebar.h +++ b/plugins/TabSRMM/src/sidebar.h @@ -135,7 +135,7 @@ public: void updateSession(CTabBaseDlg *dat);
void processScrollerButtons(UINT cmd);
- void Layout(const RECT *rc = 0, bool fOnlyCalc = false);
+ void Layout(const RECT *rc = nullptr, bool fOnlyCalc = false);
void setVisible(bool fNewVisibility);
void showAll(int showCmd);
@@ -180,7 +180,7 @@ public: uLayoutCount = NR_LAYOUTS;
return(m_layouts);
}
- void scrollIntoView(const CSideBarButton *item = 0);
+ void scrollIntoView(const CSideBarButton *item = nullptr);
void resizeScrollWnd(LONG x, LONG y, LONG width, LONG height) const;
private:
diff --git a/plugins/TabSRMM/src/taskbar.h b/plugins/TabSRMM/src/taskbar.h index d9a3d7935d..ad29335aed 100644 --- a/plugins/TabSRMM/src/taskbar.h +++ b/plugins/TabSRMM/src/taskbar.h @@ -138,14 +138,14 @@ class CTaskbarInteract public:
CTaskbarInteract()
{
- m_pTaskbarInterface = 0;
+ m_pTaskbarInterface = nullptr;
m_IconSize = 0;
m_isEnabled = IsWinVer7Plus() ? true : false;
if (m_isEnabled) {
::CoCreateInstance(CLSID_TaskbarList, nullptr, CLSCTX_ALL, IID_ITaskbarList3, (void**)&m_pTaskbarInterface);
updateMetrics();
- if (0 == m_pTaskbarInterface)
+ if (nullptr == m_pTaskbarInterface)
m_isEnabled = false;
}
@@ -165,7 +165,7 @@ public: {
if (m_isEnabled && m_pTaskbarInterface) {
m_pTaskbarInterface->Release();
- m_pTaskbarInterface = 0;
+ m_pTaskbarInterface = nullptr;
m_isEnabled = false;
}
::UnregisterClass(PROXYCLASSNAME, g_hInst);
diff --git a/plugins/TabSRMM/src/themes.h b/plugins/TabSRMM/src/themes.h index 22d61dacf0..a626a1936a 100644 --- a/plugins/TabSRMM/src/themes.h +++ b/plugins/TabSRMM/src/themes.h @@ -146,7 +146,7 @@ public: CImageItem(const CImageItem& From)
{
*this = From;
- m_nextItem = 0;
+ m_nextItem = nullptr;
}
CImageItem(const wchar_t *szName)
{
@@ -183,8 +183,8 @@ public: void Clear()
{
- m_hdc = 0; m_hbm = 0; m_hbmOld = 0;
- m_fillBrush = (HBRUSH)0;
+ m_hdc = nullptr; m_hbm = nullptr; m_hbmOld = nullptr;
+ m_fillBrush = nullptr;
}
void setBitmap(const HBITMAP hbm)
@@ -354,7 +354,7 @@ public: */
const CImageItem* getGlyphItem() const
{
- return(m_fHaveGlyph ? &m_glyphItem : 0);
+ return(m_fHaveGlyph ? &m_glyphItem : nullptr);
}
bool warnToClose() const;
COLORREF getColorKey() const { return(m_ContainerColorKey); }
diff --git a/plugins/TabSRMM/src/utils.h b/plugins/TabSRMM/src/utils.h index 5b3bf33b18..229c379285 100644 --- a/plugins/TabSRMM/src/utils.h +++ b/plugins/TabSRMM/src/utils.h @@ -57,8 +57,8 @@ public: static void DoubleAmpersands(wchar_t *pszText, size_t len);
static void RTF_CTableInit();
static void RTF_ColorAdd(const wchar_t *tszColname);
- static int ReadContainerSettingsFromDB(const MCONTACT hContact, TContainerSettings *cs, const char *szKey = 0);
- static int WriteContainerSettingsToDB(const MCONTACT hContact, TContainerSettings *cs, const char *szKey = 0);
+ static int ReadContainerSettingsFromDB(const MCONTACT hContact, TContainerSettings *cs, const char *szKey = nullptr);
+ static int WriteContainerSettingsToDB(const MCONTACT hContact, TContainerSettings *cs, const char *szKey = nullptr);
static void SettingsToContainer(TContainerData *pContainer);
static void ContainerToSettings(TContainerData *pContainer);
static void ReadPrivateContainerSettings(TContainerData *pContainer, bool fForce = false);
@@ -154,7 +154,7 @@ public: public:
// static function to construct and show the dialog, returns the user's choice
- static LRESULT show(const int uId, DWORD dwFlags = 0, const wchar_t* tszTxt = 0);
+ static LRESULT show(const int uId, DWORD dwFlags = 0, const wchar_t* tszTxt = nullptr);
static void destroyAll();
LRESULT ShowDialog() const;
diff --git a/plugins/TopToolBar/src/stdafx.h b/plugins/TopToolBar/src/stdafx.h index bc9169318e..ba188f3836 100644 --- a/plugins/TopToolBar/src/stdafx.h +++ b/plugins/TopToolBar/src/stdafx.h @@ -116,7 +116,7 @@ void RemoveFromOptions(int id); //append string
char *AS(char *str, const char *setting, char *addstr)
{
- if (str != NULL) {
+ if (str != nullptr) {
mir_strcpy(str, setting);
mir_strcat(str, addstr);
}
@@ -125,7 +125,7 @@ char *AS(char *str, const char *setting, char *addstr) #define TTB_LAUNCHSERVICE "TTB/LaunchService"
-TopButtonInt* idtopos(int id, int* pPos=NULL);
+TopButtonInt* idtopos(int id, int* pPos = nullptr);
INT_PTR TTBAddButton(WPARAM, LPARAM);
INT_PTR TTBRemoveButton(WPARAM, LPARAM);
diff --git a/plugins/UserInfoEx/src/classMAnnivDate.h b/plugins/UserInfoEx/src/classMAnnivDate.h index e6f328b0c0..987408cb63 100644 --- a/plugins/UserInfoEx/src/classMAnnivDate.h +++ b/plugins/UserInfoEx/src/classMAnnivDate.h @@ -89,14 +89,14 @@ public: int CompareDays(MTime mt) const;
MZodiac Zodiac();
- int Age(MTime *pNow = NULL);
+ int Age(MTime *pNow = nullptr);
void Clear();
// read date from database
int DBGetDate(MCONTACT hContact, LPCSTR pszModule, LPCSTR szDay, LPCSTR szMonth, LPCSTR szYear);
int DBGetDateStamp(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting);
int DBGetAnniversaryDate(MCONTACT hContact, WORD iIndex);
- int DBGetBirthDate(MCONTACT hContact, LPSTR pszProto = NULL);
+ int DBGetBirthDate(MCONTACT hContact, LPSTR pszProto = nullptr);
int DBGetReminderOpts(MCONTACT hContact);
// write date to database
@@ -109,7 +109,7 @@ public: int DBDeleteBirthDate(MCONTACT hContact);
int DBMoveBirthDate(MCONTACT hContact, BYTE bOld, BYTE bNew);
- int BackupBirthday (MCONTACT hContact, LPSTR pszProto = NULL, const BYTE bDontIgnoreAnything = FALSE, PWORD lastAnswer = NULL);
+ int BackupBirthday (MCONTACT hContact, LPSTR pszProto = nullptr, const BYTE bDontIgnoreAnything = FALSE, PWORD lastAnswer = nullptr);
// setting values
void SetDate(const SYSTEMTIME &st);
diff --git a/plugins/UserInfoEx/src/ctrl_annivedit.h b/plugins/UserInfoEx/src/ctrl_annivedit.h index 2c0045d00f..f8656aefc3 100644 --- a/plugins/UserInfoEx/src/ctrl_annivedit.h +++ b/plugins/UserInfoEx/src/ctrl_annivedit.h @@ -53,7 +53,7 @@ class CAnnivEditCtrl : public CBaseCtrl public:
- MAnnivDate* Current() { return CurrentItemValid() ? _pDates[_curDate] : NULL; };
+ MAnnivDate* Current() { return CurrentItemValid() ? _pDates[_curDate] : nullptr; };
WORD CurrentIndex() const { return _curDate; };
WORD NumDates() const { return _numDates; };
BYTE ReminderEnabled() const { return _ReminderEnabled; };
diff --git a/plugins/UserInfoEx/src/dlg_propsheet.h b/plugins/UserInfoEx/src/dlg_propsheet.h index 4de3112d21..a71addd386 100644 --- a/plugins/UserInfoEx/src/dlg_propsheet.h +++ b/plugins/UserInfoEx/src/dlg_propsheet.h @@ -151,7 +151,7 @@ public: ~CPsTree();
__inline void BeginDrag(HTREEITEM hDragItem) { _isDragging = TRUE; _hDragItem = hDragItem; };
- __inline void EndDrag() { _isDragging = FALSE; _hDragItem = NULL; };
+ __inline void EndDrag() { _isDragging = FALSE; _hDragItem = nullptr; };
__inline BYTE IsDragging() const { return _isDragging; };
__inline HTREEITEM DragItem() const { return _hDragItem; };
@@ -165,8 +165,8 @@ public: __inline HIMAGELIST ImageList() const { return _hImages; };
__inline BYTE IsIndexValid(const int index) const { return (index >= 0 && index < _numItems); };
- __inline CPsTreeItem* TreeItem(int index) const { return (IsIndexValid(index) ? _pItems[index] : NULL); };
- __inline HTREEITEM TreeItemHandle(int index) const { return (IsIndexValid(index) ? _pItems[index]->Hti() : NULL); };
+ __inline CPsTreeItem* TreeItem(int index) const { return (IsIndexValid(index) ? _pItems[index] : nullptr); };
+ __inline HTREEITEM TreeItemHandle(int index) const { return (IsIndexValid(index) ? _pItems[index]->Hti() : nullptr); };
__inline int CurrentItemIndex() const { return _curItem; };
__inline CPsTreeItem* CurrentItem() const { return TreeItem(CurrentItemIndex()); };
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactBase.h b/plugins/UserInfoEx/src/ex_import/classExImContactBase.h index d24ffd5f8d..ad89480259 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactBase.h +++ b/plugins/UserInfoEx/src/ex_import/classExImContactBase.h @@ -49,12 +49,12 @@ public: __inline DBVARIANT& uid() { return _dbvUID; }
__inline MCONTACT handle() const { return _hContact; }
- __inline void disp(LPCSTR val) { _pszDisp = val ? mir_strdup(val): NULL; }
- __inline void group(LPCSTR val) { _pszGroup = val ? mir_strdup(val): NULL; }
- __inline void nick(LPCSTR val) { _pszNick = val ? mir_strdup(val): NULL; }
- __inline void proto(LPCSTR val) { _pszProto = val ? mir_strdup(val): NULL; }
- __inline void ampro(LPCSTR val) { _pszAMPro = val ? mir_strdup(val): NULL; }
- __inline void uidk(LPCSTR val) { _pszUIDKey = val ? mir_strdup(val): NULL; }
+ __inline void disp(LPCSTR val) { _pszDisp = val ? mir_strdup(val): nullptr; }
+ __inline void group(LPCSTR val) { _pszGroup = val ? mir_strdup(val): nullptr; }
+ __inline void nick(LPCSTR val) { _pszNick = val ? mir_strdup(val): nullptr; }
+ __inline void proto(LPCSTR val) { _pszProto = val ? mir_strdup(val): nullptr; }
+ __inline void ampro(LPCSTR val) { _pszAMPro = val ? mir_strdup(val): nullptr; }
+ __inline void uidk(LPCSTR val) { _pszUIDKey = val ? mir_strdup(val): nullptr; }
__inline void uid(BYTE val) { _dbvUID.type = DBVT_BYTE; _dbvUID.bVal = val; }
__inline void uid(WORD val) { _dbvUID.type = DBVT_WORD; _dbvUID.wVal = val; }
__inline void uid(DWORD val) { _dbvUID.type = DBVT_DWORD; _dbvUID.dVal = val; }
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h index 36fd2b265e..0636d37dd4 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h @@ -75,13 +75,13 @@ private: BYTE _useUtf8;
WORD _hasUtf8;
- size_t packList(LPIDSTRLIST pList, UINT nList, int iID, size_t *cbRew = NULL);
+ size_t packList(LPIDSTRLIST pList, UINT nList, int iID, size_t *cbRew = nullptr);
BYTE GetSetting(const CHAR *pszModule, const CHAR *pszSetting, DBVARIANT *dbv);
- size_t packDB(const CHAR *pszModule, const CHAR *pszSetting, size_t *cbRew = NULL);
- size_t packDBList(const CHAR *pszModule, const CHAR *pszSetting, MIRANDASERVICE GetList, BYTE bSigned = FALSE, size_t *cbRew = NULL);
+ size_t packDB(const CHAR *pszModule, const CHAR *pszSetting, size_t *cbRew = nullptr);
+ size_t packDBList(const CHAR *pszModule, const CHAR *pszSetting, MIRANDASERVICE GetList, BYTE bSigned = FALSE, size_t *cbRew = nullptr);
- void writeLine(const CHAR *szSet, size_t *cbRew = NULL);
- void writeLineEncoded(const CHAR *szSet, size_t *cbRew = NULL);
+ void writeLine(const CHAR *szSet, size_t *cbRew = nullptr);
+ void writeLineEncoded(const CHAR *szSet, size_t *cbRew = nullptr);
int readLine(LPSTR szVCFSetting, WORD cchSetting);
public:
diff --git a/plugins/UserInfoEx/src/mir_contactqueue.h b/plugins/UserInfoEx/src/mir_contactqueue.h index 9d224a91f3..ce1e388f80 100644 --- a/plugins/UserInfoEx/src/mir_contactqueue.h +++ b/plugins/UserInfoEx/src/mir_contactqueue.h @@ -75,7 +75,7 @@ public: * @retval TRUE - The item is added to the queue successfully.
* @retval FALSE - The item is not added to the queue.
**/
- BOOL Add(int waitTime, MCONTACT hContact, void *param = NULL);
+ BOOL Add(int waitTime, MCONTACT hContact, void *param = nullptr);
/**
* This method adds the desired new item only, if the queue does not yet contain
@@ -88,7 +88,7 @@ public: * @retval TRUE - The item is added to the queue successfully.
* @retval FALSE - The item is not added to the queue.
**/
- BOOL AddIfDontHave(int waitTime, MCONTACT hContact, void *param = NULL);
+ BOOL AddIfDontHave(int waitTime, MCONTACT hContact, void *param = nullptr);
/**
* This method removes all existing queue items for the contact and adds a new queue item
@@ -101,7 +101,7 @@ public: *
* @return nothing
**/
- BOOL AddUnique(int waitTime, MCONTACT hContact, void *param = NULL);
+ BOOL AddUnique(int waitTime, MCONTACT hContact, void *param = nullptr);
/**
* This method removes all existing queue items for the contact with the same parameter as @e param
@@ -114,7 +114,7 @@ public: *
* @return nothing
**/
- BOOL AddUniqueConsiderParam (int waitTime, MCONTACT hContact, void *param = NULL);
+ BOOL AddUniqueConsiderParam (int waitTime, MCONTACT hContact, void *param = nullptr);
// This method resumes the worker thread and immitiatly goes on with the next entry.
void ContinueWithNext();
diff --git a/plugins/UserInfoEx/src/mir_db.h b/plugins/UserInfoEx/src/mir_db.h index bbf6328c1e..f085c8b87d 100644 --- a/plugins/UserInfoEx/src/mir_db.h +++ b/plugins/UserInfoEx/src/mir_db.h @@ -66,11 +66,11 @@ namespace Setting { static FORCEINLINE BYTE GetAsIsEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv)
{ return GetEx(hContact, pszModule, szProto, pszSetting, dbv, 0); }
static FORCEINLINE LPSTR GetAStringEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting)
- { DBVARIANT dbv; return (!GetEx(hContact, pszModule, szProto, pszSetting, &dbv, DBVT_ASCIIZ) && dbv.type == DBVT_ASCIIZ) ? dbv.pszVal : NULL; }
+ { DBVARIANT dbv; return (!GetEx(hContact, pszModule, szProto, pszSetting, &dbv, DBVT_ASCIIZ) && dbv.type == DBVT_ASCIIZ) ? dbv.pszVal : nullptr; }
static FORCEINLINE LPWSTR GetWStringEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting)
- { DBVARIANT dbv; return (!GetEx(hContact, pszModule, szProto, pszSetting, &dbv, DBVT_WCHAR) && dbv.type == DBVT_WCHAR) ? dbv.pwszVal : NULL; }
+ { DBVARIANT dbv; return (!GetEx(hContact, pszModule, szProto, pszSetting, &dbv, DBVT_WCHAR) && dbv.type == DBVT_WCHAR) ? dbv.pwszVal : nullptr; }
static FORCEINLINE LPSTR GetUStringEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting)
- { DBVARIANT dbv; return (!GetEx(hContact, pszModule, szProto, pszSetting, &dbv, DBVT_UTF8) && dbv.type == DBVT_UTF8) ? dbv.pszVal : NULL; }
+ { DBVARIANT dbv; return (!GetEx(hContact, pszModule, szProto, pszSetting, &dbv, DBVT_UTF8) && dbv.type == DBVT_UTF8) ? dbv.pszVal : nullptr; }
WORD GetCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv, const BYTE nType);
static FORCEINLINE WORD GetAsIsCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv)
diff --git a/plugins/YAMN/src/proto/netclient.h b/plugins/YAMN/src/proto/netclient.h index 2414dbdef1..55e0fb0d7d 100644 --- a/plugins/YAMN/src/proto/netclient.h +++ b/plugins/YAMN/src/proto/netclient.h @@ -5,9 +5,9 @@ class CNetClient {
public:
CNetClient(): Stopped(FALSE) {}
- virtual void Connect(const char* servername,const int port)=0;
+ virtual void Connect(const char* servername, const int port)=0;
virtual void Send(const char *query)=0;
- virtual char* Recv(char *buf=NULL,int buflen=65536)=0;
+ virtual char* Recv(char *buf= nullptr, int buflen=65536)=0;
virtual void Disconnect()=0;
virtual BOOL Connected()=0;
virtual void SSLify()=0;
diff --git a/plugins/YAMN/src/proto/netlib.h b/plugins/YAMN/src/proto/netlib.h index de41a6ad04..fd00ed6b84 100644 --- a/plugins/YAMN/src/proto/netlib.h +++ b/plugins/YAMN/src/proto/netlib.h @@ -4,14 +4,14 @@ class CNLClient: public CNetClient
{
public:
- CNLClient(): hConnection(NULL) {}
- void Connect(const char* servername,const int port) throw(DWORD);
+ CNLClient(): hConnection(nullptr) {}
+ void Connect(const char* servername, const int port) throw(DWORD);
void Send(const char *query) throw(DWORD);
- char* Recv(char *buf=NULL,int buflen=65536) throw(DWORD);
+ char* Recv(char *buf= nullptr, int buflen = 65536) throw(DWORD);
void Disconnect();
void SSLify()throw(DWORD);
- inline BOOL Connected() {return hConnection!=NULL;}
+ inline BOOL Connected() {return hConnection != nullptr;}
protected:
HNETLIBCONN hConnection;
diff --git a/plugins/YAMN/src/proto/pop3/pop3.h b/plugins/YAMN/src/proto/pop3/pop3.h index c65dc2ee26..82e1a2c17e 100644 --- a/plugins/YAMN/src/proto/pop3/pop3.h +++ b/plugins/YAMN/src/proto/pop3/pop3.h @@ -19,8 +19,8 @@ class CPop3Client
{
public:
- CPop3Client(): NetClient(NULL), Stopped(FALSE) {}
- ~CPop3Client() {if (NetClient != NULL) delete NetClient;}
+ CPop3Client(): NetClient(nullptr), Stopped(FALSE) {}
+ ~CPop3Client() {if (NetClient != nullptr) delete NetClient;}
char* Connect(const char* servername,const int port=110,BOOL UseSSL=FALSE, BOOL NoTLS=FALSE);
char* RecvRest(char* prev,int mode,int size=65536);
diff --git a/plugins/YAMN/src/stdafx.h b/plugins/YAMN/src/stdafx.h index e932de1d2e..98cff20363 100644 --- a/plugins/YAMN/src/stdafx.h +++ b/plugins/YAMN/src/stdafx.h @@ -177,8 +177,8 @@ void WINAPI g_ReleaseIcon(HICON hIcon); //From synchro.cpp
void WINAPI DeleteMessagesToEndFcn(HACCOUNT Account, HYAMNMAIL From);
-DWORD WINAPI WaitToWriteFcn(PSWMRG SObject, PSCOUNTER SCounter = NULL);
-void WINAPI WriteDoneFcn(PSWMRG SObject, PSCOUNTER SCounter = NULL);
+DWORD WINAPI WaitToWriteFcn(PSWMRG SObject, PSCOUNTER SCounter = nullptr);
+void WINAPI WriteDoneFcn(PSWMRG SObject, PSCOUNTER SCounter = nullptr);
DWORD WINAPI WaitToReadFcn(PSWMRG SObject);
void WINAPI ReadDoneFcn(PSWMRG SObject);
DWORD WINAPI SCIncFcn(PSCOUNTER SCounter);
diff --git a/plugins/mTextControl/src/FormattedTextDraw.h b/plugins/mTextControl/src/FormattedTextDraw.h index 8f318717e6..c44d1f25e5 100644 --- a/plugins/mTextControl/src/FormattedTextDraw.h +++ b/plugins/mTextControl/src/FormattedTextDraw.h @@ -59,10 +59,10 @@ public: {
HDC hdcScreen;
- hdcScreen = GetDC(NULL);
+ hdcScreen = GetDC(nullptr);
nPixelsPerInchX = GetDeviceCaps(hdcScreen, LOGPIXELSX);
nPixelsPerInchY = GetDeviceCaps(hdcScreen, LOGPIXELSY);
- ReleaseDC(NULL, hdcScreen);
+ ReleaseDC(nullptr, hdcScreen);
SetRectEmpty(&m_rcClient);
SetRectEmpty(&m_rcViewInset);
@@ -71,8 +71,8 @@ public: InitDefaultCharFormat();
InitDefaultParaFormat();
- m_spTextServices = NULL;
- m_spTextDocument = NULL;
+ m_spTextServices = nullptr;
+ m_spTextDocument = nullptr;
m_dwPropertyBits = TXTBIT_RICHTEXT | TXTBIT_MULTILINE | TXTBIT_WORDWRAP | TXTBIT_USECURRENTBKG;
m_dwScrollbar = 0;
@@ -82,9 +82,9 @@ public: ~CFormattedTextDraw()
{
free(m_pCF);
- if (m_spTextServices != NULL)
+ if (m_spTextServices != nullptr)
m_spTextServices->Release();
- if (m_spTextDocument != NULL)
+ if (m_spTextDocument != nullptr)
m_spTextDocument->Release();
}
@@ -93,7 +93,7 @@ public: /* [in] */ REFIID,
/* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject)
{
- *ppvObject = NULL;
+ *ppvObject = nullptr;
return S_FALSE;
}
|