diff options
author | Neil <nyamatongwe@gmail.com> | 2018-04-25 17:12:55 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2018-04-25 17:12:55 +1000 |
commit | 3fb1bc5789348d9f9a8bc7868c20ab5ba6b41a41 (patch) | |
tree | b39c8ac8d329c882e6a6ce4c3e012987af78a517 /win32/ScintillaWin.cxx | |
parent | 5f88849f4e0784056efcea8aaea2138aebdf3dfe (diff) | |
download | scintilla-mirror-3fb1bc5789348d9f9a8bc7868c20ab5ba6b41a41.tar.gz |
Use set of coercion functions for transforming WndProc parameters into pointers.
Diffstat (limited to 'win32/ScintillaWin.cxx')
-rw-r--r-- | win32/ScintillaWin.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index cdb6cc472..480c82e64 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -1201,7 +1201,7 @@ sptr_t ScintillaWin::GetTextLength() { } sptr_t ScintillaWin::GetText(uptr_t wParam, sptr_t lParam) { - wchar_t *ptr = reinterpret_cast<wchar_t *>(lParam); + wchar_t *ptr = static_cast<wchar_t *>(PtrFromSPtr(lParam)); if (pdoc->Length() == 0) { *ptr = L'\0'; return 0; @@ -1757,16 +1757,16 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam #ifdef SCI_LEXER case SCI_LOADLEXERLIBRARY: - LexerManager::GetInstance()->Load(reinterpret_cast<const char *>(lParam)); + LexerManager::GetInstance()->Load(ConstCharPtrFromSPtr(lParam)); break; #endif case SCI_TARGETASUTF8: - return TargetAsUTF8(reinterpret_cast<char*>(lParam)); + return TargetAsUTF8(CharPtrFromSPtr(lParam)); case SCI_ENCODEDFROMUTF8: - return EncodedFromUTF8(reinterpret_cast<const char*>(wParam), - reinterpret_cast<char*>(lParam)); + return EncodedFromUTF8(ConstCharPtrFromUPtr(wParam), + CharPtrFromSPtr(lParam)); default: return ScintillaBase::WndProc(iMessage, wParam, lParam); @@ -2702,7 +2702,7 @@ LRESULT ScintillaWin::ImeOnReconvert(LPARAM lParam) { const int rcFeedLen = static_cast<int>(rcFeed.length()) * sizeof(wchar_t); const int rcSize = sizeof(RECONVERTSTRING) + rcFeedLen + sizeof(wchar_t); - RECONVERTSTRING *rc = reinterpret_cast<RECONVERTSTRING *>(lParam); + RECONVERTSTRING *rc = static_cast<RECONVERTSTRING *>(PtrFromSPtr(lParam)); if (!rc) return rcSize; // Immediately be back with rcSize of memory block. @@ -3288,7 +3288,7 @@ LRESULT PASCAL ScintillaWin::CTWndProc( if (sciThis == 0) { if (iMessage == WM_CREATE) { // Associate CallTip object with window - CREATESTRUCT *pCreate = reinterpret_cast<CREATESTRUCT *>(lParam); + CREATESTRUCT *pCreate = static_cast<CREATESTRUCT *>(PtrFromSPtr(lParam)); SetWindowPointer(hWnd, pCreate->lpCreateParams); return 0; } else { |