summaryrefslogtreecommitdiff
path: root/plugins/HistorySweeperLight/src
diff options
context:
space:
mode:
authorGoraf <22941576+Goraf@users.noreply.github.com>2017-11-13 15:03:31 +0100
committerGoraf <22941576+Goraf@users.noreply.github.com>2017-11-13 15:07:33 +0100
commita7c24ca48995cf2bf436156302f96b91bf135409 (patch)
tree953835509ff1b778833e78fd7b74b05e05e77c84 /plugins/HistorySweeperLight/src
parent591ec17b1c99db7f120c22ca9fb20ae05fe78325 (diff)
Code modernize ...
* replace 0/NULL with nullptr [using clang-tidy]
Diffstat (limited to 'plugins/HistorySweeperLight/src')
-rw-r--r--plugins/HistorySweeperLight/src/historysweeperlight.cpp12
-rw-r--r--plugins/HistorySweeperLight/src/options.cpp6
2 files changed, 9 insertions, 9 deletions
diff --git a/plugins/HistorySweeperLight/src/historysweeperlight.cpp b/plugins/HistorySweeperLight/src/historysweeperlight.cpp
index 87e42974f6..ad73c5d46c 100644
--- a/plugins/HistorySweeperLight/src/historysweeperlight.cpp
+++ b/plugins/HistorySweeperLight/src/historysweeperlight.cpp
@@ -30,7 +30,7 @@ typedef struct
// build criteria
time_t BuildCriteria(int dwti)
{
- time_t tim = time(NULL);
+ time_t tim = time(nullptr);
switch (dwti) {
case 0:
@@ -93,7 +93,7 @@ static int CompareBookmarks(const void* p1, const void* p2)
static void GetBookmarks(MCONTACT hContact, BEventData** books, size_t* bookcnt)
{
- *books = NULL;
+ *books = nullptr;
*bookcnt = 0;
DBVARIANT dbv;
@@ -143,7 +143,7 @@ void SweepHistoryFromContact(MCONTACT hContact, CriteriaStruct Criteria, BOOL ke
BEventData *books, *item, ev = { 0 };
size_t bookcnt, btshift;
- SetCursor(LoadCursor(0, IDC_WAIT));
+ SetCursor(LoadCursor(nullptr, IDC_WAIT));
// switch off SAFETYMODE if necessary
if (unsafe)
@@ -167,7 +167,7 @@ void SweepHistoryFromContact(MCONTACT hContact, CriteriaStruct Criteria, BOOL ke
if (bookcnt != 0) { // keep bookmarks
ev.hDBEvent = hDBEvent;
item = (BEventData*)bsearch(&ev, books, bookcnt, sizeof(BEventData), CompareBookmarks);
- if (item != NULL && item->Timestamp == dbei.timestamp) {
+ if (item != nullptr && item->Timestamp == dbei.timestamp) {
doDelete = FALSE;
btshift = (--bookcnt - (item - books))*sizeof(BEventData);
if (btshift)
@@ -189,7 +189,7 @@ void SweepHistoryFromContact(MCONTACT hContact, CriteriaStruct Criteria, BOOL ke
if (unsafe)
db_set_safety_mode(TRUE);
- SetCursor(LoadCursor(0, IDC_ARROW));
+ SetCursor(LoadCursor(nullptr, IDC_ARROW));
}
// shutdown action
@@ -237,7 +237,7 @@ void SetSrmmIcon(MCONTACT hContact)
{
int sweep = db_get_b(hContact, ModuleName, "SweepHistory", 0);
- StatusIconData sid = { 0 };
+ StatusIconData sid = {};
sid.szModule = ModuleName;
for (int i = 0; i < 4; i++) {
diff --git a/plugins/HistorySweeperLight/src/options.cpp b/plugins/HistorySweeperLight/src/options.cpp
index d2b68c7a12..b503a09580 100644
--- a/plugins/HistorySweeperLight/src/options.cpp
+++ b/plugins/HistorySweeperLight/src/options.cpp
@@ -72,7 +72,7 @@ HANDLE GetIconHandle(const char* name)
if (mir_strcmp(iconList[i].szName, name) == 0)
return hIconLibItem[i];
- return NULL;
+ return nullptr;
}
void ReleaseIconEx(const char* name)
@@ -168,7 +168,7 @@ void SaveSettings(HWND hwndDlg)
// set tooltips
int st = db_get_b(NULL, ModuleName, "SweepHistory", 0);
- StatusIconData sid = { 0 };
+ StatusIconData sid = {};
sid.szModule = ModuleName;
sid.dwId = 0;
sid.hIcon = LoadIconEx("actG");
@@ -249,7 +249,7 @@ INT_PTR CALLBACK DlgProcHSOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam)
// Find clicked item
hItem = (HANDLE)SendMessage(nmc->hdr.hwndFrom, CLM_HITTEST, (WPARAM)&hitFlags, MAKELPARAM(nmc->pt.x, nmc->pt.y));
// Nothing was clicked
- if (hItem == NULL || !(IsHContactContact(hItem) || IsHContactInfo(hItem)))
+ if (hItem == nullptr || !(IsHContactContact(hItem) || IsHContactInfo(hItem)))
break;
// It was not our extended icon