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 /src/Editor.h | |
| parent | 5f88849f4e0784056efcea8aaea2138aebdf3dfe (diff) | |
| download | scintilla-mirror-3fb1bc5789348d9f9a8bc7868c20ab5ba6b41a41.tar.gz | |
Use set of coercion functions for transforming WndProc parameters into pointers.
Diffstat (limited to 'src/Editor.h')
| -rw-r--r-- | src/Editor.h | 23 | 
1 files changed, 23 insertions, 0 deletions
diff --git a/src/Editor.h b/src/Editor.h index f45d18661..9fda8ddea 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -568,6 +568,29 @@ protected:	// ScintillaBase subclass needs access to much of Editor  	static const char *StringFromEOLMode(int eolMode); +	// Coercion functions for transforming WndProc parameters into pointers +	static void *PtrFromSPtr(sptr_t lParam) { +		return reinterpret_cast<void *>(lParam); +	} +	static const char *ConstCharPtrFromSPtr(sptr_t lParam) { +		return static_cast<const char *>(PtrFromSPtr(lParam)); +	} +	static const unsigned char *ConstUCharPtrFromSPtr(sptr_t lParam) { +		return static_cast<const unsigned char *>(PtrFromSPtr(lParam)); +	} +	static char *CharPtrFromSPtr(sptr_t lParam) { +		return static_cast<char *>(PtrFromSPtr(lParam)); +	} +	static unsigned char *UCharPtrFromSPtr(sptr_t lParam) { +		return static_cast<unsigned char *>(PtrFromSPtr(lParam)); +	} +	static void *PtrFromUPtr(uptr_t wParam) { +		return reinterpret_cast<void *>(wParam); +	} +	static const char *ConstCharPtrFromUPtr(uptr_t wParam) { +		return static_cast<const char *>(PtrFromUPtr(wParam)); +	} +  	static sptr_t StringResult(sptr_t lParam, const char *val);  	static sptr_t BytesResult(sptr_t lParam, const unsigned char *val, size_t len);  | 
