diff options
author | Goraf <22941576+Goraf@users.noreply.github.com> | 2017-11-13 15:03:31 +0100 |
---|---|---|
committer | Goraf <22941576+Goraf@users.noreply.github.com> | 2017-11-13 15:07:33 +0100 |
commit | a7c24ca48995cf2bf436156302f96b91bf135409 (patch) | |
tree | 953835509ff1b778833e78fd7b74b05e05e77c84 /plugins/FavContacts/src/contact_cache.cpp | |
parent | 591ec17b1c99db7f120c22ca9fb20ae05fe78325 (diff) |
Code modernize ...
* replace 0/NULL with nullptr [using clang-tidy]
Diffstat (limited to 'plugins/FavContacts/src/contact_cache.cpp')
-rw-r--r-- | plugins/FavContacts/src/contact_cache.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins/FavContacts/src/contact_cache.cpp b/plugins/FavContacts/src/contact_cache.cpp index 9c6b49543e..d6039f3782 100644 --- a/plugins/FavContacts/src/contact_cache.cpp +++ b/plugins/FavContacts/src/contact_cache.cpp @@ -30,13 +30,13 @@ int __cdecl CContactCache::OnDbEventAdded(WPARAM hContact, LPARAM hEvent) if (dbei.eventType != EVENTTYPE_MESSAGE)
return 0;
- float weight = GetEventWeight(time(NULL) - dbei.timestamp);
- float q = GetTimeWeight(time(NULL) - m_lastUpdate);
- m_lastUpdate = time(NULL);
+ float weight = GetEventWeight(time(nullptr) - dbei.timestamp);
+ float q = GetTimeWeight(time(nullptr) - m_lastUpdate);
+ m_lastUpdate = time(nullptr);
if (!weight)
return 0;
- TContactInfo *pFound = NULL;
+ TContactInfo *pFound = nullptr;
mir_cslock lck(m_cs);
for (int i = m_cache.getCount()-1; i >= 0; i--) {
TContactInfo *p = m_cache[i];
@@ -77,8 +77,8 @@ float CContactCache::GetTimeWeight(unsigned long age) void CContactCache::Rebuild()
{
- unsigned long timestamp = time(NULL);
- m_lastUpdate = time(NULL);
+ unsigned long timestamp = time(nullptr);
+ m_lastUpdate = time(nullptr);
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
TContactInfo *info = new TContactInfo;
@@ -150,7 +150,7 @@ void CContactCache::TContactInfo::LoadInfo() wchar_t *nb_stristr(wchar_t *str, wchar_t *substr)
{
if (!substr || !*substr) return str;
- if (!str || !*str) return NULL;
+ if (!str || !*str) return nullptr;
wchar_t *str_up = NEWWSTR_ALLOCA(str);
wchar_t *substr_up = NEWWSTR_ALLOCA(substr);
@@ -159,7 +159,7 @@ wchar_t *nb_stristr(wchar_t *str, wchar_t *substr) CharUpperBuff(substr_up, (DWORD)mir_wstrlen(substr_up));
wchar_t *p = wcsstr(str_up, substr_up);
- return p ? (str + (p - str_up)) : NULL;
+ return p ? (str + (p - str_up)) : nullptr;
}
bool CContactCache::filter(int rate, wchar_t *str)
|