From a7c24ca48995cf2bf436156302f96b91bf135409 Mon Sep 17 00:00:00 2001 From: Goraf <22941576+Goraf@users.noreply.github.com> Date: Mon, 13 Nov 2017 15:03:31 +0100 Subject: Code modernize ... * replace 0/NULL with nullptr [using clang-tidy] --- plugins/mTextControl/src/FormattedTextDraw.cpp | 24 ++++++++++++------------ plugins/mTextControl/src/ImageDataObjectHlp.cpp | 24 ++++++++++++------------ plugins/mTextControl/src/dataobject.cpp | 10 +++++----- plugins/mTextControl/src/enumformat.cpp | 8 ++++---- plugins/mTextControl/src/fancy_rtf.cpp | 20 ++++++++++---------- plugins/mTextControl/src/main.cpp | 8 ++++---- plugins/mTextControl/src/richeditutils.cpp | 22 +++++++++++----------- plugins/mTextControl/src/services.cpp | 16 ++++++++-------- plugins/mTextControl/src/textcontrol.cpp | 16 ++++++++-------- plugins/mTextControl/src/textusers.cpp | 8 ++++---- 10 files changed, 78 insertions(+), 78 deletions(-) (limited to 'plugins/mTextControl') diff --git a/plugins/mTextControl/src/FormattedTextDraw.cpp b/plugins/mTextControl/src/FormattedTextDraw.cpp index 61bd51534a..346cb8f1e2 100644 --- a/plugins/mTextControl/src/FormattedTextDraw.cpp +++ b/plugins/mTextControl/src/FormattedTextDraw.cpp @@ -176,14 +176,14 @@ HRESULT CFormattedTextDraw::Draw(void *hdcDraw, RECT *prc) m_spTextServices->TxDraw( DVASPECT_CONTENT, // Draw Aspect 0, // Lindex - NULL, // Info for drawing optimization - NULL, // target device information + nullptr, // Info for drawing optimization + nullptr, // target device information (HDC)hdcDraw, // Draw device HDC - NULL, // Target device HDC + nullptr, // Target device HDC (RECTL *)prc, // Bounding client rectangle - NULL, // Clipping rectangle for metafiles - (RECT *)NULL, // Update rectangle - NULL, // Call back function + nullptr, // Clipping rectangle for metafiles + (RECT *)nullptr, // Update rectangle + nullptr, // Call back function NULL, // Call back parameter TXTVIEW_INACTIVE); // What view of the object could be TXTVIEW_ACTIVE return S_OK; @@ -223,7 +223,7 @@ HRESULT CFormattedTextDraw::get_NaturalSize(void *hdcDraw, long *Width, long *He SIZEL szExtent; szExtent.cx = *Width; szExtent.cy = *Height; - if (m_spTextServices->TxGetNaturalSize(DVASPECT_CONTENT, (HDC)hdcDraw, NULL, NULL, TXTNS_FITTOCONTENT, &szExtent, Width, Height) != S_OK) + if (m_spTextServices->TxGetNaturalSize(DVASPECT_CONTENT, (HDC)hdcDraw, nullptr, nullptr, TXTNS_FITTOCONTENT, &szExtent, Width, Height) != S_OK) return S_FALSE; return S_OK; @@ -234,7 +234,7 @@ HRESULT CFormattedTextDraw::get_NaturalSize(void *hdcDraw, long *Width, long *He HDC CFormattedTextDraw::TxGetDC() { - return NULL; + return nullptr; } INT CFormattedTextDraw::TxReleaseDC(HDC) @@ -307,7 +307,7 @@ void CFormattedTextDraw::TxSetFocus() void CFormattedTextDraw::TxSetCursor(HCURSOR hcur, BOOL fText) { if (fText) - SetCursor(LoadCursor(NULL, MAKEINTRESOURCE(IDC_ARROW))); + SetCursor(LoadCursor(nullptr, MAKEINTRESOURCE(IDC_ARROW))); else SetCursor(hcur); } @@ -425,7 +425,7 @@ HRESULT CFormattedTextDraw::TxNotify(DWORD, void *) HIMC CFormattedTextDraw::TxImmGetContext() { - return NULL; + return nullptr; } void CFormattedTextDraw::TxImmReleaseContext(HIMC) @@ -490,7 +490,7 @@ HRESULT CFormattedTextDraw::CharFormatFromHFONT(CHARFORMAT2W* pCF, HFONT hFont) HRESULT CFormattedTextDraw::InitDefaultCharFormat() { - return CharFormatFromHFONT(m_pCF, NULL); + return CharFormatFromHFONT(m_pCF, nullptr); } HRESULT CFormattedTextDraw::InitDefaultParaFormat() @@ -507,7 +507,7 @@ HRESULT CFormattedTextDraw::InitDefaultParaFormat() HRESULT CFormattedTextDraw::CreateTextServicesObject() { IUnknown *spUnk; - HRESULT hr = MyCreateTextServices(NULL, static_cast(this), &spUnk); + HRESULT hr = MyCreateTextServices(nullptr, static_cast(this), &spUnk); if (hr == S_OK) { hr = spUnk->QueryInterface(IID_ITextServices, (void**)&m_spTextServices); hr = spUnk->QueryInterface(IID_ITextDocument, (void**)&m_spTextDocument); diff --git a/plugins/mTextControl/src/ImageDataObjectHlp.cpp b/plugins/mTextControl/src/ImageDataObjectHlp.cpp index 762ccf7322..3c7a66eb55 100644 --- a/plugins/mTextControl/src/ImageDataObjectHlp.cpp +++ b/plugins/mTextControl/src/ImageDataObjectHlp.cpp @@ -28,7 +28,7 @@ struct EMFCACHE HICON hIcon; EMFCACHE *prev; EMFCACHE *next; -} *emfCache = 0; +} *emfCache = nullptr; int emfCacheSize = 0; mir_cs csEmfCache; @@ -44,7 +44,7 @@ void UnloadEmfCache() HENHMETAFILE CacheIconToEmf(HICON hIcon) { - HENHMETAFILE result = 0; + HENHMETAFILE result = nullptr; mir_cslock lck(csEmfCache); for (EMFCACHE *p = emfCache; p; p = p->next) if (p->hIcon == hIcon) @@ -53,11 +53,11 @@ HENHMETAFILE CacheIconToEmf(HICON hIcon) { p->prev->next = p->next; if (p->next) p->next->prev = p->prev; - p->prev = 0; + p->prev = nullptr; emfCache->prev = p; p->next = emfCache; emfCache = p; - result = CopyEnhMetaFile(emfCache->hEmf, 0); + result = CopyEnhMetaFile(emfCache->hEmf, nullptr); break; } } @@ -66,17 +66,17 @@ HENHMETAFILE CacheIconToEmf(HICON hIcon) if (!result) { EMFCACHE *newItem = new EMFCACHE; - newItem->prev = 0; + newItem->prev = nullptr; newItem->next = emfCache; if (emfCache) emfCache->prev = newItem; emfCache = newItem; emfCacheSize++; - HDC emfdc = CreateEnhMetaFile(NULL, NULL, NULL, L"icon"); - DrawIconEx(emfdc, 0, 0, (HICON)hIcon, 16, 16, 0, NULL, DI_NORMAL); + HDC emfdc = CreateEnhMetaFile(nullptr, nullptr, nullptr, L"icon"); + DrawIconEx(emfdc, 0, 0, (HICON)hIcon, 16, 16, 0, nullptr, DI_NORMAL); emfCache->hIcon = hIcon; emfCache->hEmf = CloseEnhMetaFile(emfdc); - result = CopyEnhMetaFile(emfCache->hEmf, 0); + result = CopyEnhMetaFile(emfCache->hEmf, nullptr); } // tail cutoff @@ -112,14 +112,14 @@ bool InsertBitmap(IRichEditOle* pRichEditOle, HENHMETAFILE hEmf) // static const FORMATETC lc_format[] = { - { CF_ENHMETAFILE, 0, DVASPECT_CONTENT, -1, TYMED_ENHMF }//, + { CF_ENHMETAFILE, nullptr, DVASPECT_CONTENT, -1, TYMED_ENHMF }//, // { CF_BITMAP, 0, DVASPECT_CONTENT, -1, TYMED_GDI }, // { CF_TEXT, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL } }; STGMEDIUM lc_stgmed[] = { - { TYMED_ENHMF, { (HBITMAP)hEmf }, 0 }//, + { TYMED_ENHMF, { (HBITMAP)hEmf }, nullptr }//, // { TYMED_GDI, { hBitmap }, 0 }, // { TYMED_HGLOBAL, { (HBITMAP)hGlobal }, 0 } }; @@ -134,8 +134,8 @@ bool InsertBitmap(IRichEditOle* pRichEditOle, HENHMETAFILE hEmf) // Initialize a Storage Object // - LPLOCKBYTES lpLockBytes = NULL; - sc = CreateILockBytesOnHGlobal(NULL, TRUE, &lpLockBytes); + LPLOCKBYTES lpLockBytes = nullptr; + sc = CreateILockBytesOnHGlobal(nullptr, TRUE, &lpLockBytes); if (sc != S_OK) { pOleClientSite->Release(); diff --git a/plugins/mTextControl/src/dataobject.cpp b/plugins/mTextControl/src/dataobject.cpp index 53fcd0e2f7..a05a63d05c 100644 --- a/plugins/mTextControl/src/dataobject.cpp +++ b/plugins/mTextControl/src/dataobject.cpp @@ -128,7 +128,7 @@ HRESULT __stdcall CDataObject::QueryInterface(REFIID iid, void **ppvObject) return S_OK; } - *ppvObject = 0; + *ppvObject = nullptr; return E_NOINTERFACE; } @@ -163,7 +163,7 @@ HRESULT __stdcall CDataObject::GetData(FORMATETC *pFormatEtc, STGMEDIUM *pMedium // found a match! transfer the data into the supplied storage-medium // pMedium->tymed = m_pFormatEtc[idx].tymed; - pMedium->pUnkForRelease = 0; + pMedium->pUnkForRelease = nullptr; switch (pMedium->tymed) { case TYMED_HGLOBAL: @@ -176,7 +176,7 @@ HRESULT __stdcall CDataObject::GetData(FORMATETC *pFormatEtc, STGMEDIUM *pMedium default: return DV_E_FORMATETC; } - if (pMedium->hBitmap == NULL) return STG_E_MEDIUMFULL; + if (pMedium->hBitmap == nullptr) return STG_E_MEDIUMFULL; return S_OK; } @@ -210,7 +210,7 @@ HRESULT __stdcall CDataObject::QueryGetData(FORMATETC *pFormatEtc) HRESULT __stdcall CDataObject::GetCanonicalFormatEtc(FORMATETC *, FORMATETC *pFormatEtcOut) { // Apparently we have to set this field to NULL even though we don't do anything else - pFormatEtcOut->ptd = NULL; + pFormatEtcOut->ptd = nullptr; return E_NOTIMPL; } @@ -267,7 +267,7 @@ HRESULT __stdcall CDataObject::EnumDAdvise(IEnumSTATDATA **) // HRESULT CreateDataObject(const FORMATETC *fmtetc, const STGMEDIUM *stgmeds, UINT count, IDataObject **ppDataObject) { - if (ppDataObject == 0) + if (ppDataObject == nullptr) return E_INVALIDARG; *ppDataObject = new CDataObject(fmtetc, stgmeds, count); diff --git a/plugins/mTextControl/src/enumformat.cpp b/plugins/mTextControl/src/enumformat.cpp index 27aceb5790..64ae07e3c3 100644 --- a/plugins/mTextControl/src/enumformat.cpp +++ b/plugins/mTextControl/src/enumformat.cpp @@ -55,7 +55,7 @@ private: // HRESULT CreateEnumFormatEtc(UINT nNumFormats, FORMATETC *pFormatEtc, IEnumFORMATETC **ppEnumFormatEtc) { - if (nNumFormats == 0 || pFormatEtc == 0 || ppEnumFormatEtc == 0) + if (nNumFormats == 0 || pFormatEtc == nullptr || ppEnumFormatEtc == nullptr) return E_INVALIDARG; *ppEnumFormatEtc = new CEnumFormatEtc(pFormatEtc, nNumFormats); @@ -149,7 +149,7 @@ HRESULT __stdcall CEnumFormatEtc::QueryInterface(REFIID iid, void **ppvObject) return S_OK; } else { - *ppvObject = 0; + *ppvObject = nullptr; return E_NOINTERFACE; } } @@ -165,7 +165,7 @@ HRESULT __stdcall CEnumFormatEtc::Next(ULONG celt, FORMATETC *pFormatEtc, ULONG ULONG copied = 0; // validate arguments - if (celt == 0 || pFormatEtc == 0) + if (celt == 0 || pFormatEtc == nullptr) return E_INVALIDARG; // copy FORMATETC structures into caller's buffer @@ -176,7 +176,7 @@ HRESULT __stdcall CEnumFormatEtc::Next(ULONG celt, FORMATETC *pFormatEtc, ULONG } // store result - if (pceltFetched != 0) + if (pceltFetched != nullptr) *pceltFetched = copied; // did we copy all that was requested? diff --git a/plugins/mTextControl/src/fancy_rtf.cpp b/plugins/mTextControl/src/fancy_rtf.cpp index 17f5f76dba..6aacfe0362 100644 --- a/plugins/mTextControl/src/fancy_rtf.cpp +++ b/plugins/mTextControl/src/fancy_rtf.cpp @@ -85,14 +85,14 @@ static bool bbCodeImageFunc(IFormattedTextDraw *ftd, CHARRANGE range, wchar_t *t static BBCodeInfo bbCodes[] = { - { L"[b]", 0, bbCodeSimpleFunc, BBS_BOLD_S }, - { L"[/b]", 0, bbCodeSimpleFunc, BBS_BOLD_E }, - { L"[i]", 0, bbCodeSimpleFunc, BBS_ITALIC_S }, - { L"[/i]", 0, bbCodeSimpleFunc, BBS_ITALIC_E }, - { L"[u]", 0, bbCodeSimpleFunc, BBS_UNDERLINE_S }, - { L"[/u]", 0, bbCodeSimpleFunc, BBS_UNDERLINE_E }, - { L"[s]", 0, bbCodeSimpleFunc, BBS_STRIKEOUT_S }, - { L"[/s]", 0, bbCodeSimpleFunc, BBS_STRIKEOUT_E }, + { L"[b]", nullptr, bbCodeSimpleFunc, BBS_BOLD_S }, + { L"[/b]", nullptr, bbCodeSimpleFunc, BBS_BOLD_E }, + { L"[i]", nullptr, bbCodeSimpleFunc, BBS_ITALIC_S }, + { L"[/i]", nullptr, bbCodeSimpleFunc, BBS_ITALIC_E }, + { L"[u]", nullptr, bbCodeSimpleFunc, BBS_UNDERLINE_S }, + { L"[/u]", nullptr, bbCodeSimpleFunc, BBS_UNDERLINE_E }, + { L"[s]", nullptr, bbCodeSimpleFunc, BBS_STRIKEOUT_S }, + { L"[/s]", nullptr, bbCodeSimpleFunc, BBS_STRIKEOUT_E }, // { L"[color=", L"]", bbCodeSimpleFunc, BBS_COLOR_S }, // { L"[/color]", 0, bbCodeSimpleFunc, BBS_COLOR_E } @@ -115,8 +115,8 @@ void bbCodeParse(IFormattedTextDraw *ftd) for (bool found = true; found;) { found = false; CHARRANGE fRange; fRange.cpMin = -1; - wchar_t *fText = 0; - BBCodeInfo *fBBCode = NULL; + wchar_t *fText = nullptr; + BBCodeInfo *fBBCode = nullptr; for (int i = 0; i < bbCodeCount; i++) { CHARRANGE range; diff --git a/plugins/mTextControl/src/main.cpp b/plugins/mTextControl/src/main.cpp index f96175de84..ce4ce10b7e 100644 --- a/plugins/mTextControl/src/main.cpp +++ b/plugins/mTextControl/src/main.cpp @@ -21,13 +21,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h" -HINSTANCE hInst = 0; +HINSTANCE hInst = nullptr; int hLangpack; -HMODULE hMsfteditDll = 0; +HMODULE hMsfteditDll = nullptr; typedef HRESULT(WINAPI *pfnMyCreateTextServices)(IUnknown *punkOuter, ITextHost *pITextHost, IUnknown **ppUnk); -pfnMyCreateTextServices MyCreateTextServices = NULL; +pfnMyCreateTextServices MyCreateTextServices = nullptr; PLUGININFOEX pluginInfoEx = { @@ -59,7 +59,7 @@ extern "C" __declspec(dllexport) int Load(void) { mir_getLP(&pluginInfoEx); - MyCreateTextServices = 0; + MyCreateTextServices = nullptr; hMsfteditDll = LoadLibrary(L"msftedit.dll"); if (hMsfteditDll) MyCreateTextServices = (pfnMyCreateTextServices)GetProcAddress(hMsfteditDll, "CreateTextServices"); diff --git a/plugins/mTextControl/src/richeditutils.cpp b/plugins/mTextControl/src/richeditutils.cpp index 442e512d4e..650c596129 100644 --- a/plugins/mTextControl/src/richeditutils.cpp +++ b/plugins/mTextControl/src/richeditutils.cpp @@ -10,7 +10,7 @@ public: CREOleCallback() { refCount = 1; - pictStg = 0; + pictStg = nullptr; nextStgId = 0; } @@ -21,15 +21,15 @@ public: this->AddRef(); return S_OK; } - *ppvObj = NULL; + *ppvObj = nullptr; return E_NOINTERFACE; } ULONG STDMETHODCALLTYPE AddRef() { if (this->refCount == 0) { - if (S_OK != StgCreateDocfile(NULL, STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE | STGM_DELETEONRELEASE, 0, &this->pictStg)) - this->pictStg = NULL; + if (S_OK != StgCreateDocfile(nullptr, STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE | STGM_DELETEONRELEASE, 0, &this->pictStg)) + this->pictStg = nullptr; this->nextStgId = 0; } return ++this->refCount; @@ -78,7 +78,7 @@ public: { wchar_t sztName[64]; mir_snwprintf(sztName, L"s%u", this->nextStgId); - if (this->pictStg == NULL) + if (this->pictStg == nullptr) return STG_E_MEDIUMFULL; return this->pictStg->CreateStorage(sztName, STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE, 0, 0, lplpstg); @@ -101,7 +101,7 @@ public: } }; -IRichEditOleCallback *reOleCallback = 0; +IRichEditOleCallback *reOleCallback = nullptr; void InitRichEdit(ITextServices *ts) { @@ -131,12 +131,12 @@ void LoadRichEdit() wcl.cbClsExtra = 0; wcl.cbWndExtra = 0; wcl.hInstance = hInst; - wcl.hIcon = NULL; - wcl.hCursor = LoadCursor(NULL, IDC_ARROW); + wcl.hIcon = nullptr; + wcl.hCursor = LoadCursor(nullptr, IDC_ARROW); wcl.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH); - wcl.lpszMenuName = NULL; + wcl.lpszMenuName = nullptr; wcl.lpszClassName = L"NBRichEditProxyWndClass"; - wcl.hIconSm = 0; + wcl.hIconSm = nullptr; RegisterClassEx(&wcl); } @@ -147,7 +147,7 @@ void UnloadRichEdit() HWND CreateProxyWindow(ITextServices *ts) { - HWND hwnd = CreateWindow(L"NBRichEditProxyWndClass", L"", 0, 0, 0, 0, 0, 0, 0, hInst, 0); + HWND hwnd = CreateWindow(L"NBRichEditProxyWndClass", L"", 0, 0, 0, 0, 0, nullptr, nullptr, hInst, nullptr); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)ts); return hwnd; } diff --git a/plugins/mTextControl/src/services.cpp b/plugins/mTextControl/src/services.cpp index affac23e92..162e87057a 100644 --- a/plugins/mTextControl/src/services.cpp +++ b/plugins/mTextControl/src/services.cpp @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "stdafx.h" -static HANDLE hService[11] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; +static HANDLE hService[11] = { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr }; INT_PTR MText_Register(WPARAM, LPARAM); INT_PTR MText_Create(WPARAM, LPARAM); @@ -37,7 +37,7 @@ struct TextObject { DWORD options; IFormattedTextDraw *ftd; - TextObject() : options(0), ftd(0) {} + TextObject() : options(0), ftd(nullptr) {} ~TextObject() { if (ftd) delete ftd; } }; @@ -62,8 +62,8 @@ void MText_InitFormatting1(TextObject *text) SMADD_RICHEDIT3 sm = { 0 }; sm.cbSize = sizeof(sm); sm.hwndRichEditControl = hwnd; - sm.rangeToReplace = 0; - sm.Protocolname = 0; + sm.rangeToReplace = nullptr; + sm.Protocolname = nullptr; sm.flags = SAFLRE_INSERTEMF; CallService(MS_SMILEYADD_REPLACESMILEYS, RGB(0xff, 0xff, 0xff), (LPARAM)&sm); DestroyWindow(hwnd); @@ -164,7 +164,7 @@ MTI_MTextCreateEx(HANDLE userHandle, void *text, DWORD flags) MText_InitFormatting1(result); delete result; - return 0; + return nullptr; } INT_PTR MText_CreateEx(WPARAM wParam, LPARAM lParam) @@ -272,7 +272,7 @@ MTI_MTextSendMessage(HWND hwnd, HANDLE text, UINT msg, WPARAM wParam, LPARAM lPa if (hwnd && (msg == WM_MOUSEMOVE)) { HDC hdc = GetDC(hwnd); - ((TextObject *)text)->ftd->getTextService()->OnTxSetCursor(DVASPECT_CONTENT, 0, NULL, NULL, hdc, NULL, NULL, LOWORD(0), HIWORD(0)); + ((TextObject *)text)->ftd->getTextService()->OnTxSetCursor(DVASPECT_CONTENT, 0, nullptr, nullptr, hdc, nullptr, nullptr, LOWORD(0), HIWORD(0)); ReleaseDC(hwnd, hdc); } @@ -291,7 +291,7 @@ INT_PTR MText_SendMessage(WPARAM wParam, LPARAM) HWND DLL_CALLCONV MTI_MTextCreateProxy(HANDLE text) { - if (!text) return 0; + if (!text) return nullptr; return CreateProxyWindow(((TextObject *)text)->ftd->getTextService()); } @@ -325,7 +325,7 @@ INT_PTR MText_Destroy(WPARAM wParam, LPARAM) INT_PTR MText_GetInterface(WPARAM, LPARAM lParam) { MTEXT_INTERFACE *MText = (MTEXT_INTERFACE *)lParam; - if (MText == NULL) + if (MText == nullptr) return CALLSERVICE_NOTFOUND; MText->version = pluginInfoEx.version; diff --git a/plugins/mTextControl/src/textcontrol.cpp b/plugins/mTextControl/src/textcontrol.cpp index 4dad57ec55..b8f66ef432 100644 --- a/plugins/mTextControl/src/textcontrol.cpp +++ b/plugins/mTextControl/src/textcontrol.cpp @@ -39,12 +39,12 @@ void MTextControl_RegisterClass() wcl.cbClsExtra = 0; wcl.cbWndExtra = 0; wcl.hInstance = hInst; - wcl.hIcon = NULL; - wcl.hCursor = LoadCursor(NULL, IDC_ARROW); + wcl.hIcon = nullptr; + wcl.hCursor = LoadCursor(nullptr, IDC_ARROW); wcl.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH); - wcl.lpszMenuName = NULL; + wcl.lpszMenuName = nullptr; wcl.lpszClassName = MODULNAMEW; - wcl.hIconSm = 0; + wcl.hIconSm = nullptr; RegisterClassEx(&wcl); } @@ -54,8 +54,8 @@ LRESULT CALLBACK MTextControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM switch (msg) { case WM_CREATE: data = new TextControlData; - data->text = 0; - data->mtext = 0; + data->text = nullptr; + data->mtext = nullptr; data->htu = htuDefault; SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)data); PostMessage(hwnd, MTM_UPDATE, 0, 0); @@ -81,7 +81,7 @@ LRESULT CALLBACK MTextControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM RECT rc; GetClientRect(hwnd, &rc); MTI_MTextSetParent(data->mtext, hwnd, rc); - InvalidateRect(hwnd, 0, TRUE); + InvalidateRect(hwnd, nullptr, TRUE); } return TRUE; @@ -120,7 +120,7 @@ LRESULT MTextControl_OnPaint(HWND hwnd, WPARAM, LPARAM) // Find the text to draw TextControlData *data = (TextControlData *)GetWindowLongPtr(hwnd, GWLP_USERDATA); if (data->mtext) { - HFONT hfntSave = 0; + HFONT hfntSave = nullptr; HFONT hfnt = (HFONT)SendMessage(hwnd, WM_GETFONT, 0, 0); if (!hfnt) hfnt = (HFONT)SendMessage(GetParent(hwnd), WM_GETFONT, 0, 0); diff --git a/plugins/mTextControl/src/textusers.cpp b/plugins/mTextControl/src/textusers.cpp index 867c5e1243..b9a16a3d21 100644 --- a/plugins/mTextControl/src/textusers.cpp +++ b/plugins/mTextControl/src/textusers.cpp @@ -19,10 +19,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "stdafx.h" -HANDLE htuDefault = 0; +HANDLE htuDefault = nullptr; -TextUser *textUserFirst = 0; -TextUser *textUserLast = 0; +TextUser *textUserFirst = nullptr; +TextUser *textUserLast = nullptr; void LoadTextUsers() { @@ -48,7 +48,7 @@ HANDLE DLL_CALLCONV MTI_TextUserAdd(const char *userTitle, DWORD options) (db_get_dw(0, MODULNAME, userTitle, options)&MTEXT_FANCY_MASK) | (textUserNew->options&MTEXT_SYSTEM_MASK); db_set_dw(0, MODULNAME, userTitle, textUserNew->options); textUserNew->prev = textUserLast; - textUserNew->next = 0; + textUserNew->next = nullptr; if (textUserLast) { textUserLast->next = textUserNew; textUserLast = textUserNew; -- cgit v1.2.3