mirror of
https://github.com/weechat/weechat.git
synced 2026-07-06 17:53:13 +02:00
scripts: fix issue with long interval in function hook_timer
Affected plugins: python, ruby, lua, tcl, guile, javascript, php.
This commit is contained in:
@@ -2255,7 +2255,7 @@ weechat_guile_api_hook_timer (SCM interval, SCM align_second, SCM max_calls,
|
||||
|
||||
result = API_PTR2STR(plugin_script_api_hook_timer (weechat_guile_plugin,
|
||||
guile_current_script,
|
||||
scm_to_int (interval),
|
||||
scm_to_long (interval),
|
||||
scm_to_int (align_second),
|
||||
scm_to_int (max_calls),
|
||||
&weechat_guile_api_hook_timer_cb,
|
||||
|
||||
@@ -2148,10 +2148,11 @@ weechat_js_api_hook_timer_cb (const void *pointer, void *data,
|
||||
|
||||
API_FUNC(hook_timer)
|
||||
{
|
||||
int interval, align_second, max_calls;
|
||||
long interval;
|
||||
int align_second, max_calls;
|
||||
const char *result;
|
||||
|
||||
API_INIT_FUNC(1, "hook_timer", "iiiss", API_RETURN_EMPTY);
|
||||
API_INIT_FUNC(1, "hook_timer", "niiss", API_RETURN_EMPTY);
|
||||
|
||||
interval = args[0]->IntegerValue();
|
||||
align_second = args[1]->IntegerValue();
|
||||
|
||||
@@ -2361,7 +2361,8 @@ weechat_lua_api_hook_timer_cb (const void *pointer, void *data,
|
||||
|
||||
API_FUNC(hook_timer)
|
||||
{
|
||||
int interval, align_second, max_calls;
|
||||
long interval;
|
||||
int align_second, max_calls;
|
||||
const char *function, *data;
|
||||
const char *result;
|
||||
|
||||
|
||||
@@ -2376,7 +2376,8 @@ API_FUNC(hook_timer)
|
||||
zend_long z_interval, z_align_second, z_max_calls;
|
||||
zval *z_callback;
|
||||
zend_string *z_data;
|
||||
int interval, align_second, max_calls;
|
||||
long interval;
|
||||
int align_second, max_calls;
|
||||
char *data;
|
||||
const char *result;
|
||||
|
||||
@@ -2386,7 +2387,7 @@ API_FUNC(hook_timer)
|
||||
&z_data) == FAILURE)
|
||||
API_WRONG_ARGS(API_RETURN_EMPTY);
|
||||
|
||||
interval = (int)z_interval;
|
||||
interval = (long)z_interval;
|
||||
align_second = (int)z_align_second;
|
||||
max_calls = (int)z_max_calls;
|
||||
weechat_php_get_function_name (z_callback, callback_name);
|
||||
|
||||
@@ -523,7 +523,7 @@ plugin_script_api_hook_command_run (struct t_weechat_plugin *weechat_plugin,
|
||||
struct t_hook *
|
||||
plugin_script_api_hook_timer (struct t_weechat_plugin *weechat_plugin,
|
||||
struct t_plugin_script *script,
|
||||
int interval, int align_second, int max_calls,
|
||||
long interval, int align_second, int max_calls,
|
||||
int (*callback)(const void *pointer,
|
||||
void *data,
|
||||
int remaining_calls),
|
||||
|
||||
@@ -151,7 +151,7 @@ extern struct t_hook *plugin_script_api_hook_command_run (struct t_weechat_plugi
|
||||
const char *data);
|
||||
extern struct t_hook *plugin_script_api_hook_timer (struct t_weechat_plugin *weechat_plugin,
|
||||
struct t_plugin_script *script,
|
||||
int interval, int align_second,
|
||||
long interval, int align_second,
|
||||
int max_calls,
|
||||
int (*callback)(const void *pointer,
|
||||
void *data,
|
||||
|
||||
@@ -2264,7 +2264,8 @@ weechat_python_api_hook_timer_cb (const void *pointer, void *data,
|
||||
|
||||
API_FUNC(hook_timer)
|
||||
{
|
||||
int interval, align_second, max_calls;
|
||||
long interval;
|
||||
int align_second, max_calls;
|
||||
char *function, *data;
|
||||
const char *result;
|
||||
|
||||
@@ -2274,7 +2275,7 @@ API_FUNC(hook_timer)
|
||||
max_calls = 0;
|
||||
function = NULL;
|
||||
data = NULL;
|
||||
if (!PyArg_ParseTuple (args, "iiiss", &interval, &align_second, &max_calls,
|
||||
if (!PyArg_ParseTuple (args, "liiss", &interval, &align_second, &max_calls,
|
||||
&function, &data))
|
||||
API_WRONG_ARGS(API_RETURN_EMPTY);
|
||||
|
||||
|
||||
@@ -2782,7 +2782,8 @@ static VALUE
|
||||
weechat_ruby_api_hook_timer (VALUE class, VALUE interval, VALUE align_second,
|
||||
VALUE max_calls, VALUE function, VALUE data)
|
||||
{
|
||||
int c_interval, c_align_second, c_max_calls;
|
||||
long c_interval;
|
||||
int c_align_second, c_max_calls;
|
||||
char *c_function, *c_data;
|
||||
const char *result;
|
||||
|
||||
@@ -2797,7 +2798,7 @@ weechat_ruby_api_hook_timer (VALUE class, VALUE interval, VALUE align_second,
|
||||
Check_Type (function, T_STRING);
|
||||
Check_Type (data, T_STRING);
|
||||
|
||||
c_interval = NUM2INT (interval);
|
||||
c_interval = NUM2LONG (interval);
|
||||
c_align_second = NUM2INT (align_second);
|
||||
c_max_calls = NUM2INT (max_calls);
|
||||
c_function = StringValuePtr (function);
|
||||
|
||||
@@ -2554,13 +2554,14 @@ API_FUNC(hook_timer)
|
||||
{
|
||||
Tcl_Obj *objp;
|
||||
const char *result;
|
||||
int i, interval, align_second, max_calls;
|
||||
long interval;
|
||||
int i, align_second, max_calls;
|
||||
|
||||
API_INIT_FUNC(1, "hook_timer", API_RETURN_EMPTY);
|
||||
if (objc < 6)
|
||||
API_WRONG_ARGS(API_RETURN_EMPTY);
|
||||
|
||||
if ((Tcl_GetIntFromObj (interp, objv[1], &interval) != TCL_OK)
|
||||
if ((Tcl_GetLongFromObj (interp, objv[1], &interval) != TCL_OK)
|
||||
|| (Tcl_GetIntFromObj (interp, objv[2], &align_second) != TCL_OK)
|
||||
|| (Tcl_GetIntFromObj (interp, objv[3], &max_calls) != TCL_OK))
|
||||
API_WRONG_ARGS(API_RETURN_EMPTY);
|
||||
|
||||
Reference in New Issue
Block a user