From aeeec38d6f0f90243199f2dbd96cc5261f329f0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sat, 12 Aug 2017 18:36:45 +0200 Subject: core: fix cast of time_t (to "long long" instead of "long") (closes #1051) --- src/core/wee-eval.c | 4 ++-- src/core/wee-hashtable.c | 4 ++-- src/core/wee-hook.c | 8 +++---- src/core/wee-infolist.c | 2 +- src/gui/gui-focus.c | 32 +++++++++++++-------------- src/plugins/buflist/buflist-mouse.c | 6 ++--- src/plugins/exec/exec.c | 4 ++-- src/plugins/guile/weechat-guile-api.c | 2 +- src/plugins/irc/irc-channel.c | 4 ++-- src/plugins/irc/irc-command.c | 4 ++-- src/plugins/irc/irc-redirect.c | 2 +- src/plugins/irc/irc-server.c | 18 +++++++-------- src/plugins/lua/weechat-lua-api.c | 2 +- src/plugins/perl/weechat-perl-api.c | 2 +- src/plugins/plugin-api.c | 4 ++-- src/plugins/python/weechat-python-api.c | 2 +- src/plugins/relay/relay-client.c | 8 +++---- src/plugins/relay/relay-server.c | 4 ++-- src/plugins/relay/weechat/relay-weechat-msg.c | 2 +- src/plugins/ruby/weechat-ruby-api.c | 2 +- src/plugins/script/script-repo.c | 4 ++-- src/plugins/tcl/weechat-tcl-api.c | 2 +- src/plugins/xfer/xfer.c | 8 +++---- 23 files changed, 65 insertions(+), 65 deletions(-) (limited to 'src') diff --git a/src/core/wee-eval.c b/src/core/wee-eval.c index c6d5b246d..e65fac78a 100644 --- a/src/core/wee-eval.c +++ b/src/core/wee-eval.c @@ -216,7 +216,7 @@ eval_hdata_get_value (struct t_hdata *hdata, void *pointer, const char *path) break; case WEECHAT_HDATA_TIME: snprintf (str_value, sizeof (str_value), - "%ld", (long)hdata_time (hdata, pointer, var_name)); + "%lld", (long long)hdata_time (hdata, pointer, var_name)); value = strdup (str_value); break; case WEECHAT_HDATA_HASHTABLE: @@ -249,7 +249,7 @@ eval_hdata_get_value (struct t_hdata *hdata, void *pointer, const char *path) break; case HASHTABLE_TIME: snprintf (str_value, sizeof (str_value), - "%ld", (long)(*((time_t *)ptr_value))); + "%lld", (long long)(*((time_t *)ptr_value))); value = strdup (str_value); break; case HASHTABLE_NUM_TYPES: diff --git a/src/core/wee-hashtable.c b/src/core/wee-hashtable.c index 15ebd14c4..e4df2356d 100644 --- a/src/core/wee-hashtable.c +++ b/src/core/wee-hashtable.c @@ -554,7 +554,7 @@ hashtable_to_string (enum t_hashtable_type type, const void *value) break; case HASHTABLE_TIME: snprintf (str_value, sizeof (str_value), - "%ld", (long)(*((time_t *)value))); + "%lld", (long long)(*((time_t *)value))); return str_value; break; case HASHTABLE_NUM_TYPES: @@ -1235,7 +1235,7 @@ hashtable_print_log (struct t_hashtable *hashtable, const char *name) log_printf (" key (buffer) . . . : 0x%lx", ptr_item->key); break; case HASHTABLE_TIME: - log_printf (" key (time) . . . . : %ld", *((time_t *)ptr_item->key)); + log_printf (" key (time) . . . . : %lld", (long long)(*((time_t *)ptr_item->key))); break; case HASHTABLE_NUM_TYPES: break; diff --git a/src/core/wee-hook.c b/src/core/wee-hook.c index e3f617444..420b33505 100644 --- a/src/core/wee-hook.c +++ b/src/core/wee-hook.c @@ -4807,8 +4807,8 @@ hook_print_log () strftime (text_time, sizeof (text_time), "%d/%m/%Y %H:%M:%S", local_time); } - log_printf (" last_exec.tv_sec. . . : %ld (%s)", - HOOK_TIMER(ptr_hook, last_exec.tv_sec), + log_printf (" last_exec.tv_sec. . . : %lld (%s)", + (long long)(HOOK_TIMER(ptr_hook, last_exec.tv_sec)), text_time); log_printf (" last_exec.tv_usec . . : %ld", HOOK_TIMER(ptr_hook, last_exec.tv_usec)); text_time[0] = '\0'; @@ -4819,8 +4819,8 @@ hook_print_log () strftime (text_time, sizeof (text_time), "%d/%m/%Y %H:%M:%S", local_time); } - log_printf (" next_exec.tv_sec. . . : %ld (%s)", - HOOK_TIMER(ptr_hook, next_exec.tv_sec), + log_printf (" next_exec.tv_sec. . . : %lld (%s)", + (long long)(HOOK_TIMER(ptr_hook, next_exec.tv_sec)), text_time); log_printf (" next_exec.tv_usec . . : %ld", HOOK_TIMER(ptr_hook, next_exec.tv_usec)); break; diff --git a/src/core/wee-infolist.c b/src/core/wee-infolist.c index bf393e11c..11bada9c1 100644 --- a/src/core/wee-infolist.c +++ b/src/core/wee-infolist.c @@ -770,7 +770,7 @@ infolist_print_log () log_printf (" size of buffer . . . : %d", ptr_var->size); break; case INFOLIST_TIME: - log_printf (" value (time) . . . . : %ld", *((time_t *)ptr_var->value)); + log_printf (" value (time) . . . . : %lld", (long long)(*((time_t *)ptr_var->value))); break; } log_printf (" prev_var . . . . . . : 0x%lx", ptr_var->prev_var); diff --git a/src/gui/gui-focus.c b/src/gui/gui-focus.c index 7a14d63e6..525df1cdc 100644 --- a/src/gui/gui-focus.c +++ b/src/gui/gui-focus.c @@ -39,26 +39,26 @@ #include "gui-window.h" -#define FOCUS_STR(__name, __string) \ +#define FOCUS_STR(__name, __string) \ hashtable_set (hashtable, __name, __string); -#define FOCUS_STR_VAR(__name, __var) \ +#define FOCUS_STR_VAR(__name, __var) \ hashtable_set (hashtable, __name, (__var) ? __var : ""); -#define FOCUS_INT(__name, __int) \ - snprintf (str_value, sizeof (str_value), "%d", __int); \ +#define FOCUS_INT(__name, __int) \ + snprintf (str_value, sizeof (str_value), "%d", __int); \ hashtable_set (hashtable, __name, str_value); -#define FOCUS_TIME(__name, __time) \ - snprintf (str_value, sizeof (str_value), "%ld", (long)__time); \ +#define FOCUS_TIME(__name, __time) \ + snprintf (str_value, sizeof (str_value), "%lld", (long long)__time); \ hashtable_set (hashtable, __name, str_value); -#define FOCUS_PTR(__name, __pointer) \ - if (__pointer) \ - { \ - snprintf (str_value, sizeof (str_value), \ - "0x%lx", (long unsigned int)__pointer); \ - hashtable_set (hashtable, __name, str_value); \ - } \ - else \ - { \ - hashtable_set (hashtable, __name, ""); \ +#define FOCUS_PTR(__name, __pointer) \ + if (__pointer) \ + { \ + snprintf (str_value, sizeof (str_value), \ + "0x%lx", (long unsigned int)__pointer); \ + hashtable_set (hashtable, __name, str_value); \ + } \ + else \ + { \ + hashtable_set (hashtable, __name, ""); \ } diff --git a/src/plugins/buflist/buflist-mouse.c b/src/plugins/buflist/buflist-mouse.c index c574edb59..546db17ec 100644 --- a/src/plugins/buflist/buflist-mouse.c +++ b/src/plugins/buflist/buflist-mouse.c @@ -128,10 +128,10 @@ end: break; case WEECHAT_HDATA_TIME: snprintf (str_value, sizeof (str_value), - "%ld", + "%lld", (ptr_buffer) ? - (long int)weechat_hdata_time (buflist_hdata_buffer, - ptr_buffer, list_keys[i]) : -1); + (long long)weechat_hdata_time (buflist_hdata_buffer, + ptr_buffer, list_keys[i]) : -1); weechat_hashtable_set (info, list_keys[i], str_value); break; default: /* ignore other types */ diff --git a/src/plugins/exec/exec.c b/src/plugins/exec/exec.c index aae525011..e01da0bbe 100644 --- a/src/plugins/exec/exec.c +++ b/src/plugins/exec/exec.c @@ -691,8 +691,8 @@ exec_print_log () weechat_log_printf (" command . . . . . . . . . : '%s'", ptr_exec_cmd->command); weechat_log_printf (" pid . . . . . . . . . . . : %d", ptr_exec_cmd->pid); weechat_log_printf (" detached. . . . . . . . . : %d", ptr_exec_cmd->detached); - weechat_log_printf (" start_time. . . . . . . . : %ld", ptr_exec_cmd->start_time); - weechat_log_printf (" end_time. . . . . . . . . : %ld", ptr_exec_cmd->end_time); + weechat_log_printf (" start_time. . . . . . . . : %lld", (long long)ptr_exec_cmd->start_time); + weechat_log_printf (" end_time. . . . . . . . . : %lld", (long long)ptr_exec_cmd->end_time); weechat_log_printf (" output_to_buffer. . . . . : %d", ptr_exec_cmd->output_to_buffer); weechat_log_printf (" output_to_buffer_exec_cmd : %d", ptr_exec_cmd->output_to_buffer_exec_cmd); weechat_log_printf (" buffer_full_name. . . . . : '%s'", ptr_exec_cmd->buffer_full_name); diff --git a/src/plugins/guile/weechat-guile-api.c b/src/plugins/guile/weechat-guile-api.c index 2842b39ae..6aefa3bd2 100644 --- a/src/plugins/guile/weechat-guile-api.c +++ b/src/plugins/guile/weechat-guile-api.c @@ -2487,7 +2487,7 @@ weechat_guile_api_hook_print_cb (const void *pointer, void *data, if (ptr_function && ptr_function[0]) { - snprintf (timebuffer, sizeof (timebuffer), "%ld", (long int)date); + snprintf (timebuffer, sizeof (timebuffer), "%lld", (long long)date); func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; func_argv[1] = API_PTR2STR(buffer); diff --git a/src/plugins/irc/irc-channel.c b/src/plugins/irc/irc-channel.c index 72bfaeeab..80c182cf0 100644 --- a/src/plugins/irc/irc-channel.c +++ b/src/plugins/irc/irc-channel.c @@ -1686,9 +1686,9 @@ irc_channel_print_log (struct t_irc_channel *channel) ptr_nick_speaking; ptr_nick_speaking = ptr_nick_speaking->next_nick) { - weechat_log_printf (" nick speaking time: '%s', time: %ld", + weechat_log_printf (" nick speaking time: '%s', time: %lld", ptr_nick_speaking->nick, - ptr_nick_speaking->time_last_message); + (long long)ptr_nick_speaking->time_last_message); } } for (ptr_nick = channel->nicks; ptr_nick; ptr_nick = ptr_nick->next_nick) diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c index 3741687b2..c43a7a362 100644 --- a/src/plugins/irc/irc-command.c +++ b/src/plugins/irc/irc-command.c @@ -1526,8 +1526,8 @@ IRC_COMMAND_CALLBACK(ctcp) { /* generate argument for PING if not provided */ gettimeofday (&tv, NULL); - snprintf (str_time, sizeof (str_time), "%ld %ld", - (long)tv.tv_sec, (long)tv.tv_usec); + snprintf (str_time, sizeof (str_time), "%lld %ld", + (long long)tv.tv_sec, (long)tv.tv_usec); ctcp_args = str_time; } else diff --git a/src/plugins/irc/irc-redirect.c b/src/plugins/irc/irc-redirect.c index 44648a00d..744b29e0d 100644 --- a/src/plugins/irc/irc-redirect.c +++ b/src/plugins/irc/irc-redirect.c @@ -1209,7 +1209,7 @@ irc_redirect_print_log (struct t_irc_server *server) weechat_log_printf (" timeout . . . . . . : %d", ptr_redirect->timeout); weechat_log_printf (" command . . . . . . : '%s'", ptr_redirect->command); weechat_log_printf (" assigned_to_command : %d", ptr_redirect->assigned_to_command); - weechat_log_printf (" start_time. . . . . : %ld", ptr_redirect->start_time); + weechat_log_printf (" start_time. . . . . : %lld", (long long)ptr_redirect->start_time); weechat_log_printf (" cmd_start . . . . . : 0x%lx (hashtable: '%s')", ptr_redirect->cmd_start, weechat_hashtable_get_string (ptr_redirect->cmd_start, "keys_values")); diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c index 30f75d32f..013c22466 100644 --- a/src/plugins/irc/irc-server.c +++ b/src/plugins/irc/irc-server.c @@ -6061,26 +6061,26 @@ irc_server_print_log () weechat_log_printf (" chantypes. . . . . . : '%s'", ptr_server->chantypes); weechat_log_printf (" chanmodes. . . . . . : '%s'", ptr_server->chanmodes); weechat_log_printf (" monitor. . . . . . . : %d", ptr_server->monitor); - weechat_log_printf (" monitor_time . . . . : %ld", ptr_server->monitor_time); + weechat_log_printf (" monitor_time . . . . : %lld", (long long)ptr_server->monitor_time); weechat_log_printf (" reconnect_delay. . . : %d", ptr_server->reconnect_delay); - weechat_log_printf (" reconnect_start. . . : %ld", ptr_server->reconnect_start); - weechat_log_printf (" command_time . . . . : %ld", ptr_server->command_time); + weechat_log_printf (" reconnect_start. . . : %lld", (long long)ptr_server->reconnect_start); + weechat_log_printf (" command_time . . . . : %lld", (long long)ptr_server->command_time); weechat_log_printf (" reconnect_join . . . : %d", ptr_server->reconnect_join); weechat_log_printf (" disable_autojoin . . : %d", ptr_server->disable_autojoin); weechat_log_printf (" is_away. . . . . . . : %d", ptr_server->is_away); weechat_log_printf (" away_message . . . . : '%s'", ptr_server->away_message); - weechat_log_printf (" away_time. . . . . . : %ld", ptr_server->away_time); + weechat_log_printf (" away_time. . . . . . : %lld", (long long)ptr_server->away_time); weechat_log_printf (" lag. . . . . . . . . : %d", ptr_server->lag); weechat_log_printf (" lag_displayed. . . . : %d", ptr_server->lag_displayed); weechat_log_printf (" lag_check_time . . . : tv_sec:%d, tv_usec:%d", ptr_server->lag_check_time.tv_sec, ptr_server->lag_check_time.tv_usec); - weechat_log_printf (" lag_next_check . . . : %ld", ptr_server->lag_next_check); - weechat_log_printf (" lag_last_refresh . . : %ld", ptr_server->lag_last_refresh); + weechat_log_printf (" lag_next_check . . . : %lld", (long long)ptr_server->lag_next_check); + weechat_log_printf (" lag_last_refresh . . : %lld", (long long)ptr_server->lag_last_refresh); weechat_log_printf (" cmd_list_regexp. . . : 0x%lx", ptr_server->cmd_list_regexp); - weechat_log_printf (" last_user_message. . : %ld", ptr_server->last_user_message); - weechat_log_printf (" last_away_check. . . : %ld", ptr_server->last_away_check); - weechat_log_printf (" last_data_purge. . . : %ld", ptr_server->last_data_purge); + weechat_log_printf (" last_user_message. . : %lld", (long long)ptr_server->last_user_message); + weechat_log_printf (" last_away_check. . . : %lld", (long long)ptr_server->last_away_check); + weechat_log_printf (" last_data_purge. . . : %lld", (long long)ptr_server->last_data_purge); for (i = 0; i < IRC_SERVER_NUM_OUTQUEUES_PRIO; i++) { weechat_log_printf (" outqueue[%02d] . . . . : 0x%lx", i, ptr_server->outqueue[i]); diff --git a/src/plugins/lua/weechat-lua-api.c b/src/plugins/lua/weechat-lua-api.c index c09f09676..a8d07e5bd 100644 --- a/src/plugins/lua/weechat-lua-api.c +++ b/src/plugins/lua/weechat-lua-api.c @@ -2609,7 +2609,7 @@ weechat_lua_api_hook_print_cb (const void *pointer, void *data, if (ptr_function && ptr_function[0]) { - snprintf (timebuffer, sizeof (timebuffer), "%ld", (long int)date); + snprintf (timebuffer, sizeof (timebuffer), "%lld", (long long)date); func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; func_argv[1] = API_PTR2STR(buffer); diff --git a/src/plugins/perl/weechat-perl-api.c b/src/plugins/perl/weechat-perl-api.c index 8e7b19569..084400f71 100644 --- a/src/plugins/perl/weechat-perl-api.c +++ b/src/plugins/perl/weechat-perl-api.c @@ -2523,7 +2523,7 @@ weechat_perl_api_hook_print_cb (const void *pointer, void *data, if (ptr_function && ptr_function[0]) { - snprintf (timebuffer, sizeof (timebuffer), "%ld", (long int)date); + snprintf (timebuffer, sizeof (timebuffer), "%lld", (long long)date); func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; func_argv[1] = API_PTR2STR(buffer); diff --git a/src/plugins/plugin-api.c b/src/plugins/plugin-api.c index a7fe2c771..686557562 100644 --- a/src/plugins/plugin-api.c +++ b/src/plugins/plugin-api.c @@ -643,7 +643,7 @@ plugin_api_info_inactivity_cb (const void *pointer, void *data, inactivity = 0; else inactivity = time (NULL) - gui_key_last_activity_time; - snprintf (value, sizeof (value), "%ld", (long int)inactivity); + snprintf (value, sizeof (value), "%lld", (long long)inactivity); return value; } @@ -890,7 +890,7 @@ plugin_api_info_uptime_cb (const void *pointer, void *data, { /* return the number of seconds */ util_get_uptime (&total_seconds, NULL, NULL, NULL, NULL); - snprintf (value, sizeof (value), "%ld", (long)total_seconds); + snprintf (value, sizeof (value), "%lld", (long long)total_seconds); return value; } diff --git a/src/plugins/python/weechat-python-api.c b/src/plugins/python/weechat-python-api.c index 93e932a31..cddaf1691 100644 --- a/src/plugins/python/weechat-python-api.c +++ b/src/plugins/python/weechat-python-api.c @@ -2544,7 +2544,7 @@ weechat_python_api_hook_print_cb (const void *pointer, void *data, if (ptr_function && ptr_function[0]) { - snprintf (timebuffer, sizeof (timebuffer), "%ld", (long int)date); + snprintf (timebuffer, sizeof (timebuffer), "%lld", (long long)date); func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; func_argv[1] = API_PTR2STR(buffer); diff --git a/src/plugins/relay/relay-client.c b/src/plugins/relay/relay-client.c index a334db02c..b69c9a5e3 100644 --- a/src/plugins/relay/relay-client.c +++ b/src/plugins/relay/relay-client.c @@ -1784,11 +1784,11 @@ relay_client_print_log () relay_protocol_string[ptr_client->protocol]); weechat_log_printf (" protocol_string . . . : '%s'", ptr_client->protocol_string); weechat_log_printf (" protocol_args . . . . : '%s'", ptr_client->protocol_args); - weechat_log_printf (" listen_start_time . . : %ld", ptr_client->listen_start_time); - weechat_log_printf (" start_time. . . . . . : %ld", ptr_client->start_time); - weechat_log_printf (" end_time. . . . . . . : %ld", ptr_client->end_time); + weechat_log_printf (" listen_start_time . . : %lld", (long long)ptr_client->listen_start_time); + weechat_log_printf (" start_time. . . . . . : %lld", (long long)ptr_client->start_time); + weechat_log_printf (" end_time. . . . . . . : %lld", (long long)ptr_client->end_time); weechat_log_printf (" hook_fd . . . . . . . : 0x%lx", ptr_client->hook_fd); - weechat_log_printf (" last_activity . . . . : %ld", ptr_client->last_activity); + weechat_log_printf (" last_activity . . . . : %lld", (long long)ptr_client->last_activity); weechat_log_printf (" bytes_recv. . . . . . : %llu", ptr_client->bytes_recv); weechat_log_printf (" bytes_sent. . . . . . : %llu", ptr_client->bytes_sent); weechat_log_printf (" recv_data_type. . . . : %d (%s)", diff --git a/src/plugins/relay/relay-server.c b/src/plugins/relay/relay-server.c index be377e383..f0f9c7375 100644 --- a/src/plugins/relay/relay-server.c +++ b/src/plugins/relay/relay-server.c @@ -761,8 +761,8 @@ relay_server_print_log () weechat_log_printf (" ssl . . . . . . . . . : %d", ptr_server->ssl); weechat_log_printf (" sock. . . . . . . . . : %d", ptr_server->sock); weechat_log_printf (" hook_fd . . . . . . . : 0x%lx", ptr_server->hook_fd); - weechat_log_printf (" start_time. . . . . . : %ld", ptr_server->start_time); - weechat_log_printf (" last_client_disconnect: %ld", ptr_server->last_client_disconnect); + weechat_log_printf (" start_time. . . . . . : %lld", (long long)ptr_server->start_time); + weechat_log_printf (" last_client_disconnect: %lld", (long long)ptr_server->last_client_disconnect); weechat_log_printf (" prev_server . . . . . : 0x%lx", ptr_server->prev_server); weechat_log_printf (" next_server . . . . . : 0x%lx", ptr_server->next_server); } diff --git a/src/plugins/relay/weechat/relay-weechat-msg.c b/src/plugins/relay/weechat/relay-weechat-msg.c index 305823528..420f6c704 100644 --- a/src/plugins/relay/weechat/relay-weechat-msg.c +++ b/src/plugins/relay/weechat/relay-weechat-msg.c @@ -242,7 +242,7 @@ relay_weechat_msg_add_time (struct t_relay_weechat_msg *msg, time_t time) char str_time[128]; unsigned char length; - snprintf (str_time, sizeof (str_time), "%ld", (long)time); + snprintf (str_time, sizeof (str_time), "%lld", (long long)time); length = strlen (str_time); relay_weechat_msg_add_bytes (msg, &length, 1); relay_weechat_msg_add_bytes (msg, str_time, length); diff --git a/src/plugins/ruby/weechat-ruby-api.c b/src/plugins/ruby/weechat-ruby-api.c index 639ec9eca..8a819e622 100644 --- a/src/plugins/ruby/weechat-ruby-api.c +++ b/src/plugins/ruby/weechat-ruby-api.c @@ -3070,7 +3070,7 @@ weechat_ruby_api_hook_print_cb (const void *pointer, void *data, if (ptr_function && ptr_function[0]) { - snprintf (timebuffer, sizeof (timebuffer), "%ld", (long int)date); + snprintf (timebuffer, sizeof (timebuffer), "%lld", (long long)date); func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; func_argv[1] = API_PTR2STR(buffer); diff --git a/src/plugins/script/script-repo.c b/src/plugins/script/script-repo.c index 4e2f8398e..4912bd50a 100644 --- a/src/plugins/script/script-repo.c +++ b/src/plugins/script/script-repo.c @@ -1657,8 +1657,8 @@ script_repo_print_log () weechat_log_printf (" md5sum. . . . . . . . : '%s'", ptr_script->md5sum); weechat_log_printf (" url . . . . . . . . . : '%s'", ptr_script->url); weechat_log_printf (" popularity. . . . . . : %d", ptr_script->popularity); - weechat_log_printf (" date_added. . . . . . : %ld", ptr_script->date_added); - weechat_log_printf (" date_updated. . . . . : %ld", ptr_script->date_updated); + weechat_log_printf (" date_added. . . . . . : %lld", (long long)ptr_script->date_added); + weechat_log_printf (" date_updated. . . . . : %lld", (long long)ptr_script->date_updated); weechat_log_printf (" status. . . . . . . . : %d (%s%s%s%s%s )", ptr_script->status, (ptr_script->status & SCRIPT_STATUS_INSTALLED) ? " installed": "", diff --git a/src/plugins/tcl/weechat-tcl-api.c b/src/plugins/tcl/weechat-tcl-api.c index a7de9b353..dab21c51e 100644 --- a/src/plugins/tcl/weechat-tcl-api.c +++ b/src/plugins/tcl/weechat-tcl-api.c @@ -2795,7 +2795,7 @@ weechat_tcl_api_hook_print_cb (const void *pointer, void *data, if (ptr_function && ptr_function[0]) { - snprintf (timebuffer, sizeof (timebuffer), "%ld", (long int)date); + snprintf (timebuffer, sizeof (timebuffer), "%lld", (long long)date); func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; func_argv[1] = API_PTR2STR(buffer); diff --git a/src/plugins/xfer/xfer.c b/src/plugins/xfer/xfer.c index 896924bf6..f107e87da 100644 --- a/src/plugins/xfer/xfer.c +++ b/src/plugins/xfer/xfer.c @@ -1726,8 +1726,8 @@ xfer_print_log () weechat_log_printf (" remote_nick_color . . . : '%s'", ptr_xfer->remote_nick_color); weechat_log_printf (" fast_send . . . . . . . : %d", ptr_xfer->fast_send); weechat_log_printf (" blocksize . . . . . . . : %d", ptr_xfer->blocksize); - weechat_log_printf (" start_time. . . . . . . : %ld", ptr_xfer->start_time); - weechat_log_printf (" start_transfer. . . . . : %ld", ptr_xfer->start_transfer); + weechat_log_printf (" start_time. . . . . . . : %lld", (long long)ptr_xfer->start_time); + weechat_log_printf (" start_transfer. . . . . : %lld", (long long)ptr_xfer->start_transfer); weechat_log_printf (" sock. . . . . . . . . . : %d", ptr_xfer->sock); weechat_log_printf (" child_pid . . . . . . . : %d", ptr_xfer->child_pid); weechat_log_printf (" child_read. . . . . . . : %d", ptr_xfer->child_read); @@ -1742,9 +1742,9 @@ xfer_print_log () weechat_log_printf (" pos . . . . . . . . . . : %llu", ptr_xfer->pos); weechat_log_printf (" ack . . . . . . . . . . : %llu", ptr_xfer->ack); weechat_log_printf (" start_resume. . . . . . : %llu", ptr_xfer->start_resume); - weechat_log_printf (" last_check_time . . . . : %ld", ptr_xfer->last_check_time); + weechat_log_printf (" last_check_time . . . . : %lld", (long long)ptr_xfer->last_check_time); weechat_log_printf (" last_check_pos. . . . . : %llu", ptr_xfer->last_check_pos); - weechat_log_printf (" last_activity . . . . . : %ld", ptr_xfer->last_activity); + weechat_log_printf (" last_activity . . . . . : %lld", (long long)ptr_xfer->last_activity); weechat_log_printf (" bytes_per_sec . . . . . : %llu", ptr_xfer->bytes_per_sec); weechat_log_printf (" eta . . . . . . . . . . : %llu", ptr_xfer->eta); weechat_log_printf (" hash_target . . . . . . : '%s'", ptr_xfer->hash_target); -- cgit v1.2.3