aboutsummaryrefslogtreecommitdiffhomepage
path: root/cocoa
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2014-05-02 23:19:27 +1000
committerNeil <nyamatongwe@gmail.com>2014-05-02 23:19:27 +1000
commitde3131a78debeeb4997bba4a6dffec7384d3b4e6 (patch)
tree1b74b1fbab238227dd9951e23be93e3f3c99db9c /cocoa
parent20d6edd07a61856c02634971519c8519992d7346 (diff)
downloadscintilla-mirror-de3131a78debeeb4997bba4a6dffec7384d3b4e6.tar.gz
Use exact SciFnDirect function signature for DirectFunction as earlier version
depended on undefined behaviour.
Diffstat (limited to 'cocoa')
-rw-r--r--cocoa/ScintillaCocoa.h2
-rw-r--r--cocoa/ScintillaCocoa.mm6
2 files changed, 4 insertions, 4 deletions
diff --git a/cocoa/ScintillaCocoa.h b/cocoa/ScintillaCocoa.h
index 415094c35..7e4ed7214 100644
--- a/cocoa/ScintillaCocoa.h
+++ b/cocoa/ScintillaCocoa.h
@@ -177,7 +177,7 @@ public:
NSPoint GetCaretPosition();
- static sptr_t DirectFunction(ScintillaCocoa *sciThis, unsigned int iMessage, uptr_t wParam, sptr_t lParam);
+ static sptr_t DirectFunction(sptr_t ptr, unsigned int iMessage, uptr_t wParam, sptr_t lParam);
void TimerFired(NSTimer* timer);
void IdleTimerFired();
diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm
index 563cff839..7e86d86f1 100644
--- a/cocoa/ScintillaCocoa.mm
+++ b/cocoa/ScintillaCocoa.mm
@@ -787,16 +787,16 @@ void ScintillaCocoa::Redraw()
* However this is a Windows metaphor and not used here, hence we just call our fake
* window proc. The given parameters directly reflect the message parameters used on Windows.
*
- * @param sciThis The target which is to be called.
+ * @param ptr The target which is to be called.
* @param iMessage A code that indicates which message was sent.
* @param wParam One of the two free parameters for the message. Traditionally a word sized parameter
* (hence the w prefix).
* @param lParam The other of the two free parameters. A signed long.
*/
-sptr_t ScintillaCocoa::DirectFunction(ScintillaCocoa *sciThis, unsigned int iMessage, uptr_t wParam,
+sptr_t ScintillaCocoa::DirectFunction(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
sptr_t lParam)
{
- return sciThis->WndProc(iMessage, wParam, lParam);
+ return reinterpret_cast<ScintillaCocoa *>(ptr)->WndProc(iMessage, wParam, lParam);
}
//--------------------------------------------------------------------------------------------------