summaryrefslogtreecommitdiff
path: root/plugins/TipperYM/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/TipperYM/src')
-rw-r--r--plugins/TipperYM/src/bitmap_func.cpp34
-rw-r--r--plugins/TipperYM/src/message_pump.cpp50
-rw-r--r--plugins/TipperYM/src/mir_smileys.cpp32
-rw-r--r--plugins/TipperYM/src/options.cpp66
-rw-r--r--plugins/TipperYM/src/popwin.cpp138
-rw-r--r--plugins/TipperYM/src/preset_items.cpp112
-rw-r--r--plugins/TipperYM/src/skin_parser.cpp10
-rw-r--r--plugins/TipperYM/src/str_utils.cpp24
-rw-r--r--plugins/TipperYM/src/subst.cpp74
-rw-r--r--plugins/TipperYM/src/tipper.cpp8
-rw-r--r--plugins/TipperYM/src/translations.cpp66
11 files changed, 307 insertions, 307 deletions
diff --git a/plugins/TipperYM/src/bitmap_func.cpp b/plugins/TipperYM/src/bitmap_func.cpp
index dcaf7b776c..e930980b5a 100644
--- a/plugins/TipperYM/src/bitmap_func.cpp
+++ b/plugins/TipperYM/src/bitmap_func.cpp
@@ -20,15 +20,15 @@ Boston, MA 02111-1307, USA.
#include "stdafx.h"
-TOOLTIPSKIN skin = {0};
+TOOLTIPSKIN skin = {};
HBITMAP CreateBitmapPart(FIBITMAP *fibSrc, int iSrcWidth, int iSrcHeight, int iDesWidth, int iDesHeight, TransformationMode transfMode)
{
- FIBITMAP *fibMem = NULL;
- HBITMAP hbmpDes = NULL;
+ FIBITMAP *fibMem = nullptr;
+ HBITMAP hbmpDes = nullptr;
if (!fibSrc)
- return NULL;
+ return nullptr;
switch (transfMode) {
case TM_NONE:
@@ -152,7 +152,7 @@ void CreateFromBitmaps(bool bServiceTip)
wchar_t* tszFileName = opt.szImgFile[i];
if (tszFileName && *tszFileName != 0) {
- FIBITMAP *fib = NULL;
+ FIBITMAP *fib = nullptr;
if (!skin.bCached) {
FIBITMAP *fibLoad = (FIBITMAP *)CallService(MS_IMG_LOAD, (WPARAM)tszFileName, IMGL_WCHAR | IMGL_RETURNDIB);
if (!fibLoad) continue;
@@ -194,7 +194,7 @@ void CreateFromBitmaps(bool bServiceTip)
iCentWidth = max(rcWidth - left - right, 0);
iCentHeight = max(rcHeight - top - bottom, 0);
- FIBITMAP *fibCentre = NULL, *fibMem = NULL;
+ FIBITMAP *fibCentre = nullptr, *fibMem = nullptr;
if (opt.margins[i].left || opt.margins[i].top || opt.margins[i].right || opt.margins[i].bottom) {
// create corners bitmaps
if (!skin.bCached) {
@@ -263,7 +263,7 @@ void CreateFromBitmaps(bool bServiceTip)
}
}
- HDC hdcMem = CreateCompatibleDC(0);
+ HDC hdcMem = CreateCompatibleDC(nullptr);
RECT rc = {0};
if (skin.hbmpSkinParts[i][SP_CENTRE_AREA]) {
@@ -312,7 +312,7 @@ void CreateFromBitmaps(bool bServiceTip)
for (int j = 0; j < SP_CORNER_TL; j++)
if (skin.hbmpSkinParts[i][j]) {
DeleteObject(skin.hbmpSkinParts[i][j]);
- skin.hbmpSkinParts[i][j] = NULL;
+ skin.hbmpSkinParts[i][j] = nullptr;
}
skin.bNeedLayerUpdate = true;
@@ -348,10 +348,10 @@ void CreateSkinBitmap(int iWidth, int iHeight, bool bServiceTip)
if (skin.hBitmap) {
SelectObject(skin.hdc, skin.hOldBitmap);
DeleteObject(skin.hBitmap);
- skin.hBitmap = NULL;
+ skin.hBitmap = nullptr;
}
DeleteDC(skin.hdc);
- skin.hdc = NULL;
+ skin.hdc = nullptr;
}
skin.iWidth = iWidth;
@@ -365,11 +365,11 @@ void CreateSkinBitmap(int iWidth, int iHeight, bool bServiceTip)
bi.bmiHeader.biPlanes = 1;
bi.bmiHeader.biBitCount = 32;
bi.bmiHeader.biCompression = BI_RGB;
- skin.hBitmap = (HBITMAP)CreateDIBSection(0, &bi, DIB_RGB_COLORS, (void **)&skin.colBits, 0, 0);
+ skin.hBitmap = (HBITMAP)CreateDIBSection(nullptr, &bi, DIB_RGB_COLORS, (void **)&skin.colBits, nullptr, 0);
if (!skin.hBitmap)
return;
- skin.hdc = CreateCompatibleDC(0);
+ skin.hdc = CreateCompatibleDC(nullptr);
skin.hOldBitmap = (HBITMAP)SelectObject(skin.hdc, skin.hBitmap);
if (opt.skinMode == SM_COLORFILL)
@@ -386,13 +386,13 @@ void DestroySkinBitmap()
for (int i = 0; i < SKIN_ITEMS_COUNT; i++) {
if (skin.fib[i]) {
fii->FI_Unload(skin.fib[i]);
- skin.fib[i] = NULL;
+ skin.fib[i] = nullptr;
}
for (int j = SP_CORNER_TL; j < SKIN_PARTS_COUNT; j++) {
if (skin.hbmpSkinParts[i][j]) {
DeleteObject(skin.hbmpSkinParts[i][j]);
- skin.hbmpSkinParts[i][j] = NULL;
+ skin.hbmpSkinParts[i][j] = nullptr;
}
}
}
@@ -473,7 +473,7 @@ BOOL IsAlphaTransparent(HBITMAP hBitmap)
DWORD dwLen = bmp.bmWidth * bmp.bmHeight * (bmp.bmBitsPixel / 8);
BYTE *p = (BYTE *)mir_calloc(dwLen);
- if (p == NULL)
+ if (p == nullptr)
return FALSE;
GetBitmapBits(hBitmap, dwLen, p);
@@ -615,7 +615,7 @@ void ColorizeBitmap()
HRGN CreateOpaqueRgn(BYTE level, bool bOpaque)
{
if (!skin.colBits)
- return NULL;
+ return nullptr;
GdiFlush();
@@ -666,7 +666,7 @@ HRGN CreateOpaqueRgn(BYTE level, bool bOpaque)
}
}
- HRGN hRgn = ExtCreateRegion(NULL, sizeof(RGNDATAHEADER) + pRgnData->rdh.nCount*sizeof(RECT), (LPRGNDATA)pRgnData);
+ HRGN hRgn = ExtCreateRegion(nullptr, sizeof(RGNDATAHEADER) + pRgnData->rdh.nCount*sizeof(RECT), (LPRGNDATA)pRgnData);
free(pRgnData);
return hRgn;
}
diff --git a/plugins/TipperYM/src/message_pump.cpp b/plugins/TipperYM/src/message_pump.cpp
index 8fa62b1c8f..ffc5237068 100644
--- a/plugins/TipperYM/src/message_pump.cpp
+++ b/plugins/TipperYM/src/message_pump.cpp
@@ -22,8 +22,8 @@ Boston, MA 02111-1307, USA.
#include <tchar.h>
-HMODULE hDwmapiDll = 0;
-HRESULT (WINAPI *MyDwmEnableBlurBehindWindow)(HWND hWnd, DWM_BLURBEHIND *pBlurBehind) = 0;
+HMODULE hDwmapiDll = nullptr;
+HRESULT (WINAPI *MyDwmEnableBlurBehindWindow)(HWND hWnd, DWM_BLURBEHIND *pBlurBehind) = nullptr;
unsigned int uintMessagePumpThreadId = 0;
POINT pt = {-1};
@@ -38,7 +38,7 @@ __inline bool IsContactTooltip(CLCINFOTIPEX *clc)
void CALLBACK TimerProcWaitForContent(HWND, UINT, UINT_PTR, DWORD)
{
- KillTimer(0, WaitForContentTimerID);
+ KillTimer(nullptr, WaitForContentTimerID);
WaitForContentTimerID = 0;
bStatusMsgReady = true;
bAvatarReady = true;
@@ -60,9 +60,9 @@ bool NeedWaitForContent(CLCINFOTIPEX *clcitex)
if (CanRetrieveStatusMsg(hContact, szProto) && ProtoChainSend(hContact, PSS_GETAWAYMSG, 0, 0))
{
if (WaitForContentTimerID)
- KillTimer(0, WaitForContentTimerID);
+ KillTimer(nullptr, WaitForContentTimerID);
- WaitForContentTimerID = SetTimer(NULL, 0, WAIT_TIMER_INTERVAL, TimerProcWaitForContent);
+ WaitForContentTimerID = SetTimer(nullptr, 0, WAIT_TIMER_INTERVAL, TimerProcWaitForContent);
bNeedWait = true;
}
}
@@ -79,9 +79,9 @@ bool NeedWaitForContent(CLCINFOTIPEX *clcitex)
if (!ace)
{
if (WaitForContentTimerID)
- KillTimer(0, WaitForContentTimerID);
+ KillTimer(nullptr, WaitForContentTimerID);
- WaitForContentTimerID = SetTimer(NULL, 0, WAIT_TIMER_INTERVAL, TimerProcWaitForContent);
+ WaitForContentTimerID = SetTimer(nullptr, 0, WAIT_TIMER_INTERVAL, TimerProcWaitForContent);
bNeedWait = true;
}
else
@@ -105,12 +105,12 @@ unsigned int CALLBACK MessagePumpThread(void*)
{
Thread_SetName("TipperYM: MessagePumpThread");
- HWND hwndTip = NULL;
- CLCINFOTIPEX *clcitex = NULL;
- MSG hwndMsg = {0};
+ HWND hwndTip = nullptr;
+ CLCINFOTIPEX *clcitex = nullptr;
+ MSG hwndMsg = {};
- while (GetMessage(&hwndMsg, NULL, 0, 0) > 0 && !Miranda_IsTerminated()) {
- if (hwndMsg.hwnd != NULL && IsDialogMessage(hwndMsg.hwnd, &hwndMsg)) /* Wine fix. */
+ while (GetMessage(&hwndMsg, nullptr, 0, 0) > 0 && !Miranda_IsTerminated()) {
+ if (hwndMsg.hwnd != nullptr && IsDialogMessage(hwndMsg.hwnd, &hwndMsg)) /* Wine fix. */
continue;
switch (hwndMsg.message) {
case MUM_CREATEPOPUP:
@@ -124,11 +124,11 @@ unsigned int CALLBACK MessagePumpThread(void*)
if (!NeedWaitForContent(clcitex)) {
if (hwndTip)
MyDestroyWindow(hwndTip);
- hwndTip = CreateWindowEx(WS_EX_TOOLWINDOW | WS_EX_TOPMOST, POP_WIN_CLASS, NULL, WS_POPUP, 0, 0, 0, 0, 0, 0, hInst, (LPVOID)clcitex);
+ hwndTip = CreateWindowEx(WS_EX_TOOLWINDOW | WS_EX_TOPMOST, POP_WIN_CLASS, nullptr, WS_POPUP, 0, 0, 0, 0, nullptr, nullptr, hInst, (LPVOID)clcitex);
if (clcitex) {
mir_free(clcitex);
- clcitex = NULL;
+ clcitex = nullptr;
}
bStatusMsgReady = false;
@@ -138,12 +138,12 @@ unsigned int CALLBACK MessagePumpThread(void*)
case MUM_DELETEPOPUP:
if (hwndTip) {
MyDestroyWindow(hwndTip);
- hwndTip = 0;
+ hwndTip = nullptr;
}
if (clcitex) {
mir_free(clcitex);
- clcitex = NULL;
+ clcitex = nullptr;
}
bStatusMsgReady = false;
@@ -156,7 +156,7 @@ unsigned int CALLBACK MessagePumpThread(void*)
if (opt.bWaitForContent && !bStatusMsgReady && clcitex && clcitex->hItem == (HANDLE)hContact) {
if (WaitForContentTimerID) {
- KillTimer(0, WaitForContentTimerID);
+ KillTimer(nullptr, WaitForContentTimerID);
WaitForContentTimerID = 0;
}
@@ -183,7 +183,7 @@ unsigned int CALLBACK MessagePumpThread(void*)
MCONTACT hContact = (MCONTACT)hwndMsg.wParam;
if (opt.bWaitForContent && !bAvatarReady && clcitex && clcitex->hItem == (HANDLE)hContact) {
if (WaitForContentTimerID) {
- KillTimer(0, WaitForContentTimerID);
+ KillTimer(nullptr, WaitForContentTimerID);
WaitForContentTimerID = 0;
}
@@ -215,7 +215,7 @@ void InitMessagePump()
wcl.cbSize = sizeof(wcl);
wcl.lpfnWndProc = PopupWindowProc;
wcl.hInstance = hInst;
- wcl.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wcl.hCursor = LoadCursor(nullptr, IDC_ARROW);
wcl.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH);
wcl.lpszClassName = POP_WIN_CLASS;
RegisterClassEx(&wcl);
@@ -224,7 +224,7 @@ void InitMessagePump()
if (hDwmapiDll)
MyDwmEnableBlurBehindWindow = (HRESULT (WINAPI *)(HWND, DWM_BLURBEHIND *))GetProcAddress(hDwmapiDll, "DwmEnableBlurBehindWindow");
- CloseHandle(mir_forkthreadex(MessagePumpThread, NULL, &uintMessagePumpThreadId));
+ CloseHandle(mir_forkthreadex(MessagePumpThread, nullptr, &uintMessagePumpThreadId));
}
void DeinitMessagePump()
@@ -247,8 +247,8 @@ INT_PTR ShowTip(WPARAM wParam, LPARAM lParam)
CLCINFOTIPEX *clcit2 = (CLCINFOTIPEX *)mir_alloc(sizeof(CLCINFOTIPEX));
memcpy(clcit2, clcit, sizeof(CLCINFOTIP));
clcit2->cbSize = sizeof(CLCINFOTIPEX);
- clcit2->szProto = NULL;
- clcit2->swzText = NULL;
+ clcit2->szProto = nullptr;
+ clcit2->swzText = nullptr;
if (wParam) // wParam is char pointer containing text - e.g. status bar tooltip
{
@@ -279,8 +279,8 @@ INT_PTR ShowTipW(WPARAM wParam, LPARAM lParam)
CLCINFOTIPEX *clcit2 = (CLCINFOTIPEX *)mir_alloc(sizeof(CLCINFOTIPEX));
memcpy(clcit2, clcit, sizeof(CLCINFOTIP));
clcit2->cbSize = sizeof(CLCINFOTIPEX);
- clcit2->szProto = NULL;
- clcit2->swzText = NULL;
+ clcit2->szProto = nullptr;
+ clcit2->swzText = nullptr;
if (wParam) // wParam is char pointer containing text - e.g. status bar tooltip
{
@@ -311,7 +311,7 @@ int HideTipHook(WPARAM wParam, LPARAM lParam)
int ProtoAck(WPARAM, LPARAM lParam)
{
ACKDATA *ack = (ACKDATA*)lParam;
- if ((ack==NULL) || (ack->result != ACKRESULT_SUCCESS))
+ if ((ack==nullptr) || (ack->result != ACKRESULT_SUCCESS))
return 0;
if (ack->type == ACKTYPE_AWAYMSG) {
diff --git a/plugins/TipperYM/src/mir_smileys.cpp b/plugins/TipperYM/src/mir_smileys.cpp
index ed8ad1a0b4..1d7544eeda 100644
--- a/plugins/TipperYM/src/mir_smileys.cpp
+++ b/plugins/TipperYM/src/mir_smileys.cpp
@@ -39,7 +39,7 @@ int InitTipperSmileys()
SMILEYPARSEINFO Smileys_PreParse(LPCTSTR lpString, int nCount, const char *protocol)
{
if (!(opt.iSmileyAddFlags & SMILEYADD_ENABLE))
- return NULL;
+ return nullptr;
if (nCount == -1)
nCount = (int)mir_wstrlen(lpString);
@@ -49,7 +49,7 @@ SMILEYPARSEINFO Smileys_PreParse(LPCTSTR lpString, int nCount, const char *proto
if (!info->pieces) {
mir_free(info);
- return NULL;
+ return nullptr;
}
return info;
@@ -57,8 +57,8 @@ SMILEYPARSEINFO Smileys_PreParse(LPCTSTR lpString, int nCount, const char *proto
void Smileys_FreeParse(SMILEYPARSEINFO parseInfo)
{
- if (parseInfo != NULL) {
- if (parseInfo->pieces != NULL)
+ if (parseInfo != nullptr) {
+ if (parseInfo->pieces != nullptr)
DestroySmileyList(parseInfo->pieces);
mir_free(parseInfo);
@@ -89,7 +89,7 @@ int Smileys_DrawText(HDC hDC, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT
// Draw
- if (parseInfo->pieces == NULL)
+ if (parseInfo->pieces == nullptr)
return DrawText(hDC, lpString, nCount, lpRect, uFormat);
RECT rc = *lpRect;
@@ -112,14 +112,14 @@ SIZE GetTextSize(HDC hdcMem, const wchar_t *szText, SMILEYPARSEINFO info, UINT u
int text_height;
int row_count = 0, pos_x = 0;
- if (szText == NULL || wcslen(szText) == 0) {
+ if (szText == nullptr || wcslen(szText) == 0) {
text_size.cy = 0;
text_size.cx = 0;
}
else {
RECT text_rc = { 0, 0, 2048, 2048 };
- if (info->pieces == NULL) {
+ if (info->pieces == nullptr) {
DrawText(hdcMem, szText, -1, &text_rc, DT_CALCRECT | uTextFormat);
text_size.cx = text_rc.right - text_rc.left;
text_size.cy = text_rc.bottom - text_rc.top;
@@ -181,7 +181,7 @@ SIZE GetTextSize(HDC hdcMem, const wchar_t *szText, SMILEYPARSEINFO info, UINT u
void DrawTextSmiley(HDC hdcMem, RECT free_rc, const wchar_t *szText, int len, SMILEYPARSEINFO info, UINT uTextFormat)
{
- if (szText == NULL)
+ if (szText == nullptr)
return;
uTextFormat &= ~DT_RIGHT;
@@ -276,7 +276,7 @@ void DrawTextSmiley(HDC hdcMem, RECT free_rc, const wchar_t *szText, int len, SM
}
shift = (info->row_height[row_count] - (LONG)(piece->smiley_height * factor)) >> 1;
- DrawIconExAlpha(hdcMem, text_rc.left, text_rc.top + shift, piece->smiley, piece->smiley_width * factor, piece->smiley_height * factor, 0, NULL, DI_NORMAL, true);
+ DrawIconExAlpha(hdcMem, text_rc.left, text_rc.top + shift, piece->smiley, piece->smiley_width * factor, piece->smiley_height * factor, 0, nullptr, DI_NORMAL, true);
}
}
}
@@ -287,13 +287,13 @@ void DrawTextSmiley(HDC hdcMem, RECT free_rc, const wchar_t *szText, int len, SM
void DestroySmileyList(SortedList* p_list)
{
- if (p_list == NULL)
+ if (p_list == nullptr)
return;
- if (p_list->items != NULL) {
+ if (p_list->items != nullptr) {
for (int i = 0; i < p_list->realCount; i++) {
TEXTPIECE *piece = (TEXTPIECE *)p_list->items[i];
- if (piece != NULL) {
+ if (piece != nullptr) {
if (piece->type == TEXT_PIECE_TYPE_SMILEY)
DestroyIcon(piece->smiley);
@@ -311,10 +311,10 @@ SortedList *ReplaceSmileys(const wchar_t *text, int text_size, const char *proto
*max_smiley_height = 0;
if (!text || !text[0] || !ServiceExists(MS_SMILEYADD_BATCHPARSE))
- return NULL;
+ return nullptr;
char smileyProto[64];
- if (protocol == NULL)
+ if (protocol == nullptr)
strncpy(smileyProto, "tipper", sizeof(smileyProto) - 1);
else if (mir_strcmp(protocol, META_PROTO) == 0)
strncpy(smileyProto, "tipper", sizeof(smileyProto) - 1);
@@ -330,7 +330,7 @@ SortedList *ReplaceSmileys(const wchar_t *text, int text_size, const char *proto
SMADD_BATCHPARSERES *spres = (SMADD_BATCHPARSERES *)CallService(MS_SMILEYADD_BATCHPARSE, 0, (LPARAM)&sp);
if (!spres) // Did not find a smiley
- return NULL;
+ return nullptr;
// Lets add smileys
SortedList *plText = List_Create(0, 10);
@@ -426,7 +426,7 @@ SortedList *ReplaceSmileys(const wchar_t *text, int text_size, const char *proto
int DrawTextExt(HDC hdc, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT uFormat, SMILEYPARSEINFO spi)
{
- if ((opt.iSmileyAddFlags & SMILEYADD_ENABLE) && spi != NULL) {
+ if ((opt.iSmileyAddFlags & SMILEYADD_ENABLE) && spi != nullptr) {
if (opt.iSmileyAddFlags & SMILEYADD_RESIZE)
uFormat |= DT_RESIZE_SMILEYS;
diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp
index 3ca7f1a096..3b4beff698 100644
--- a/plugins/TipperYM/src/options.cpp
+++ b/plugins/TipperYM/src/options.cpp
@@ -25,7 +25,7 @@ ICONSTATE exIcons[EXICONS_COUNT];
extern int IsTrayProto(const wchar_t *swzProto, BOOL bExtendedTip)
{
- if (swzProto == NULL)
+ if (swzProto == nullptr)
return 0;
char szSetting[64];
@@ -60,11 +60,11 @@ void CreateDefaultItems()
}
else {
PRESETITEM *item = GetPresetItemByName(defaultItemList[i].szName);
- if (item == NULL) continue;
+ if (item == nullptr) continue;
for (int j = 0; j < MAX_PRESET_SUBST_COUNT; j++) {
PRESETSUBST *subst = GetPresetSubstByName(item->szNeededSubst[j]);
- if (subst == NULL) continue;
+ if (subst == nullptr) continue;
DSListNode *ds_node = (DSListNode *)mir_alloc(sizeof(DSListNode));
wcsncpy(ds_node->ds.swzName, subst->swzName, LABEL_LEN);
@@ -344,7 +344,7 @@ void LoadOptions()
opt.bShowNoFocus = (db_get_b(0, MODULE, "ShowNoFocus", 1) == 1);
int i, real_count = 0;
- opt.dsList = 0;
+ opt.dsList = nullptr;
DSListNode *ds_node;
opt.iDsCount = db_get_w(0, MODULE_ITEMS, "DSNumValues", 0);
@@ -361,7 +361,7 @@ void LoadOptions()
opt.iDsCount = real_count;
real_count = 0;
- opt.diList = 0;
+ opt.diList = nullptr;
DIListNode *di_node;
opt.bWaitForStatusMsg = false;
@@ -414,7 +414,7 @@ void LoadOptions()
wcsncpy(di_node->di.swzLabel, L"Last message: (%sys:last_msg_reltime% ago)", LABEL_LEN);
wcsncpy(di_node->di.swzValue, L"%sys:last_msg%", VALUE_LEN);
di_node->di.bLineAbove = di_node->di.bValueNewline = true;
- di_node->next = 0;
+ di_node->next = nullptr;
opt.iDiCount++;
}
@@ -439,7 +439,7 @@ void LoadOptions()
wcsncpy(di_node->di.swzLabel, L"Status message:", LABEL_LEN);
wcsncpy(di_node->di.swzValue, L"%sys:status_msg%", VALUE_LEN);
di_node->di.bLineAbove = di_node->di.bValueNewline = true;
- di_node->next = 0;
+ di_node->next = nullptr;
opt.iDiCount++;
}
@@ -609,9 +609,9 @@ INT_PTR CALLBACK DlgProcAddItem(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
case IDC_BTN_VARIABLE:
{
if (GetFocus() == GetDlgItem(hwndDlg, IDC_ED_LABEL))
- variables_showhelp(hwndDlg, IDC_ED_LABEL, VHF_FULLDLG, NULL, NULL);
+ variables_showhelp(hwndDlg, IDC_ED_LABEL, VHF_FULLDLG, nullptr, nullptr);
else
- variables_showhelp(hwndDlg, IDC_ED_VALUE, VHF_FULLDLG, NULL, NULL);
+ variables_showhelp(hwndDlg, IDC_ED_VALUE, VHF_FULLDLG, nullptr, nullptr);
return TRUE;
}
}
@@ -794,7 +794,7 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), GWL_STYLE) | TVS_CHECKBOXES);
{
- TVINSERTSTRUCT tvi = { 0 };
+ TVINSERTSTRUCT tvi = {};
tvi.hInsertAfter = TVI_LAST;
tvi.item.mask = TVIF_TEXT | TVIF_PARAM | TVIF_STATE;
tvi.item.stateMask = TVIS_STATEIMAGEMASK;
@@ -888,7 +888,7 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
int result = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_ITEM), hwndDlg, DlgProcAddItem, (LPARAM)&di_value->di);
if (result == IDOK || (result >= IDPRESETITEM && result < (IDPRESETITEM + 100))) {
- TVINSERTSTRUCT tvi = { 0 };
+ TVINSERTSTRUCT tvi = {};
tvi.item.mask = TVIF_TEXT | TVIF_PARAM | TVIF_STATE;
tvi.item.stateMask = TVIS_STATEIMAGEMASK;
tvi.item.lParam = (LPARAM)di_value;
@@ -912,12 +912,12 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
for (int i = 0; i < MAX_PRESET_SUBST_COUNT; i++) {
PRESETSUBST *subst = GetPresetSubstByName(presetItems[result - IDPRESETITEM].szNeededSubst[i]);
- if (subst == NULL)
+ if (subst == nullptr)
break;
if (SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_FINDSTRING, -1, (LPARAM)subst->swzName) == LB_ERR) {
DSListNode *ds_value = (DSListNode *)mir_alloc(sizeof(DSListNode));
memset(ds_value, 0, sizeof(DSListNode));
- ds_value->next = NULL;
+ ds_value->next = nullptr;
ds_value->ds.type = subst->type;
wcsncpy(ds_value->ds.swzName, subst->swzName, LABEL_LEN - 1);
@@ -951,7 +951,7 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
di_value->di.bIsVisible = true;
di_value->di.bLineAbove = true;
- TVINSERTSTRUCT tvi = { 0 };
+ TVINSERTSTRUCT tvi = {};
tvi.item.mask = TVIF_TEXT | TVIF_PARAM | TVIF_STATE;
tvi.item.stateMask = TVIS_STATEIMAGEMASK;
tvi.item.lParam = (LPARAM)di_value;
@@ -1124,7 +1124,7 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
TVITEM item = { 0 };
item.mask = TVIF_PARAM;
item.hItem = TreeView_GetLastVisible(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
- while (item.hItem != NULL) {
+ while (item.hItem != nullptr) {
if (TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item)) {
di_node = (DIListNode *)item.lParam;
di_value = (DIListNode *)mir_alloc(sizeof(DIListNode));
@@ -1208,7 +1208,7 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
TVITEM tvi = { 0 };
tvi.mask = TVIF_PARAM;
- for (HTREEITEM hItem = TreeView_GetRoot(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS)); hItem != NULL;
+ for (HTREEITEM hItem = TreeView_GetRoot(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS)); hItem != nullptr;
hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), hItem)) {
tvi.hItem = hItem;
if (TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &tvi)) {
@@ -1468,8 +1468,8 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES);
- TVINSERTSTRUCT tvi = { 0 };
- tvi.hParent = 0;
+ TVINSERTSTRUCT tvi = {};
+ tvi.hParent = nullptr;
tvi.hInsertAfter = TVI_LAST;
tvi.item.mask = TVIF_TEXT | TVIF_PARAM | TVIF_STATE;
tvi.item.stateMask = TVIS_STATEIMAGEMASK;
@@ -1521,7 +1521,7 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
item.hItem = TreeView_GetRoot(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS));
int i = 0;
- while (item.hItem != NULL) {
+ while (item.hItem != nullptr) {
item.mask = TVIF_HANDLE | TVIF_PARAM;
TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), &item);
opt.exIconsOrder[i] = ((ICONSTATE *)item.lParam)->order;
@@ -1543,7 +1543,7 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
opt.bDisableIfInvisible = IsDlgButtonChecked(hwndDlg, IDC_CHK_DISABLEINVISIBLE) ? true : false;
opt.bRetrieveXstatus = IsDlgButtonChecked(hwndDlg, IDC_CHK_RETRIEVEXSTATUS) ? true : false;
opt.bLimitMsg = IsDlgButtonChecked(hwndDlg, IDC_CHK_LIMITMSG) ? true : false;
- opt.iLimitCharCount = GetDlgItemInt(hwndDlg, IDC_ED_CHARCOUNT, 0, FALSE);
+ opt.iLimitCharCount = GetDlgItemInt(hwndDlg, IDC_ED_CHARCOUNT, nullptr, FALSE);
db_set_dw(0, MODULE, "SmileyAddFlags", opt.iSmileyAddFlags);
db_set_b(0, MODULE, "WaitForContent", opt.bWaitForContent ? 1 : 0);
@@ -1664,7 +1664,7 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
tvis.item.state = INDEXTOSTATEIMAGEMASK(((ICONSTATE *)item.lParam)->vis ? 2 : 1);
TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), &tvis.item);
TreeView_DeleteItem(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), dat->hDragItem);
- tvis.hParent = NULL;
+ tvis.hParent = nullptr;
tvis.hInsertAfter = hti.hItem;
TreeView_SelectItem(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), &tvis));
SendMessage((GetParent(hwndDlg)), PSM_CHANGED, (WPARAM)hwndDlg, 0);
@@ -1737,7 +1737,7 @@ INT_PTR CALLBACK DlgProcOptsSkin(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
CheckDlgButton(hwndDlg, IDC_CHK_LOADFONTS, opt.bLoadFonts ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_CHK_LOADPROPORTIONS, opt.bLoadProportions ? BST_CHECKED : BST_UNCHECKED);
- EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_AEROGLASS), MyDwmEnableBlurBehindWindow != 0);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_AEROGLASS), MyDwmEnableBlurBehindWindow != nullptr);
SendDlgItemMessage(hwndDlg, IDC_CMB_EFFECT, CB_ADDSTRING, 0, (LPARAM)TranslateT("None"));
SendDlgItemMessage(hwndDlg, IDC_CMB_EFFECT, CB_ADDSTRING, 0, (LPARAM)TranslateT("Animation"));
@@ -1808,7 +1808,7 @@ INT_PTR CALLBACK DlgProcOptsSkin(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
EnableControls(hwndDlg, true);
}
- InvalidateRect(GetDlgItem(hwndDlg, IDC_PIC_PREVIEW), 0, FALSE);
+ InvalidateRect(GetDlgItem(hwndDlg, IDC_PIC_PREVIEW), nullptr, FALSE);
iLastSel = iSel;
}
}
@@ -1862,13 +1862,13 @@ INT_PTR CALLBACK DlgProcOptsSkin(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
case WM_NOTIFY:
{
if (((LPNMHDR)lParam)->code == (unsigned)PSN_APPLY) {
- opt.iOpacity = GetDlgItemInt(hwndDlg, IDC_ED_TRANS, 0, 0);
+ opt.iOpacity = GetDlgItemInt(hwndDlg, IDC_ED_TRANS, nullptr, 0);
opt.bDropShadow = IsDlgButtonChecked(hwndDlg, IDC_CHK_SHADOW) ? true : false;
opt.bBorder = IsDlgButtonChecked(hwndDlg, IDC_CHK_BORDER) ? true : false;
opt.bRound = IsDlgButtonChecked(hwndDlg, IDC_CHK_ROUNDCORNERS) ? true : false;
opt.bAeroGlass = IsDlgButtonChecked(hwndDlg, IDC_CHK_AEROGLASS) ? true : false;
opt.showEffect = (PopupShowEffect)SendDlgItemMessage(hwndDlg, IDC_CMB_EFFECT, CB_GETCURSEL, 0, 0);
- opt.iAnimateSpeed = GetDlgItemInt(hwndDlg, IDC_ED_SPEED, 0, 0);
+ opt.iAnimateSpeed = GetDlgItemInt(hwndDlg, IDC_ED_SPEED, nullptr, 0);
opt.bLoadFonts = IsDlgButtonChecked(hwndDlg, IDC_CHK_LOADFONTS) ? true : false;
opt.bLoadProportions = IsDlgButtonChecked(hwndDlg, IDC_CHK_LOADPROPORTIONS) ? true : false;
@@ -1963,8 +1963,8 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES);
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TREE_SECOND_ITEMS), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TREE_SECOND_ITEMS), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES);
- TVINSERTSTRUCT tvi = { 0 };
- tvi.hParent = 0;
+ TVINSERTSTRUCT tvi = {};
+ tvi.hParent = nullptr;
tvi.hInsertAfter = TVI_LAST;
tvi.item.mask = TVIF_TEXT | TVIF_STATE;
@@ -2021,7 +2021,7 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
break;
case IDC_BTN_FAVCONTACTS:
- CreateDialog(hInst, MAKEINTRESOURCE(IDD_FAVCONTACTS), 0, DlgProcFavouriteContacts);
+ CreateDialog(hInst, MAKEINTRESOURCE(IDD_FAVCONTACTS), nullptr, DlgProcFavouriteContacts);
break;
}
@@ -2043,7 +2043,7 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
item.cchTextMax = _countof(buff);
item.mask = TVIF_HANDLE | TVIF_TEXT | TVIF_STATE;
item.stateMask = TVIS_STATEIMAGEMASK;
- while (item.hItem != NULL) {
+ while (item.hItem != nullptr) {
TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_PROTOS), &item);
if (((item.state & TVIS_STATEIMAGEMASK) >> 12) == 2) {
mir_wstrcat(swzProtos, buff);
@@ -2058,7 +2058,7 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
swzProtos[0] = 0;
item.hItem = TreeView_GetRoot(GetDlgItem(hwndDlg, IDC_TREE_SECOND_PROTOS));
item.pszText = buff;
- while (item.hItem != NULL) {
+ while (item.hItem != nullptr) {
TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_SECOND_PROTOS), &item);
if (((item.state & TVIS_STATEIMAGEMASK) >> 12) == 2) {
mir_wstrcat(swzProtos, buff);
@@ -2075,7 +2075,7 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
item.hItem = TreeView_GetRoot(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
item.mask = TVIF_HANDLE | TVIF_STATE;
item.stateMask = TVIS_STATEIMAGEMASK;
- while (item.hItem != NULL) {
+ while (item.hItem != nullptr) {
TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item);
if (((item.state & TVIS_STATEIMAGEMASK) >> 12) == 2)
opt.iFirstItems |= (1 << count);
@@ -2087,7 +2087,7 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
count = 0;
opt.iSecondItems = 0;
item.hItem = TreeView_GetRoot(GetDlgItem(hwndDlg, IDC_TREE_SECOND_ITEMS));
- while (item.hItem != NULL) {
+ while (item.hItem != nullptr) {
TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_SECOND_ITEMS), &item);
if (((item.state & TVIS_STATEIMAGEMASK) >> 12) == 2)
opt.iSecondItems |= (1 << count);
@@ -2100,7 +2100,7 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
opt.bHandleByTipper = IsDlgButtonChecked(hwndDlg, IDC_CHK_HANDLEBYTIPPER) ? true : false;
opt.bExpandTraytip = IsDlgButtonChecked(hwndDlg, IDC_CHK_EXPAND) ? true : false;
opt.bHideOffline = IsDlgButtonChecked(hwndDlg, IDC_CHK_HIDEOFFLINE) ? true : false;
- opt.iExpandTime = max(min(GetDlgItemInt(hwndDlg, IDC_ED_EXPANDTIME, 0, FALSE), 5000), 10);
+ opt.iExpandTime = max(min(GetDlgItemInt(hwndDlg, IDC_ED_EXPANDTIME, nullptr, FALSE), 5000), 10);
db_set_b(0, MODULE, "TrayTip", (opt.bTraytip ? 1 : 0));
db_set_b(0, MODULE, "ExtendedTrayTip", (opt.bHandleByTipper ? 1 : 0));
diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp
index 6e8cebc7eb..0a5b82200e 100644
--- a/plugins/TipperYM/src/popwin.cpp
+++ b/plugins/TipperYM/src/popwin.cpp
@@ -20,15 +20,15 @@ Boston, MA 02111-1307, USA.
#include "stdafx.h"
-__inline void AddRow(PopupWindowData *pwd, wchar_t *swzLabel, wchar_t *swzValue, char *szProto, bool bParseSmileys, bool bNewline, bool bLineAbove, bool bIsTitle = false, HICON hIcon = NULL)
+__inline void AddRow(PopupWindowData *pwd, wchar_t *swzLabel, wchar_t *swzValue, char *szProto, bool bParseSmileys, bool bNewline, bool bLineAbove, bool bIsTitle = false, HICON hIcon = nullptr)
{
RowData *pRows = (RowData *)mir_realloc(pwd->rows, sizeof(RowData) * (pwd->iRowCount + 1));
- if (pRows == NULL)
+ if (pRows == nullptr)
return;
pwd->rows = pRows;
- pwd->rows[pwd->iRowCount].swzLabel = swzLabel ? mir_wstrdup(swzLabel) : NULL;
- pwd->rows[pwd->iRowCount].swzValue = swzValue ? mir_wstrdup(swzValue) : NULL;
- pwd->rows[pwd->iRowCount].spi = bParseSmileys ? Smileys_PreParse(swzValue, (int)mir_wstrlen(swzValue), szProto) : NULL;
+ pwd->rows[pwd->iRowCount].swzLabel = swzLabel ? mir_wstrdup(swzLabel) : nullptr;
+ pwd->rows[pwd->iRowCount].swzValue = swzValue ? mir_wstrdup(swzValue) : nullptr;
+ pwd->rows[pwd->iRowCount].spi = bParseSmileys ? Smileys_PreParse(swzValue, (int)mir_wstrlen(swzValue), szProto) : nullptr;
pwd->rows[pwd->iRowCount].bValueNewline = bNewline;
pwd->rows[pwd->iRowCount].bLineAbove = bLineAbove;
pwd->rows[pwd->iRowCount].bIsTitle = bIsTitle;
@@ -60,7 +60,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
// work around bug hiding tips
GetCursorPos(&pwd->ptCursorStartPos);
- SetTimer(hwnd, ID_TIMER_CHECKMOUSE, CHECKMOUSE_ELAPSE, 0);
+ SetTimer(hwnd, ID_TIMER_CHECKMOUSE, CHECKMOUSE_ELAPSE, nullptr);
// register copy menu hotkey (CTRL+C)
pwd->iHotkeyId = GlobalAddAtom(L"Tipper");
@@ -100,7 +100,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
wchar_t swzUid[256], swzUidName[256];
if (Uid(0, pwd->clcit.szProto, swzUid, 256) && UidName(pwd->clcit.szProto, swzUidName, 253)) {
mir_wstrcat(swzUidName, L": ");
- AddRow(pwd, swzUidName, swzUid, NULL, false, false, false);
+ AddRow(pwd, swzUidName, swzUid, nullptr, false, false, false);
}
// logon info
@@ -108,7 +108,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
if (TimestampToTimeDifference(NULL, pwd->clcit.szProto, "LogonTS", swzLogon, 59)) {
wchar_t ago[96];
mir_snwprintf(ago, TranslateT("%s ago"), swzLogon);
- AddRow(pwd, TranslateT("Log on:"), ago, NULL, false, false, false);
+ AddRow(pwd, TranslateT("Log on:"), ago, nullptr, false, false, false);
}
// number of unread emails
@@ -117,13 +117,13 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
int iCount = (int)CallProtoService(pwd->clcit.szProto, PS_GETUNREADEMAILCOUNT, 0, 0);
if (iCount > 0) {
_itow(iCount, swzEmailCount, 10);
- AddRow(pwd, TranslateT("Unread emails:"), swzEmailCount, NULL, false, false, false);
+ AddRow(pwd, TranslateT("Unread emails:"), swzEmailCount, nullptr, false, false, false);
}
}
wchar_t *swzText = pcli->pfnGetStatusModeDescription(wStatus, 0);
if (swzText)
- AddRow(pwd, TranslateT("Status:"), swzText, NULL, false, false, false);
+ AddRow(pwd, TranslateT("Status:"), swzText, nullptr, false, false, false);
if (wStatus >= ID_STATUS_ONLINE && wStatus <= ID_STATUS_OUTTOLUNCH) {
// status message
@@ -189,7 +189,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
ptrW swzListening(GetListeningTo(pwd->clcit.szProto));
if (swzListening) {
StripBBCodesInPlace(swzListening);
- AddRow(pwd, TranslateT("Listening to:"), swzListening, NULL, false, true, true);
+ AddRow(pwd, TranslateT("Listening to:"), swzListening, nullptr, false, true, true);
}
}
}
@@ -214,7 +214,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
SendMessage(hwnd, PUM_REFRESHTRAYTIP, 0, 0);
if (opt.bExpandTraytip)
- SetTimer(hwnd, ID_TIMER_TRAYTIP, opt.iExpandTime, 0);
+ SetTimer(hwnd, ID_TIMER_TRAYTIP, opt.iExpandTime, nullptr);
}
else {
wchar_t buff[2048], *swzText = pwd->clcit.swzText;
@@ -232,7 +232,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
buff[iBuffPos] = 0;
if (iBuffPos) {
- AddRow(pwd, L"", buff, NULL, false, true, false);
+ AddRow(pwd, L"", buff, nullptr, false, true, false);
bTopMessage = true;
}
@@ -277,7 +277,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
buff[iBuffPos] = 0;
pwd->rows[pwd->iRowCount].swzValue = mir_wstrdup(buff);
- pwd->rows[pwd->iRowCount].spi = NULL;
+ pwd->rows[pwd->iRowCount].spi = nullptr;
pwd->iRowCount++;
}
@@ -289,9 +289,9 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
pwd->iRowCount = 1;
pwd->rows = (RowData *)mir_alloc(sizeof(RowData));
pwd->rows[0].bLineAbove = pwd->rows[0].bValueNewline = false;
- pwd->rows[0].swzLabel = 0;
+ pwd->rows[0].swzLabel = nullptr;
pwd->rows[0].swzValue = swzText;
- pwd->rows[0].spi = NULL;
+ pwd->rows[0].spi = nullptr;
}
}
}
@@ -414,10 +414,10 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), 0, LWA_ALPHA);
if (opt.showEffect)
- SetTimer(hwnd, ID_TIMER_ANIMATE, ANIM_ELAPSE, 0);
+ SetTimer(hwnd, ID_TIMER_ANIMATE, ANIM_ELAPSE, nullptr);
ShowWindow(hwnd, SW_SHOWNOACTIVATE);
- InvalidateRect(hwnd, 0, FALSE);
+ InvalidateRect(hwnd, nullptr, FALSE);
// since tipper win is topmost, this should put it at top of topmost windows
SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
@@ -491,7 +491,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
rcAvatar.bottom = rcAvatar.top + pwd->iRealAvatarHeight;
- AVATARCACHEENTRY *ace = 0;
+ AVATARCACHEENTRY *ace = nullptr;
if (pwd->hContact)
ace = (AVATARCACHEENTRY *)CallService(MS_AV_GETAVATARBITMAP, pwd->hContact, 0);
else
@@ -507,7 +507,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
HBITMAP hbmpAvatar = (HBITMAP)CallService(MS_IMG_RESIZE, (WPARAM)&rb, 0);
if (hbmpAvatar) {
- HRGN hrgnAvatar = 0;
+ HRGN hrgnAvatar = nullptr;
if (opt.bAvatarRound) {
hrgnAvatar = CreateRoundRectRgn(rcAvatar.left, rcAvatar.top, rcAvatar.right + 1, rcAvatar.bottom + 1, 9, 9);
SelectClipRgn(hdc, hrgnAvatar);
@@ -535,7 +535,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
}
if (hrgnAvatar) {
- SelectClipRgn(hdc, 0);
+ SelectClipRgn(hdc, nullptr);
DeleteObject(hrgnAvatar);
}
@@ -566,7 +566,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
for (int i = 0; i < EXICONS_COUNT; i++) {
if (pwd->extraIcons[i].hIcon) {
- DrawIconExAlpha(hdc, iIconX, iIconY, pwd->extraIcons[i].hIcon, 16, 16, 0, NULL, DI_NORMAL, false);
+ DrawIconExAlpha(hdc, iIconX, iIconY, pwd->extraIcons[i].hIcon, 16, 16, 0, nullptr, DI_NORMAL, false);
iIconY += 20;
}
}
@@ -648,7 +648,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
// status icon in tray tooltip
if (opt.titleIconLayout != PTL_NOICON && pwd->bIsTrayTip && pwd->rows[i].hIcon) {
- DrawIconExAlpha(hdc, opt.iPadding, tr.top + (pwd->rows[i].iLabelHeight - 16) / 2, pwd->rows[i].hIcon, 16, 16, 0, NULL, DI_NORMAL, false);
+ DrawIconExAlpha(hdc, opt.iPadding, tr.top + (pwd->rows[i].iLabelHeight - 16) / 2, pwd->rows[i].hIcon, 16, 16, 0, nullptr, DI_NORMAL, false);
bIconPainted = true;
}
@@ -687,7 +687,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
tr.bottom = tr.top + iRowHeight;
if (opt.titleIconLayout != PTL_NOICON && pwd->bIsTrayTip && pwd->rows[i].hIcon && !bIconPainted)
- DrawIconExAlpha(hdc, opt.iPadding, tr.top + (pwd->rows[i].iValueHeight - 16) / 2, pwd->rows[i].hIcon, 16, 16, 0, NULL, DI_NORMAL, false);
+ DrawIconExAlpha(hdc, opt.iPadding, tr.top + (pwd->rows[i].iValueHeight - 16) / 2, pwd->rows[i].hIcon, 16, 16, 0, nullptr, DI_NORMAL, false);
UINT uFormat = opt.iValueValign | opt.iValueHalign | DT_WORDBREAK | DT_WORD_ELLIPSIS | DT_END_ELLIPSIS | DT_NOPREFIX;
DrawTextExt(hdc, pwd->rows[i].swzValue, -1, &tr, uFormat, pwd->rows[i].spi);
@@ -701,7 +701,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
POINT ptSrc = { 0, 0 };
SIZE szTip = { r.right - r.left, r.bottom - r.top };
blend.SourceConstantAlpha = pwd->iTrans;
- UpdateLayeredWindow(hwnd, NULL, NULL, &szTip, skin.hdc, &ptSrc, 0xffffffff, &blend, LWA_ALPHA);
+ UpdateLayeredWindow(hwnd, nullptr, nullptr, &szTip, skin.hdc, &ptSrc, 0xffffffff, &blend, LWA_ALPHA);
if (opt.bAeroGlass && MyDwmEnableBlurBehindWindow) {
DWM_BLURBEHIND bb = { 0 };
@@ -744,7 +744,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
AppendMenu(hMenu, MF_STRING, COPYMENU_ALLITEMS, LPGENW("Copy all items"));
if (pwd->clcit.szProto || pwd->hContact)
AppendMenu(hMenu, MF_STRING, COPYMENU_AVATAR, LPGENW("Copy avatar"));
- AppendMenu(hMenu, MF_SEPARATOR, 2000, 0);
+ AppendMenu(hMenu, MF_SEPARATOR, 2000, nullptr);
TranslateMenu(hMenu);
SetMenuItemBitmaps(hMenu, COPYMENU_ALLITEMS_LABELS, MF_BYCOMMAND, hbmpAllItems, hbmpAllItems);
@@ -776,13 +776,13 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
AppendMenu(hMenu, MF_STRING, i + 1, buff); // first id = 1, because no select have id = 0
SetMenuItemBitmaps(hMenu, i + 1, MF_BYCOMMAND, hbmpItem, hbmpItem);
}
- else AppendMenu(hMenu, MF_SEPARATOR, 0, 0);
+ else AppendMenu(hMenu, MF_SEPARATOR, 0, nullptr);
}
}
GetCursorPos(&pt);
SetForegroundWindow(hwnd);
- int iSelItem = TrackPopupMenu(hMenu, TPM_RETURNCMD, pt.x, pt.y, 0, hwnd, 0);
+ int iSelItem = TrackPopupMenu(hMenu, TPM_RETURNCMD, pt.x, pt.y, 0, hwnd, nullptr);
DeleteObject(hbmpAllItems);
DeleteObject(hbmpItem);
DestroyMenu(hMenu);
@@ -790,10 +790,10 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
if (iSelItem == 0)
return 0; // no item was selected
- if (OpenClipboard(NULL)) {
+ if (OpenClipboard(nullptr)) {
EmptyClipboard();
if (iSelItem == COPYMENU_AVATAR) { // copy avatar
- AVATARCACHEENTRY *ace = 0;
+ AVATARCACHEENTRY *ace = nullptr;
if (pwd->hContact)
ace = (AVATARCACHEENTRY *)CallService(MS_AV_GETAVATARBITMAP, pwd->hContact, 0);
else
@@ -872,7 +872,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
blend.AlphaFormat = AC_SRC_ALPHA;
while (blend.SourceConstantAlpha != 0) {
- UpdateLayeredWindow(hwnd, NULL, NULL, &sz, skin.hdc, &ptSrc, 0xffffffff, &blend, LWA_ALPHA);
+ UpdateLayeredWindow(hwnd, nullptr, nullptr, &sz, skin.hdc, &ptSrc, 0xffffffff, &blend, LWA_ALPHA);
blend.SourceConstantAlpha = max(blend.SourceConstantAlpha - opt.iAnimateSpeed, 0);
Sleep(ANIM_ELAPSE);
}
@@ -895,10 +895,10 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
DeleteObject(skin.hBitmap);
if (skin.hdc)
DeleteDC(skin.hdc);
- skin.hBitmap = NULL;
- skin.hdc = NULL;
+ skin.hBitmap = nullptr;
+ skin.hdc = nullptr;
- if (pwd == NULL)
+ if (pwd == nullptr)
break;
// unregister hotkey
UnregisterHotKey(hwnd, pwd->iHotkeyId);
@@ -911,7 +911,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
Smileys_FreeParse(pwd->spiTitle);
- for (int i = 0; i < pwd->iRowCount && pwd->rows != NULL; i++) {
+ for (int i = 0; i < pwd->iRowCount && pwd->rows != nullptr; i++) {
mir_free(pwd->rows[i].swzLabel);
mir_free(pwd->rows[i].swzValue);
Smileys_FreeParse(pwd->rows[i].spi);
@@ -920,7 +920,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
// destroy icons
for (int i = 0; i < EXICONS_COUNT; i++) {
- if (pwd->extraIcons[i].hIcon == NULL)
+ if (pwd->extraIcons[i].hIcon == nullptr)
continue;
if (pwd->extraIcons[i].bDestroy)
@@ -931,7 +931,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
mir_free(pwd->clcit.swzText);
mir_free(pwd);
- pwd = NULL;
+ pwd = nullptr;
SetWindowLongPtr(hwnd, GWLP_USERDATA, 0);
break;
@@ -967,7 +967,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
pwd->bIsPainted = false;
pwd->bNeedRefresh = true;
SendMessage(hwnd, PUM_REFRESH_VALUES, TRUE, 0);
- InvalidateRect(hwnd, 0, TRUE);
+ InvalidateRect(hwnd, nullptr, TRUE);
}
mir_free((void *)lParam);
return TRUE;
@@ -977,7 +977,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
// in case we have retrieve xstatus
pwd->bIsPainted = false;
SendMessage(hwnd, PUM_REFRESH_VALUES, TRUE, 0);
- InvalidateRect(hwnd, 0, TRUE);
+ InvalidateRect(hwnd, nullptr, TRUE);
}
return TRUE;
@@ -986,7 +986,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
pwd->bIsPainted = false;
SendMessage(hwnd, PUM_GETHEIGHT, 0, 0);
SendMessage(hwnd, PUM_CALCPOS, 0, 0);
- InvalidateRect(hwnd, 0, TRUE);
+ InvalidateRect(hwnd, nullptr, TRUE);
}
return TRUE;
@@ -1003,25 +1003,25 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
blend.SourceConstantAlpha = 0;
blend.AlphaFormat = AC_SRC_ALPHA;
- UpdateLayeredWindow(hwnd, NULL, NULL, &sz, skin.hdc, &ptSrc, 0xffffffff, &blend, LWA_ALPHA);
+ UpdateLayeredWindow(hwnd, nullptr, nullptr, &sz, skin.hdc, &ptSrc, 0xffffffff, &blend, LWA_ALPHA);
}
else SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), 0, LWA_ALPHA);
SendMessage(hwnd, PUM_REFRESHTRAYTIP, 1, 0);
SendMessage(hwnd, PUM_GETHEIGHT, 0, 0);
SendMessage(hwnd, PUM_CALCPOS, 0, 0);
- InvalidateRect(hwnd, 0, TRUE);
+ InvalidateRect(hwnd, nullptr, TRUE);
if (opt.showEffect) {
KillTimer(hwnd, ID_TIMER_ANIMATE);
- SetTimer(hwnd, ID_TIMER_ANIMATE, ANIM_ELAPSE, 0);
+ SetTimer(hwnd, ID_TIMER_ANIMATE, ANIM_ELAPSE, nullptr);
pwd->iAnimStep = 0;
pwd->iCurrentTrans = 0;
}
return TRUE;
case PUM_REFRESH_VALUES:
- if (pwd && pwd->clcit.szProto == 0 && !pwd->bIsTextTip) {
+ if (pwd && pwd->clcit.szProto == nullptr && !pwd->bIsTextTip) {
for (int i = 0; i < pwd->iRowCount; i++) {
mir_free(pwd->rows[i].swzLabel);
mir_free(pwd->rows[i].swzValue);
@@ -1029,7 +1029,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
}
mir_free(pwd->rows);
- pwd->rows = NULL;
+ pwd->rows = nullptr;
pwd->iRowCount = 0;
DIListNode *node = opt.diList;
@@ -1077,7 +1077,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
if (pwd->iRowCount == 0) {
mir_free(pwd->rows);
- pwd->rows = NULL;
+ pwd->rows = nullptr;
}
}
@@ -1104,7 +1104,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
// avatar height
pwd->iAvatarHeight = 0;
if (!pwd->bIsTextTip && opt.avatarLayout != PAV_NONE && ServiceExists(MS_AV_GETAVATARBITMAP)) {
- AVATARCACHEENTRY *ace = 0;
+ AVATARCACHEENTRY *ace = nullptr;
if (pwd->hContact) ace = (AVATARCACHEENTRY *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)pwd->hContact, 0);
else ace = (AVATARCACHEENTRY *)CallService(MS_AV_GETMYAVATAR, 0, (LPARAM)pwd->clcit.szProto);
@@ -1152,7 +1152,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
if (pwd->hContact || pwd->clcit.szProto) {
for (i = 0; i < EXICONS_COUNT; i++) {
if ((INT_PTR)pwd->extraIcons[i].hIcon == CALLSERVICE_NOTFOUND)
- pwd->extraIcons[i].hIcon = 0;
+ pwd->extraIcons[i].hIcon = nullptr;
if (pwd->extraIcons[i].hIcon)
iCount++;
@@ -1262,10 +1262,10 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
GetWindowRect(hwnd, &rc);
if (rc.right - rc.left != iWidth || rc.bottom - rc.top != iHeight) {
- SetWindowPos(hwnd, 0, 0, 0, iWidth, iHeight, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
+ SetWindowPos(hwnd, nullptr, 0, 0, iWidth, iHeight, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
GetWindowRect(hwnd, &pwd->rcWindow);
SendMessage(hwnd, PUM_UPDATERGN, 0, 0);
- InvalidateRect(hwnd, 0, TRUE);
+ InvalidateRect(hwnd, nullptr, TRUE);
}
if (pHeight)
@@ -1301,7 +1301,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
pwd->iAnimStep = ANIM_STEPS;
}
- UpdateLayeredWindow(hwnd, NULL, NULL, &sz, skin.hdc, &ptSrc, 0xffffffff, &blend, LWA_ALPHA);
+ UpdateLayeredWindow(hwnd, nullptr, nullptr, &sz, skin.hdc, &ptSrc, 0xffffffff, &blend, LWA_ALPHA);
}
else {
@@ -1339,7 +1339,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
blend.SourceConstantAlpha = pwd->iTrans;
blend.AlphaFormat = AC_SRC_ALPHA;
- UpdateLayeredWindow(hwnd, NULL, &ptPos, &sz, skin.hdc, &ptSrc, 0xffffffff, &blend, LWA_ALPHA);
+ UpdateLayeredWindow(hwnd, nullptr, &ptPos, &sz, skin.hdc, &ptSrc, 0xffffffff, &blend, LWA_ALPHA);
}
}
@@ -1364,7 +1364,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
if (opt.bAeroGlass && MyDwmEnableBlurBehindWindow && pwd->iAnimStep > 5) {
if (pwd->hrgnAeroGlass) {
DeleteObject(pwd->hrgnAeroGlass);
- pwd->hrgnAeroGlass = 0;
+ pwd->hrgnAeroGlass = nullptr;
}
pwd->hrgnAeroGlass = CreateOpaqueRgn(25, true);
@@ -1433,7 +1433,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
}
}
- SetWindowPos(hwnd, 0, x, y, 0, 0, SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOZORDER);
+ SetWindowPos(hwnd, nullptr, x, y, 0, 0, SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOZORDER);
GetWindowRect(hwnd, &pwd->rcWindow);
}
return TRUE;
@@ -1446,7 +1446,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
}
mir_free(pwd->rows);
- pwd->rows = NULL;
+ pwd->rows = nullptr;
pwd->iRowCount = 0;
DWORD dwItems = (wParam == 0) ? opt.iFirstItems : opt.iSecondItems;
@@ -1458,12 +1458,12 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
Proto_EnumAccounts(&iProtoCount, &accs);
for (int j = 0; j < iProtoCount; j++) {
- PROTOACCOUNT *pa = NULL;
+ PROTOACCOUNT *pa = nullptr;
for (int i = 0; i < iProtoCount; i++)
- if (accs[i]->iOrder > oldOrder && (pa == NULL || accs[i]->iOrder < pa->iOrder))
+ if (accs[i]->iOrder > oldOrder && (pa == nullptr || accs[i]->iOrder < pa->iOrder))
pa = accs[i];
- if (pa == NULL)
+ if (pa == nullptr)
continue;
oldOrder = pa->iOrder;
@@ -1492,14 +1492,14 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
if (Proto_IsAccountLocked(pa))
mir_snwprintf(swzProto, TranslateT("%s (locked)"), pa->tszAccountName);
- AddRow(pwd, swzProto, buff, NULL, false, false, !bFirstItem, true, Skin_LoadProtoIcon(pa->szModuleName, wStatus));
+ AddRow(pwd, swzProto, buff, nullptr, false, false, !bFirstItem, true, Skin_LoadProtoIcon(pa->szModuleName, wStatus));
bFirstItem = false;
if (dwItems & TRAYTIP_LOGON) {
if (TimestampToTimeDifference(NULL, pa->szModuleName, "LogonTS", buff, 59)) {
wchar_t ago[96];
mir_snwprintf(ago, TranslateT("%s ago"), buff);
- AddRow(pwd, TranslateT("Log on:"), ago, NULL, false, false, false);
+ AddRow(pwd, TranslateT("Log on:"), ago, nullptr, false, false, false);
}
}
@@ -1507,14 +1507,14 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
int iCount = (int)CallProtoService(pa->szModuleName, PS_GETUNREADEMAILCOUNT, 0, 0);
if (iCount > 0) {
_itow(iCount, buff, 10);
- AddRow(pwd, TranslateT("Unread emails:"), buff, NULL, false, false, false);
+ AddRow(pwd, TranslateT("Unread emails:"), buff, nullptr, false, false, false);
}
}
if (dwItems & TRAYTIP_STATUS) {
wchar_t *swzText = pcli->pfnGetStatusModeDescription(wStatus, 0);
if (swzText)
- AddRow(pwd, TranslateT("Status:"), swzText, NULL, false, false, false);
+ AddRow(pwd, TranslateT("Status:"), swzText, nullptr, false, false, false);
}
if (wStatus >= ID_STATUS_ONLINE && wStatus <= ID_STATUS_OUTTOLUNCH) {
@@ -1581,7 +1581,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
wchar_t *swzListening = GetListeningTo(pa->szModuleName);
if (swzListening) {
StripBBCodesInPlace(swzListening);
- AddRow(pwd, TranslateT("Listening to:"), swzListening, NULL, false, true, false);
+ AddRow(pwd, TranslateT("Listening to:"), swzListening, nullptr, false, true, false);
mir_free(swzListening);
}
}
@@ -1598,7 +1598,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
if (db_get_b(hContact, MODULE, "FavouriteContact", 0)) {
char *proto = GetContactProto(hContact);
- if (proto == NULL)
+ if (proto == nullptr)
continue;
WORD wStatus = db_get_w(hContact, proto, "Status", ID_STATUS_OFFLINE);
@@ -1611,7 +1611,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
if (!(opt.iFavoriteContFlags & FAVCONT_HIDE_OFFLINE && wStatus == ID_STATUS_OFFLINE)) {
if (!bTitlePainted) {
- AddRow(pwd, TranslateT("Fav. contacts"), NULL, NULL, false, false, !bFirstItem, true, NULL);
+ AddRow(pwd, TranslateT("Fav. contacts"), nullptr, nullptr, false, false, !bFirstItem, true, nullptr);
bFirstItem = false;
bTitlePainted = true;
}
@@ -1624,7 +1624,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
}
else mir_wstrcpy(swzName, swzNick);
- AddRow(pwd, swzName, swzStatus, NULL, false, false, false);
+ AddRow(pwd, swzName, swzStatus, nullptr, false, false, false);
}
}
}
@@ -1644,8 +1644,8 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
if (dwItems & TRAYTIP_MIRANDA_UPTIME) {
if (TimestampToTimeDifference(NULL, MODULE, "MirandaStartTS", buff, 64)) {
- AddRow(pwd, TranslateT("Other"), L"", NULL, false, false, !bFirstItem, true, NULL);
- AddRow(pwd, TranslateT("Miranda uptime:"), buff, NULL, false, false, false);
+ AddRow(pwd, TranslateT("Other"), L"", nullptr, false, false, !bFirstItem, true, nullptr);
+ AddRow(pwd, TranslateT("Miranda uptime:"), buff, nullptr, false, false, false);
}
}
@@ -1657,7 +1657,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
wchar_t swzText[256];
mir_wstrcpy(swzText, pwd->clcit.swzText);
if (pchBr) swzText[pchBr - pwd->clcit.swzText] = 0;
- AddRow(pwd, swzText, L"", NULL, false, true, false, true, Skin_LoadIcon(SKINICON_OTHER_FILLEDBLOB));
+ AddRow(pwd, swzText, L"", nullptr, false, true, false, true, Skin_LoadIcon(SKINICON_OTHER_FILLEDBLOB));
}
}
diff --git a/plugins/TipperYM/src/preset_items.cpp b/plugins/TipperYM/src/preset_items.cpp
index e29ca11708..459d5d8465 100644
--- a/plugins/TipperYM/src/preset_items.cpp
+++ b/plugins/TipperYM/src/preset_items.cpp
@@ -22,65 +22,65 @@ Boston, MA 02111-1307, USA.
PRESETITEM presetItems[] =
{
- "account", LPGENW("Account"), LPGENW("Account:"), L"%sys:account%", 0, 0, 0,
+ "account", LPGENW("Account"), LPGENW("Account:"), L"%sys:account%", nullptr, nullptr, nullptr,
"birth", LPGENW("Birthday"), LPGENW("Birthday:"), L"%birthday_date% (%birthday_age%) @ Next: %birthday_next%", "birthdate", "birthage", "birthnext",
- "client", LPGENW("Client"), LPGENW("Client:"), L"%raw:/MirVer%", 0, 0, 0,
- "email", LPGENW("Email"), LPGENW("Email:"), L"%raw:/e-mail%", 0, 0, 0,
- "gender", LPGENW("Gender"), LPGENW("Gender:"), L"%gender%", 0, 0, 0,
- "homepage", LPGENW("Homepage"), LPGENW("Homepage:"), L"%raw:/Homepage%", 0, 0, 0,
- "id", LPGENW("Identifier"), L"%sys:uidname|UID^!MetaContacts%:", L"%sys:uid%", 0, 0, 0,
- "idle", LPGENW("Idle"), LPGENW("Idle:"), L"%idle% (%idle_diff% ago)", "idle", "idlediff", 0,
- "ip", L"IP", L"IP:", L"%ip%", "ip", 0, 0,
- "ipint", LPGENW("IP internal"), LPGENW("IP internal:"), L"%ip_internal%", "ipint", 0, 0,
- "lastmsg", LPGENW("Last message"), LPGENW("Last message: (%sys:last_msg_reltime% ago)"), L"%sys:last_msg%", 0, 0, 0,
- "listening", LPGENW("Listening to"), LPGENW("Listening to:"), L"%raw:/ListeningTo%", 0, 0, 0,
- "name", LPGENW("Name"), LPGENW("Name:"), L"%raw:/FirstName|% %raw:/LastName%", 0, 0, 0,
- "received", LPGENW("Number of received messages"), LPGENW("Number of msg [IN]:"), L"%sys:msg_count_in%", 0, 0, 0,
- "sended", LPGENW("Number of sent messages"), LPGENW("Number of msg [OUT]:"), L"%sys:msg_count_out%", 0, 0, 0,
- "status", LPGENW("Status"), LPGENW("Status:"), L"%Status%", "status", 0, 0,
- "statusmsg", LPGENW("Status message"), LPGENW("Status message:"), L"%sys:status_msg%", 0, 0, 0,
- "time", LPGENW("Contact time"), LPGENW("Time:"), L"%sys:time%", 0, 0, 0,
- "xtitle", LPGENW("xStatus title"), LPGENW("xStatus title:"), L"%xsname%", "xname", 0, 0,
- "xtext", LPGENW("xStatus text"), LPGENW("xStatus text:"), L"%raw:/XStatusMsg%", 0, 0, 0,
- "acttitle", LPGENW("[jabber.dll] Activity title"), LPGENW("Activity title:"), L"%raw:AdvStatus/?dbsetting(%subject%,Protocol,p)/activity/title%", 0, 0, 0,
- "acttext", LPGENW("[jabber.dll] Activity text"), LPGENW("Activity text:"), L"%raw:AdvStatus/?dbsetting(%subject%,Protocol,p)/activity/text%", 0, 0, 0,
- "lastseentime", LPGENW("[seenplugin.dll] Last seen time"), LPGENW("Last seen time:"), L"%lastseen_date% @ %lastseen_time%", "lsdate", "lstime", 0,
- "lastseenstatus", LPGENW("[seenplugin.dll] Last seen status"), LPGENW("Last seen status:"), L"%lastseen_status% (%lastseen_ago% ago)", "lsstatus", "lsago", 0,
- "cond", LPGENW("[weather.dll] Condition"), LPGENW("Condition:"), L"%raw:Current/Condition%", 0, 0, 0,
- "humidity", LPGENW("[weather.dll] Humidity"), LPGENW("Humidity:"), L"%raw:Current/Humidity%", 0, 0, 0,
- "minmaxtemp", LPGENW("[weather.dll] Max/Min temperature"), LPGENW("Max/Min:"), L"%raw:Current/High%/%raw:Current/Low%", 0, 0, 0,
- "moon", LPGENW("[weather.dll] Moon"), LPGENW("Moon:"), L"%raw:Current/Moon%", 0, 0, 0,
- "pressure", LPGENW("[weather.dll] Pressure"), LPGENW("Pressure:"), L"%raw:Current/Pressure% (%raw:Current/Pressure Tendency%)", 0, 0, 0,
- "sunrise", LPGENW("[weather.dll] Sunrise"), LPGENW("Sunrise:"), L"%raw:Current/Sunrise%", 0, 0, 0,
- "sunset", LPGENW("[weather.dll] Sunset"), LPGENW("Sunset:"), L"%raw:Current/Sunset%", 0, 0, 0,
- "temp", LPGENW("[weather.dll] Temperature"), LPGENW("Temperature:"), L"%raw:Current/Temperature%", 0, 0, 0,
- "uptime", LPGENW("[weather.dll] Update time"), LPGENW("Update time:"), L"%raw:Current/Update%", 0, 0, 0,
- "uvindex", LPGENW("[weather.dll] UV Index"), LPGENW("UV Index:"), L"%raw:Current/UV% - %raw:Current/UVI%", 0, 0, 0,
- "vis", LPGENW("[weather.dll] Visibility"), LPGENW("Visibility:"), L"%raw:Current/Visibility%", 0, 0, 0,
- "wind", LPGENW("[weather.dll] Wind"), LPGENW("Wind:"), L"%raw:Current/Wind Direction% (%raw:Current/Wind Direction DEG%)/%raw:Current/Wind Speed%", 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0
+ "client", LPGENW("Client"), LPGENW("Client:"), L"%raw:/MirVer%", nullptr, nullptr, nullptr,
+ "email", LPGENW("Email"), LPGENW("Email:"), L"%raw:/e-mail%", nullptr, nullptr, nullptr,
+ "gender", LPGENW("Gender"), LPGENW("Gender:"), L"%gender%", nullptr, nullptr, nullptr,
+ "homepage", LPGENW("Homepage"), LPGENW("Homepage:"), L"%raw:/Homepage%", nullptr, nullptr, nullptr,
+ "id", LPGENW("Identifier"), L"%sys:uidname|UID^!MetaContacts%:", L"%sys:uid%", nullptr, nullptr, nullptr,
+ "idle", LPGENW("Idle"), LPGENW("Idle:"), L"%idle% (%idle_diff% ago)", "idle", "idlediff", nullptr,
+ "ip", L"IP", L"IP:", L"%ip%", "ip", nullptr, nullptr,
+ "ipint", LPGENW("IP internal"), LPGENW("IP internal:"), L"%ip_internal%", "ipint", nullptr, nullptr,
+ "lastmsg", LPGENW("Last message"), LPGENW("Last message: (%sys:last_msg_reltime% ago)"), L"%sys:last_msg%", nullptr, nullptr, nullptr,
+ "listening", LPGENW("Listening to"), LPGENW("Listening to:"), L"%raw:/ListeningTo%", nullptr, nullptr, nullptr,
+ "name", LPGENW("Name"), LPGENW("Name:"), L"%raw:/FirstName|% %raw:/LastName%", nullptr, nullptr, nullptr,
+ "received", LPGENW("Number of received messages"), LPGENW("Number of msg [IN]:"), L"%sys:msg_count_in%", nullptr, nullptr, nullptr,
+ "sended", LPGENW("Number of sent messages"), LPGENW("Number of msg [OUT]:"), L"%sys:msg_count_out%", nullptr, nullptr, nullptr,
+ "status", LPGENW("Status"), LPGENW("Status:"), L"%Status%", "status", nullptr, nullptr,
+ "statusmsg", LPGENW("Status message"), LPGENW("Status message:"), L"%sys:status_msg%", nullptr, nullptr, nullptr,
+ "time", LPGENW("Contact time"), LPGENW("Time:"), L"%sys:time%", nullptr, nullptr, nullptr,
+ "xtitle", LPGENW("xStatus title"), LPGENW("xStatus title:"), L"%xsname%", "xname", nullptr, nullptr,
+ "xtext", LPGENW("xStatus text"), LPGENW("xStatus text:"), L"%raw:/XStatusMsg%", nullptr, nullptr, nullptr,
+ "acttitle", LPGENW("[jabber.dll] Activity title"), LPGENW("Activity title:"), L"%raw:AdvStatus/?dbsetting(%subject%,Protocol,p)/activity/title%", nullptr, nullptr, nullptr,
+ "acttext", LPGENW("[jabber.dll] Activity text"), LPGENW("Activity text:"), L"%raw:AdvStatus/?dbsetting(%subject%,Protocol,p)/activity/text%", nullptr, nullptr, nullptr,
+ "lastseentime", LPGENW("[seenplugin.dll] Last seen time"), LPGENW("Last seen time:"), L"%lastseen_date% @ %lastseen_time%", "lsdate", "lstime", nullptr,
+ "lastseenstatus", LPGENW("[seenplugin.dll] Last seen status"), LPGENW("Last seen status:"), L"%lastseen_status% (%lastseen_ago% ago)", "lsstatus", "lsago", nullptr,
+ "cond", LPGENW("[weather.dll] Condition"), LPGENW("Condition:"), L"%raw:Current/Condition%", nullptr, nullptr, nullptr,
+ "humidity", LPGENW("[weather.dll] Humidity"), LPGENW("Humidity:"), L"%raw:Current/Humidity%", nullptr, nullptr, nullptr,
+ "minmaxtemp", LPGENW("[weather.dll] Max/Min temperature"), LPGENW("Max/Min:"), L"%raw:Current/High%/%raw:Current/Low%", nullptr, nullptr, nullptr,
+ "moon", LPGENW("[weather.dll] Moon"), LPGENW("Moon:"), L"%raw:Current/Moon%", nullptr, nullptr, nullptr,
+ "pressure", LPGENW("[weather.dll] Pressure"), LPGENW("Pressure:"), L"%raw:Current/Pressure% (%raw:Current/Pressure Tendency%)", nullptr, nullptr, nullptr,
+ "sunrise", LPGENW("[weather.dll] Sunrise"), LPGENW("Sunrise:"), L"%raw:Current/Sunrise%", nullptr, nullptr, nullptr,
+ "sunset", LPGENW("[weather.dll] Sunset"), LPGENW("Sunset:"), L"%raw:Current/Sunset%", nullptr, nullptr, nullptr,
+ "temp", LPGENW("[weather.dll] Temperature"), LPGENW("Temperature:"), L"%raw:Current/Temperature%", nullptr, nullptr, nullptr,
+ "uptime", LPGENW("[weather.dll] Update time"), LPGENW("Update time:"), L"%raw:Current/Update%", nullptr, nullptr, nullptr,
+ "uvindex", LPGENW("[weather.dll] UV Index"), LPGENW("UV Index:"), L"%raw:Current/UV% - %raw:Current/UVI%", nullptr, nullptr, nullptr,
+ "vis", LPGENW("[weather.dll] Visibility"), LPGENW("Visibility:"), L"%raw:Current/Visibility%", nullptr, nullptr, nullptr,
+ "wind", LPGENW("[weather.dll] Wind"), LPGENW("Wind:"), L"%raw:Current/Wind Direction% (%raw:Current/Wind Direction DEG%)/%raw:Current/Wind Speed%", nullptr, nullptr, nullptr,
+ nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr
};
PRESETSUBST presetSubsts[] =
{
- "gender", L"gender", DVT_PROTODB, NULL, "Gender", 5,
- "status", L"Status", DVT_PROTODB, NULL, "Status", 1,
- "ip", L"ip", DVT_PROTODB, NULL, "IP", 7,
- "ipint", L"ip_internal", DVT_PROTODB, NULL, "RealIP", 7,
- "idle", L"idle", DVT_PROTODB, NULL, "IdleTS", 2,
- "idlediff", L"idle_diff", DVT_PROTODB, NULL, "IdleTS", 3,
- "xname", L"xsname", DVT_PROTODB, NULL, "XStatusName", 17,
- "lsdate", L"lastseen_date", DVT_DB, "SeenModule", NULL, 8,
- "lstime", L"lastseen_time", DVT_DB, "SeenModule", NULL, 10,
+ "gender", L"gender", DVT_PROTODB, nullptr, "Gender", 5,
+ "status", L"Status", DVT_PROTODB, nullptr, "Status", 1,
+ "ip", L"ip", DVT_PROTODB, nullptr, "IP", 7,
+ "ipint", L"ip_internal", DVT_PROTODB, nullptr, "RealIP", 7,
+ "idle", L"idle", DVT_PROTODB, nullptr, "IdleTS", 2,
+ "idlediff", L"idle_diff", DVT_PROTODB, nullptr, "IdleTS", 3,
+ "xname", L"xsname", DVT_PROTODB, nullptr, "XStatusName", 17,
+ "lsdate", L"lastseen_date", DVT_DB, "SeenModule", nullptr, 8,
+ "lstime", L"lastseen_time", DVT_DB, "SeenModule", nullptr, 10,
"lsstatus", L"lastseen_status", DVT_DB, "SeenModule", "OldStatus", 1,
"lsago", L"lastseen_ago", DVT_DB, "SeenModule", "seenTS", 3,
- "birthdate", L"birthday_date", DVT_PROTODB, NULL, "Birth", 8,
- "birthage", L"birthday_age", DVT_PROTODB, NULL, "Birth", 9,
- "birthnext", L"birthday_next", DVT_PROTODB, NULL, "Birth", 12,
- "logondate", L"logon_date", DVT_PROTODB, NULL, "LogonTS", 15,
- "logontime", L"logon_time", DVT_PROTODB, NULL, "LogonTS", 13,
- "logonago", L"logon_ago", DVT_PROTODB, NULL, "LogonTS", 3,
- 0, 0, DVT_DB, 0, 0, 0
+ "birthdate", L"birthday_date", DVT_PROTODB, nullptr, "Birth", 8,
+ "birthage", L"birthday_age", DVT_PROTODB, nullptr, "Birth", 9,
+ "birthnext", L"birthday_next", DVT_PROTODB, nullptr, "Birth", 12,
+ "logondate", L"logon_date", DVT_PROTODB, nullptr, "LogonTS", 15,
+ "logontime", L"logon_time", DVT_PROTODB, nullptr, "LogonTS", 13,
+ "logonago", L"logon_ago", DVT_PROTODB, nullptr, "LogonTS", 3,
+ nullptr, nullptr, DVT_DB, nullptr, nullptr, 0
};
DEFAULTITEM defaultItemList[] =
@@ -98,7 +98,7 @@ DEFAULTITEM defaultItemList[] =
"time", false,
"id", false,
"status", false,
- 0,0
+ nullptr,0
};
PRESETITEM *GetPresetItemByName(char *szName)
@@ -109,18 +109,18 @@ PRESETITEM *GetPresetItemByName(char *szName)
return &presetItems[i];
}
- return NULL;
+ return nullptr;
}
PRESETSUBST *GetPresetSubstByName(char *szName)
{
- if (!szName) return NULL;
+ if (!szName) return nullptr;
for (int i = 0; presetSubsts[i].szID; i++)
{
if (mir_strcmp(presetSubsts[i].szID, szName) == 0)
return &presetSubsts[i];
}
- return NULL;
+ return nullptr;
}
diff --git a/plugins/TipperYM/src/skin_parser.cpp b/plugins/TipperYM/src/skin_parser.cpp
index 8aa9c4869c..403ae81ac7 100644
--- a/plugins/TipperYM/src/skin_parser.cpp
+++ b/plugins/TipperYM/src/skin_parser.cpp
@@ -58,7 +58,7 @@ int RefreshSkinList(HWND hwndDlg)
bool FileExists(wchar_t *filename)
{
- HANDLE hFile = CreateFile(filename, 0, 0, 0, OPEN_EXISTING, 0, 0);
+ HANDLE hFile = CreateFile(filename, 0, 0, nullptr, OPEN_EXISTING, 0, nullptr);
if (hFile != INVALID_HANDLE_VALUE)
{
CloseHandle(hFile);
@@ -103,7 +103,7 @@ void ParseAboutPart(FILE *fp, wchar_t *buff, wchar_t *szSkinName)
void ParseImagePart(FILE *fp, wchar_t *buff, int iPart)
{
- opt.szImgFile[iPart] = NULL;
+ opt.szImgFile[iPart] = nullptr;
opt.transfMode[iPart] = TM_NONE;
opt.margins[iPart].left = 0;
opt.margins[iPart].top = 0;
@@ -182,7 +182,7 @@ char *GetSettingName(wchar_t *szValue, char *szPostfix, char *buff, size_t buffs
else if (wcsstr(szValue, L"divider"))
mir_snprintf(buff, buffsize, "Divider%s", szPostfix);
- return buff[0] ? buff : NULL;
+ return buff[0] ? buff : nullptr;
}
void ParseFontPart(FILE *fp, wchar_t *buff)
@@ -235,10 +235,10 @@ void ParseFontPart(FILE *fp, wchar_t *buff)
{
if (GetSettingName(buff, "Size", szSetting, sizeof(szSetting) - 1))
{
- HDC hdc = GetDC(0);
+ HDC hdc = GetDC(nullptr);
int size = -MulDiv(_wtoi(pch), GetDeviceCaps(hdc, LOGPIXELSY), 72);
db_set_b(0, MODULE, szSetting, (BYTE)size);
- ReleaseDC(0, hdc);
+ ReleaseDC(nullptr, hdc);
}
}
else if (wcsstr(buff, L"effect"))
diff --git a/plugins/TipperYM/src/str_utils.cpp b/plugins/TipperYM/src/str_utils.cpp
index 4d77c38c19..0752750d87 100644
--- a/plugins/TipperYM/src/str_utils.cpp
+++ b/plugins/TipperYM/src/str_utils.cpp
@@ -30,7 +30,7 @@ bool a2w(const char *as, wchar_t *buff, int bufflen)
bool w2a(const wchar_t *ws, char *buff, int bufflen)
{
- if (ws) WideCharToMultiByte(iCodePage, 0, ws, -1, buff, bufflen, 0, 0);
+ if (ws) WideCharToMultiByte(iCodePage, 0, ws, -1, buff, bufflen, nullptr, nullptr);
return true;
}
@@ -42,7 +42,7 @@ bool utf2w(const char *us, wchar_t *buff, int bufflen)
bool w2utf(const wchar_t *ws, char *buff, int bufflen)
{
- if (ws) WideCharToMultiByte(CP_UTF8, 0, ws, -1, buff, bufflen, 0, 0);
+ if (ws) WideCharToMultiByte(CP_UTF8, 0, ws, -1, buff, bufflen, nullptr, nullptr);
return true;
}
@@ -51,7 +51,7 @@ bool a2utf(const char *as, char *buff, int bufflen)
if (!as) return false;
wchar_t *ws = a2w(as);
- if (ws) WideCharToMultiByte(CP_UTF8, 0, ws, -1, buff, bufflen, 0, 0);
+ if (ws) WideCharToMultiByte(CP_UTF8, 0, ws, -1, buff, bufflen, nullptr, nullptr);
mir_free(ws);
return true;
}
@@ -61,7 +61,7 @@ bool utf2a(const char *us, char *buff, int bufflen)
if (!us) return false;
wchar_t *ws = utf2w(us);
- if (ws) WideCharToMultiByte(iCodePage, 0, ws, -1, buff, bufflen, 0, 0);
+ if (ws) WideCharToMultiByte(iCodePage, 0, ws, -1, buff, bufflen, nullptr, nullptr);
mir_free(ws);
return true;
}
@@ -103,14 +103,14 @@ wchar_t *utf2w(const char *us)
{
if (us)
{
- int size = MultiByteToWideChar(CP_UTF8, 0, us, -1, 0, 0);
+ int size = MultiByteToWideChar(CP_UTF8, 0, us, -1, nullptr, 0);
wchar_t *buff = (wchar_t *)mir_alloc(size * sizeof(wchar_t));
MultiByteToWideChar(CP_UTF8, 0, us, -1, buff, size);
return buff;
}
else
{
- return 0;
+ return nullptr;
}
}
@@ -118,20 +118,20 @@ char *w2utf(const wchar_t *ws)
{
if (ws)
{
- int size = WideCharToMultiByte(CP_UTF8, 0, ws, -1, 0, 0, 0, 0);
+ int size = WideCharToMultiByte(CP_UTF8, 0, ws, -1, nullptr, 0, nullptr, nullptr);
char *buff = (char *)mir_alloc(size);
- WideCharToMultiByte(CP_UTF8, 0, ws, -1, buff, size, 0, 0);
+ WideCharToMultiByte(CP_UTF8, 0, ws, -1, buff, size, nullptr, nullptr);
return buff;
}
else
{
- return 0;
+ return nullptr;
}
}
wchar_t *a2w(const char *as)
{
- int size = MultiByteToWideChar(iCodePage, 0, as, -1, 0, 0);
+ int size = MultiByteToWideChar(iCodePage, 0, as, -1, nullptr, 0);
wchar_t *buff = (wchar_t *)mir_alloc(size * sizeof(wchar_t));
MultiByteToWideChar(iCodePage, 0, as, -1, buff, size);
return buff;
@@ -139,9 +139,9 @@ wchar_t *a2w(const char *as)
char *w2a(const wchar_t *ws)
{
- int size = WideCharToMultiByte(iCodePage, 0, ws, -1, 0, 0, 0, 0);
+ int size = WideCharToMultiByte(iCodePage, 0, ws, -1, nullptr, 0, nullptr, nullptr);
char *buff = (char *)mir_alloc(size);
- WideCharToMultiByte(iCodePage, 0, ws, -1, buff, size, 0, 0);
+ WideCharToMultiByte(iCodePage, 0, ws, -1, buff, size, nullptr, nullptr);
return buff;
}
diff --git a/plugins/TipperYM/src/subst.cpp b/plugins/TipperYM/src/subst.cpp
index 67f668faf1..bc153af624 100644
--- a/plugins/TipperYM/src/subst.cpp
+++ b/plugins/TipperYM/src/subst.cpp
@@ -81,7 +81,7 @@ void StripBBCodesInPlace(wchar_t *ptszText)
if (!db_get_b(0, MODULE, "StripBBCodes", 1))
return;
- if (ptszText == 0)
+ if (ptszText == nullptr)
return;
size_t iRead = 0, iWrite = 0;
@@ -170,8 +170,8 @@ wchar_t* GetLastMessageText(MCONTACT hContact, bool received)
if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT) == received) {
dbei.pBlob = (BYTE *)alloca(dbei.cbBlob);
db_event_get(hDbEvent, &dbei);
- if (dbei.cbBlob == 0 || dbei.pBlob == 0)
- return 0;
+ if (dbei.cbBlob == 0 || dbei.pBlob == nullptr)
+ return nullptr;
wchar_t *buff = DbEvent_GetTextW( &dbei, CP_ACP );
wchar_t *swzMsg = mir_wstrdup(buff);
@@ -182,7 +182,7 @@ wchar_t* GetLastMessageText(MCONTACT hContact, bool received)
}
}
- return 0;
+ return nullptr;
}
bool CanRetrieveStatusMsg(MCONTACT hContact, char *szProto)
@@ -208,7 +208,7 @@ bool CanRetrieveStatusMsg(MCONTACT hContact, char *szProto)
wchar_t* GetStatusMessageText(MCONTACT hContact)
{
- wchar_t *swzMsg = NULL;
+ wchar_t *swzMsg = nullptr;
DBVARIANT dbv;
char *szProto = GetContactProto(hContact);
@@ -218,7 +218,7 @@ wchar_t* GetStatusMessageText(MCONTACT hContact)
else {
WORD wStatus = (int)CallProtoService(szProto, PS_GETSTATUS, 0, 0);
if (wStatus == ID_STATUS_OFFLINE)
- return NULL;
+ return nullptr;
if (!db_get_ws(hContact, MODULE, "TempStatusMsg", &dbv)) {
if (mir_wstrlen(dbv.ptszVal) != 0)
@@ -230,7 +230,7 @@ wchar_t* GetStatusMessageText(MCONTACT hContact)
if (!swzMsg) {
if (CanRetrieveStatusMsg(hContact, szProto))
if (ProtoChainSend(hContact, PSS_GETAWAYMSG, 0, 0))
- return NULL;
+ return nullptr;
if (!db_get_ws(hContact, "CList", "StatusMsg", &dbv)) {
if (mir_wstrlen(dbv.ptszVal) != 0)
@@ -251,7 +251,7 @@ bool GetSysSubstText(MCONTACT hContact, wchar_t *swzRawSpec, wchar_t *buff, int
bool recv = false;
if (!mir_wstrcmp(swzRawSpec, L"uid"))
- return Uid(hContact, 0, buff, bufflen);
+ return Uid(hContact, nullptr, buff, bufflen);
if (!mir_wstrcmp(swzRawSpec, L"proto")) {
char *szProto = GetContactProto(hContact);
@@ -314,7 +314,7 @@ bool GetSysSubstText(MCONTACT hContact, wchar_t *swzRawSpec, wchar_t *buff, int
MCONTACT hSubContact = db_mc_getMostOnline(hContact);
if (!hSubContact || (INT_PTR)hSubContact == CALLSERVICE_NOTFOUND)
return false;
- return Uid(hSubContact, 0, buff, bufflen);
+ return Uid(hSubContact, nullptr, buff, bufflen);
}
else if (!mir_wstrcmp(swzRawSpec, L"meta_subproto")) {
// get protocol of active subcontact
@@ -338,7 +338,7 @@ bool GetSysSubstText(MCONTACT hContact, wchar_t *swzRawSpec, wchar_t *buff, int
else if ((recv = !mir_wstrcmp(swzRawSpec, L"last_msg_reltime")) || !mir_wstrcmp(swzRawSpec, L"last_msg_out_reltime")) {
DWORD ts = LastMessageTimestamp(hContact, recv);
if (ts == 0) return false;
- DWORD t = (DWORD)time(0);
+ DWORD t = (DWORD)time(nullptr);
DWORD diff = (t - ts);
int d = (diff / 60 / 60 / 24);
int h = (diff - d * 60 * 60 * 24) / 60 / 60;
@@ -366,7 +366,7 @@ bool GetSysSubstText(MCONTACT hContact, wchar_t *swzRawSpec, wchar_t *buff, int
if (i > 0)
hTmpContact = db_mc_getSub(hContact, i);
dwRecountTs = db_get_dw(hTmpContact, MODULE, "LastCountTS", 0);
- dwTime = (DWORD)time(0);
+ dwTime = (DWORD)time(nullptr);
dwDiff = (dwTime - dwRecountTs);
if (dwDiff > (60 * 60 * 24 * 3)) {
db_set_dw(hTmpContact, MODULE, "LastCountTS", dwTime);
@@ -420,7 +420,7 @@ bool GetSysSubstText(MCONTACT hContact, wchar_t *swzRawSpec, wchar_t *buff, int
bool GetSubstText(MCONTACT hContact, const DISPLAYSUBST &ds, wchar_t *buff, int bufflen)
{
- TranslateFunc *transFunc = 0;
+ TranslateFunc *transFunc = nullptr;
for (int i = 0; i < iTransFuncsCount; i++)
if (translations[i].id == (DWORD)ds.iTranslateFuncId) {
transFunc = translations[i].transFunc;
@@ -432,13 +432,13 @@ bool GetSubstText(MCONTACT hContact, const DISPLAYSUBST &ds, wchar_t *buff, int
switch (ds.type) {
case DVT_DB:
- return transFunc(hContact, ds.szModuleName, ds.szSettingName, buff, bufflen) != 0;
+ return transFunc(hContact, ds.szModuleName, ds.szSettingName, buff, bufflen) != nullptr;
case DVT_PROTODB:
char *szProto = GetContactProto(hContact);
if (szProto) {
- if (transFunc(hContact, szProto, ds.szSettingName, buff, bufflen) != 0)
+ if (transFunc(hContact, szProto, ds.szSettingName, buff, bufflen) != nullptr)
return true;
- return transFunc(hContact, "UserInfo", ds.szSettingName, buff, bufflen) != 0;
+ return transFunc(hContact, "UserInfo", ds.szSettingName, buff, bufflen) != nullptr;
}
break;
}
@@ -454,13 +454,13 @@ bool GetRawSubstText(MCONTACT hContact, char *szRawSpec, wchar_t *buff, int buff
if (mir_strlen(szRawSpec) == 0) {
char *szProto = GetContactProto(hContact);
if (szProto) {
- if (translations[0].transFunc(hContact, szProto, &szRawSpec[i + 1], buff, bufflen) != 0)
+ if (translations[0].transFunc(hContact, szProto, &szRawSpec[i + 1], buff, bufflen) != nullptr)
return true;
- return translations[0].transFunc(hContact, "UserInfo", &szRawSpec[i + 1], buff, bufflen) != 0;
+ return translations[0].transFunc(hContact, "UserInfo", &szRawSpec[i + 1], buff, bufflen) != nullptr;
}
return false;
}
- return translations[0].transFunc(hContact, szRawSpec, &szRawSpec[i + 1], buff, bufflen) != 0;
+ return translations[0].transFunc(hContact, szRawSpec, &szRawSpec[i + 1], buff, bufflen) != nullptr;
}
}
return false;
@@ -475,7 +475,7 @@ bool ApplySubst(MCONTACT hContact, const wchar_t *swzSource, bool parseTipperVar
}
// pass to variables plugin if available
- wchar_t *swzVarSrc = (parseTipperVarsFirst ? mir_wstrdup(swzSource) : variables_parsedup((wchar_t *)swzSource, 0, hContact));
+ wchar_t *swzVarSrc = (parseTipperVarsFirst ? mir_wstrdup(swzSource) : variables_parsedup((wchar_t *)swzSource, nullptr, hContact));
size_t iSourceLen = mir_wstrlen(swzVarSrc);
size_t si = 0, di = 0, v = 0;
@@ -508,14 +508,14 @@ bool ApplySubst(MCONTACT hContact, const wchar_t *swzSource, bool parseTipperVar
p++;
if (*p) {
char *cp = GetContactProto(hContact);
- if (cp != NULL) {
+ if (cp != nullptr) {
PROTOACCOUNT *acc = Proto_GetAccount(cp);
- if (acc != NULL) {
+ if (acc != nullptr) {
cp = acc->szProtoName;
}
}
- if (cp == NULL)
+ if (cp == nullptr)
goto empty;
bool negate = false;
@@ -639,7 +639,7 @@ bool ApplySubst(MCONTACT hContact, const wchar_t *swzSource, bool parseTipperVar
swzDest[di] = 0;
if (parseTipperVarsFirst) {
- swzVarSrc = variables_parsedup(swzDest, 0, hContact);
+ swzVarSrc = variables_parsedup(swzDest, nullptr, hContact);
wcsncpy(swzDest, swzVarSrc, iDestLen);
mir_free(swzVarSrc);
}
@@ -687,18 +687,18 @@ void TruncateString(wchar_t *ptszText)
wchar_t* GetProtoStatusMessage(char *szProto, WORD wStatus)
{
if (!szProto || wStatus == ID_STATUS_OFFLINE)
- return NULL;
+ return nullptr;
// check if protocol supports status message for status
int flags = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0);
if (!(flags & Proto_Status2Flag(wStatus)))
- return NULL;
+ return nullptr;
wchar_t *ptszText = (wchar_t *)CallProtoService(szProto, PS_GETMYAWAYMSG, 0, SGMA_UNICODE);
if ((INT_PTR)ptszText == CALLSERVICE_NOTFOUND)
ptszText = (wchar_t *)CallService(MS_AWAYMSG_GETSTATUSMSGW, wStatus, (LPARAM)szProto);
- else if (ptszText == NULL) {
+ else if (ptszText == nullptr) {
// try to use service without SGMA_TCHAR
char *tmpMsg = (char *)CallProtoService(szProto, PS_GETMYAWAYMSG, 0, 0);
if (tmpMsg && (INT_PTR)tmpMsg != CALLSERVICE_NOTFOUND) {
@@ -710,7 +710,7 @@ wchar_t* GetProtoStatusMessage(char *szProto, WORD wStatus)
if (ptszText && !ptszText[0]) {
mir_free(ptszText);
- ptszText = NULL;
+ ptszText = nullptr;
}
if (ptszText && opt.bLimitMsg)
@@ -722,12 +722,12 @@ wchar_t* GetProtoStatusMessage(char *szProto, WORD wStatus)
wchar_t* GetProtoExtraStatusTitle(char *szProto)
{
if (!szProto)
- return NULL;
+ return nullptr;
wchar_t *ptszText = db_get_wsa(0, szProto, "XStatusName");
if (!ptszText) {
wchar_t buff[256];
- if (EmptyXStatusToDefaultName(0, szProto, 0, buff, 256))
+ if (EmptyXStatusToDefaultName(0, szProto, nullptr, buff, 256))
ptszText = mir_wstrdup(buff);
}
@@ -740,11 +740,11 @@ wchar_t* GetProtoExtraStatusTitle(char *szProto)
wchar_t* GetProtoExtraStatusMessage(char *szProto)
{
if (!szProto)
- return NULL;
+ return nullptr;
wchar_t *ptszText = db_get_wsa(0, szProto, "XStatusMsg");
- if (ptszText == NULL)
- return NULL;
+ if (ptszText == nullptr)
+ return nullptr;
if (ServiceExists(MS_VARS_FORMATSTRING)) {
MCONTACT hContact = db_find_first();
@@ -759,7 +759,7 @@ wchar_t* GetProtoExtraStatusMessage(char *szProto)
}
}
- wchar_t *tszParsed = variables_parse(ptszText, NULL, hContact);
+ wchar_t *tszParsed = variables_parse(ptszText, nullptr, hContact);
if (tszParsed)
{
mir_free(ptszText);
@@ -776,7 +776,7 @@ wchar_t* GetProtoExtraStatusMessage(char *szProto)
wchar_t* GetListeningTo(char *szProto)
{
if (!szProto)
- return NULL;
+ return nullptr;
wchar_t *ptszText = db_get_wsa(0, szProto, "ListeningTo");
if (opt.bLimitMsg)
@@ -788,7 +788,7 @@ wchar_t* GetListeningTo(char *szProto)
wchar_t* GetJabberAdvStatusText(char *szProto, const char *szSlot, const char *szValue)
{
if (!szProto)
- return NULL;
+ return nullptr;
char szSetting[128];
mir_snprintf(szSetting, "%s/%s/%s", szProto, szSlot, szValue);
@@ -802,10 +802,10 @@ wchar_t* GetJabberAdvStatusText(char *szProto, const char *szSlot, const char *s
HICON GetJabberActivityIcon(MCONTACT hContact, char *szProto)
{
if (!szProto)
- return NULL;
+ return nullptr;
char szSetting[128];
mir_snprintf(szSetting, "%s/%s/%s", szProto, "activity", "icon");
ptrA szIcon(db_get_sa(hContact, "AdvStatus", szSetting));
- return (szIcon != NULL) ? IcoLib_GetIcon(szIcon) : NULL;
+ return (szIcon != NULL) ? IcoLib_GetIcon(szIcon) : nullptr;
}
diff --git a/plugins/TipperYM/src/tipper.cpp b/plugins/TipperYM/src/tipper.cpp
index 98950da04b..a1e9c2a56d 100644
--- a/plugins/TipperYM/src/tipper.cpp
+++ b/plugins/TipperYM/src/tipper.cpp
@@ -29,13 +29,13 @@ HFONT hFontTitle, hFontLabels, hFontValues, hFontTrayTitle;
// hooked here so it's in the main thread
HANDLE hAvChangeEvent, hShowTipEvent, hHideTipEvent, hAckEvent, hFramesSBShow, hFramesSBHide;
HANDLE hSettingChangedEvent, hEventDeleted;
-HANDLE hReloadFonts = NULL;
+HANDLE hReloadFonts = nullptr;
HANDLE hFolderChanged, hSkinFolder;
wchar_t SKIN_FOLDER[256];
-CLIST_INTERFACE *pcli = NULL;
-FI_INTERFACE *fii = NULL;
+CLIST_INTERFACE *pcli = nullptr;
+FI_INTERFACE *fii = nullptr;
int hLangpack;
PLUGININFOEX pluginInfoEx =
@@ -268,7 +268,7 @@ int ModulesLoaded(WPARAM, LPARAM)
CallService(MS_CLC_SETINFOTIPHOVERTIME, opt.iTimeIn, 0);
// set Miranda start timestamp
- db_set_dw(0, MODULE, "MirandaStartTS", (DWORD)time(0));
+ db_set_dw(0, MODULE, "MirandaStartTS", (DWORD)time(nullptr));
return 0;
}
diff --git a/plugins/TipperYM/src/translations.cpp b/plugins/TipperYM/src/translations.cpp
index c981322f81..c8f8d58e18 100644
--- a/plugins/TipperYM/src/translations.cpp
+++ b/plugins/TipperYM/src/translations.cpp
@@ -21,7 +21,7 @@ Boston, MA 02111-1307, USA.
#include "stdafx.h"
int iTransFuncsCount = 0;
-DBVTranslation *translations = 0;
+DBVTranslation *translations = nullptr;
DWORD dwNextFuncId;
HANDLE hServiceAdd;
@@ -29,7 +29,7 @@ HANDLE hServiceAdd;
void AddTranslation(DBVTranslation *newTrans)
{
DBVTranslation *ptranslations = (DBVTranslation *)mir_realloc(translations, sizeof(DBVTranslation) * (iTransFuncsCount+1));
- if (ptranslations == NULL)
+ if (ptranslations == nullptr)
return;
translations = ptranslations;
iTransFuncsCount++;
@@ -67,14 +67,14 @@ wchar_t *NullTranslation(MCONTACT hContact, const char *szModuleName, const char
{
if (DBGetContactSettingAsString(hContact, szModuleName, szSettingName, buff, bufflen))
return buff;
- return NULL;
+ return nullptr;
}
wchar_t* TimestampToShortDate(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ts == 0)
- return 0;
+ return nullptr;
return TimeZone_ToStringT(ts, L"d", buff, bufflen);
}
@@ -83,7 +83,7 @@ wchar_t* TimestampToLongDate(MCONTACT hContact, const char *szModuleName, const
{
DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ts == 0)
- return 0;
+ return nullptr;
return TimeZone_ToStringT(ts, L"D", buff, bufflen);
}
@@ -92,7 +92,7 @@ wchar_t* TimestampToTime(MCONTACT hContact, const char *szModuleName, const char
{
DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ts == 0)
- return 0;
+ return nullptr;
return TimeZone_ToStringT(ts, L"s", buff, bufflen);
}
@@ -101,7 +101,7 @@ wchar_t* TimestampToTimeNoSecs(MCONTACT hContact, const char *szModuleName, cons
{
DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ts == 0)
- return 0;
+ return nullptr;
return TimeZone_ToStringT(ts, L"t", buff, bufflen);
}
@@ -109,8 +109,8 @@ wchar_t* TimestampToTimeNoSecs(MCONTACT hContact, const char *szModuleName, cons
wchar_t* TimestampToTimeDifference(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
- DWORD t = (DWORD)time(0);
- if (ts == 0) return 0;
+ DWORD t = (DWORD)time(nullptr);
+ if (ts == 0) return nullptr;
DWORD diff = (ts > t) ? 0 : (t - ts);
int d = (diff / 60 / 60 / 24);
@@ -167,7 +167,7 @@ wchar_t *ByteToYesNo(MCONTACT hContact, const char *szModuleName, const char *sz
}
db_free(&dbv);
}
- return 0;
+ return nullptr;
}
wchar_t *ByteToGender(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
@@ -178,7 +178,7 @@ wchar_t *ByteToGender(MCONTACT hContact, const char *szModuleName, const char *s
else if (val == 'M')
wcsncpy(buff, TranslateT("Male"), bufflen);
else
- return 0;
+ return nullptr;
buff[bufflen - 1] = 0;
return buff;
@@ -186,17 +186,17 @@ wchar_t *ByteToGender(MCONTACT hContact, const char *szModuleName, const char *s
wchar_t *WordToCountry(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
- char *szCountryName = 0;
+ char *szCountryName = nullptr;
WORD cid = (WORD)db_get_w(hContact, szModuleName, szSettingName, (WORD)-1);
- if (cid != (WORD)-1 && ServiceExists(MS_UTILS_GETCOUNTRYBYNUMBER) && (szCountryName = (char *)CallService(MS_UTILS_GETCOUNTRYBYNUMBER, cid, 0)) != 0)
+ if (cid != (WORD)-1 && ServiceExists(MS_UTILS_GETCOUNTRYBYNUMBER) && (szCountryName = (char *)CallService(MS_UTILS_GETCOUNTRYBYNUMBER, cid, 0)) != nullptr)
{
if (mir_strcmp(szCountryName, "Unknown") == 0)
- return 0;
+ return nullptr;
a2t(szCountryName, buff, bufflen);
buff[bufflen - 1] = 0;
return buff;
}
- return 0;
+ return nullptr;
}
wchar_t *DwordToIp(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
@@ -207,7 +207,7 @@ wchar_t *DwordToIp(MCONTACT hContact, const char *szModuleName, const char *szSe
mir_snwprintf(buff, bufflen, L"%u.%u.%u.%u", ipc[3], ipc[2], ipc[1], ipc[0]);
return buff;
}
- return 0;
+ return nullptr;
}
bool GetInt(const DBVARIANT &dbv, int *iVal)
@@ -271,7 +271,7 @@ wchar_t *DayMonthYearToDate(MCONTACT hContact, const char *szModuleName, const c
else
db_free(&dbv);
}
- return 0;
+ return nullptr;
}
wchar_t *DayMonthYearToAge(MCONTACT hContact, const char *szModuleName, const char *szPrefix, wchar_t *buff, int bufflen)
@@ -320,7 +320,7 @@ wchar_t *DayMonthYearToAge(MCONTACT hContact, const char *szModuleName, const ch
else
db_free(&dbv);
}
- return 0;
+ return nullptr;
}
wchar_t *HoursMinutesSecondsToTime(MCONTACT hContact, const char *szModuleName, const char *szPrefix, wchar_t *buff, int bufflen)
@@ -354,7 +354,7 @@ wchar_t *HoursMinutesSecondsToTime(MCONTACT hContact, const char *szModuleName,
st.wMinute = minutes;
st.wSecond = seconds;
- GetTimeFormat(LOCALE_USER_DEFAULT, 0, &st, 0, buff, bufflen);
+ GetTimeFormat(LOCALE_USER_DEFAULT, 0, &st, nullptr, buff, bufflen);
return buff;
}
else
@@ -364,7 +364,7 @@ wchar_t *HoursMinutesSecondsToTime(MCONTACT hContact, const char *szModuleName,
else
db_free(&dbv);
}
- return 0;
+ return nullptr;
}
wchar_t *HoursMinutesToTime(MCONTACT hContact, const char *szModuleName, const char *szPrefix, wchar_t *buff, int bufflen)
@@ -390,7 +390,7 @@ wchar_t *HoursMinutesToTime(MCONTACT hContact, const char *szModuleName, const c
st.wHour = hours;
st.wMinute = minutes;
- GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, 0, buff, bufflen);
+ GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, nullptr, buff, bufflen);
return buff;
}
else
@@ -400,7 +400,7 @@ wchar_t *HoursMinutesToTime(MCONTACT hContact, const char *szModuleName, const c
else
db_free(&dbv);
}
- return 0;
+ return nullptr;
}
wchar_t *DmyToTimeDifference(MCONTACT hContact, const char *szModuleName, const char *szPrefix, wchar_t *buff, int bufflen)
@@ -502,7 +502,7 @@ wchar_t *DmyToTimeDifference(MCONTACT hContact, const char *szModuleName, const
else
db_free(&dbv);
}
- return 0;
+ return nullptr;
}
wchar_t *DayMonthToDaysToNextBirthday(MCONTACT hContact, const char *szModuleName, const char *szPrefix, wchar_t *buff, int bufflen)
@@ -523,7 +523,7 @@ wchar_t *DayMonthToDaysToNextBirthday(MCONTACT hContact, const char *szModuleNam
if (GetInt(dbv, &month))
{
db_free(&dbv);
- time_t now = time(NULL);
+ time_t now = time(nullptr);
struct tm *ti = localtime(&now);
int yday_now = ti->tm_yday;
@@ -554,7 +554,7 @@ wchar_t *DayMonthToDaysToNextBirthday(MCONTACT hContact, const char *szModuleNam
db_free(&dbv);
}
}
- return 0;
+ return nullptr;
}
@@ -579,7 +579,7 @@ wchar_t *EmptyXStatusToDefaultName(MCONTACT hContact, const char *szModuleName,
return buff;
int status = db_get_b(hContact, szModuleName, "XStatusId", 0);
- if (!status) return 0;
+ if (!status) return nullptr;
if (ProtoServiceExists(szModuleName, PS_GETCUSTOMSTATUSEX))
{
@@ -588,21 +588,21 @@ wchar_t *EmptyXStatusToDefaultName(MCONTACT hContact, const char *szModuleName,
xstatus.ptszName = szDefaultName;
xstatus.wParam = (WPARAM *)&status;
if (CallProtoService(szModuleName, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus))
- return 0;
+ return nullptr;
wcsncpy(buff, TranslateW(szDefaultName), bufflen);
buff[bufflen - 1] = 0;
return buff;
}
- return 0;
+ return nullptr;
}
wchar_t *TimezoneToTime(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
int timezone = db_get_b(hContact,szModuleName,szSettingName,256);
if (timezone==256 || (char)timezone==-100)
- return 0;
+ return nullptr;
TIME_ZONE_INFORMATION tzi;
FILETIME ft;
@@ -618,7 +618,7 @@ wchar_t *TimezoneToTime(MCONTACT hContact, const char *szModuleName, const char
lift.QuadPart -= (__int64)timezone * BIGI(30) * BIGI(60) * BIGI(10000000);
*(__int64*)&ft = lift.QuadPart;
FileTimeToSystemTime(&ft, &st);
- GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, NULL, buff, bufflen);
+ GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, nullptr, buff, bufflen);
return buff;
}
@@ -633,7 +633,7 @@ wchar_t *ByteToDay(MCONTACT hContact, const char *szModuleName, const char *szSe
return buff;
}
- return 0;
+ return nullptr;
}
wchar_t *ByteToMonth(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
@@ -646,7 +646,7 @@ wchar_t *ByteToMonth(MCONTACT hContact, const char *szModuleName, const char *sz
return buff;
}
- return 0;
+ return nullptr;
}
wchar_t *ByteToLanguage(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
@@ -665,7 +665,7 @@ wchar_t *ByteToLanguage(MCONTACT hContact, const char *szModuleName, const char
}
}
- return 0;
+ return nullptr;
}
INT_PTR ServiceAddTranslation(WPARAM, LPARAM lParam)