diff options
author | TingPing <tngpng@gmail.com> | 2013-07-21 16:40:38 -0400 |
---|---|---|
committer | TingPing <tingping@tingping.se> | 2013-09-15 02:45:38 -0400 |
commit | 4721a3747ec5044c6bd2569108e1d153a0e1dc2f (patch) | |
tree | 10247405833b24712c382dea831362d308c4f345 /plugins | |
parent | e5cb69db5df42ba216317a03ee8d83175dd01c11 (diff) |
Python: return hooks with PyLong_FromVoidPtr
Fixes #685
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/python/python.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins/python/python.c b/plugins/python/python.c index eb38a344..90dbb22d 100644 --- a/plugins/python/python.c +++ b/plugins/python/python.c @@ -1924,7 +1924,7 @@ Module_hexchat_hook_command(PyObject *self, PyObject *args, PyObject *kwargs) Callback_Command, help, hook); END_XCHAT_CALLS(); - return PyLong_FromLong((long)hook); + return PyLong_FromVoidPtr(hook); } static PyObject * @@ -1960,7 +1960,7 @@ Module_hexchat_hook_server(PyObject *self, PyObject *args, PyObject *kwargs) Callback_Server, hook); END_XCHAT_CALLS(); - return PyLong_FromLong((long)hook); + return PyLong_FromVoidPtr(hook); } static PyObject * @@ -1996,7 +1996,7 @@ Module_hexchat_hook_server_attrs(PyObject *self, PyObject *args, PyObject *kwarg Callback_Server, hook); END_XCHAT_CALLS(); - return PyLong_FromLong((long)hook); + return PyLong_FromVoidPtr(hook); } static PyObject * @@ -2032,7 +2032,7 @@ Module_hexchat_hook_print(PyObject *self, PyObject *args, PyObject *kwargs) Callback_Print, hook); END_XCHAT_CALLS(); - return PyLong_FromLong((long)hook); + return PyLong_FromVoidPtr(hook); } static PyObject * @@ -2068,7 +2068,7 @@ Module_hexchat_hook_print_attrs(PyObject *self, PyObject *args, PyObject *kwargs Callback_Print, hook); END_XCHAT_CALLS(); - return PyLong_FromLong((long)hook); + return PyLong_FromVoidPtr(hook); } static PyObject * @@ -2103,7 +2103,7 @@ Module_hexchat_hook_timer(PyObject *self, PyObject *args, PyObject *kwargs) Callback_Timer, hook); END_XCHAT_CALLS(); - return PyLong_FromLong((long)hook); + return PyLong_FromVoidPtr(hook); } static PyObject * @@ -2131,7 +2131,7 @@ Module_hexchat_hook_unload(PyObject *self, PyObject *args, PyObject *kwargs) if (hook == NULL) return NULL; - return PyLong_FromLong((long)hook); + return PyLong_FromVoidPtr(hook); } static PyObject * @@ -2157,7 +2157,7 @@ Module_hexchat_unhook(PyObject *self, PyObject *args) } else { - hook = (Hook *)PyLong_AsLong(obj); + hook = (Hook *)PyLong_AsVoidPtr(obj); Plugin_RemoveHook(plugin, hook); } |