diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2018-08-14 14:51:18 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2018-08-14 14:51:18 +0200 |
commit | 3bdab1c5381cc190b7c5ebc396f2f5a6f90fdb87 (patch) | |
tree | 74b23b4b57331e5e68115c323bd6e244857cf72c | |
parent | 49c3e6210666f271d1c87115c091b54e4f35ae53 (diff) | |
download | weechat-3bdab1c5381cc190b7c5ebc396f2f5a6f90fdb87.zip |
core: fix type of variables "buffer_name" and "buffer_type" sent to the hook_line callback
-rw-r--r-- | src/core/hook/wee-hook-line.c | 6 | ||||
-rw-r--r-- | src/core/wee-hashtable.h | 2 | ||||
-rw-r--r-- | src/gui/gui-focus.c | 10 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/core/hook/wee-hook-line.c b/src/core/hook/wee-hook-line.c index f08813cac..d65fb5e6d 100644 --- a/src/core/hook/wee-hook-line.c +++ b/src/core/hook/wee-hook-line.c @@ -131,9 +131,9 @@ hook_line_exec (struct t_gui_line *line) if (!hashtable) break; } - HASHTABLE_SET_PTR("buffer", line->data->buffer); - HASHTABLE_SET_PTR("buffer_name", line->data->buffer->full_name); - HASHTABLE_SET_PTR("buffer_type", + HASHTABLE_SET_POINTER("buffer", line->data->buffer); + HASHTABLE_SET_STR("buffer_name", line->data->buffer->full_name); + HASHTABLE_SET_STR("buffer_type", gui_buffer_type_string[line->data->buffer->type]); HASHTABLE_SET_INT("y", line->data->y); HASHTABLE_SET_TIME("date", line->data->date); diff --git a/src/core/wee-hashtable.h b/src/core/wee-hashtable.h index bc497bbf3..27627412e 100644 --- a/src/core/wee-hashtable.h +++ b/src/core/wee-hashtable.h @@ -40,7 +40,7 @@ struct t_infolist_item; #define HASHTABLE_SET_TIME(__name, __time) \ snprintf (str_value, sizeof (str_value), "%lld", (long long)__time); \ hashtable_set (hashtable, __name, str_value); -#define HASHTABLE_SET_PTR(__name, __pointer) \ +#define HASHTABLE_SET_POINTER(__name, __pointer) \ if (__pointer) \ { \ snprintf (str_value, sizeof (str_value), \ diff --git a/src/gui/gui-focus.c b/src/gui/gui-focus.c index 8028ccfba..9c48cd73e 100644 --- a/src/gui/gui-focus.c +++ b/src/gui/gui-focus.c @@ -161,7 +161,7 @@ gui_focus_to_hashtable (struct t_gui_focus_info *focus_info, const char *key) HASHTABLE_SET_INT("_y", focus_info->y); /* window */ - HASHTABLE_SET_PTR("_window", focus_info->window); + HASHTABLE_SET_POINTER("_window", focus_info->window); if (focus_info->window) { HASHTABLE_SET_INT("_window_number", (focus_info->window)->number); @@ -172,7 +172,7 @@ gui_focus_to_hashtable (struct t_gui_focus_info *focus_info, const char *key) } /* buffer */ - HASHTABLE_SET_PTR("_buffer", focus_info->buffer); + HASHTABLE_SET_POINTER("_buffer", focus_info->buffer); if (focus_info->buffer) { HASHTABLE_SET_INT("_buffer_number", (focus_info->buffer)->number); @@ -184,7 +184,7 @@ gui_focus_to_hashtable (struct t_gui_focus_info *focus_info, const char *key) } else { - HASHTABLE_SET_PTR("_buffer", NULL); + HASHTABLE_SET_POINTER("_buffer", NULL); HASHTABLE_SET_STR("_buffer_number", "-1"); HASHTABLE_SET_STR("_buffer_plugin", ""); HASHTABLE_SET_STR("_buffer_name", ""); @@ -202,7 +202,7 @@ gui_focus_to_hashtable (struct t_gui_focus_info *focus_info, const char *key) str_tags = string_build_with_split_string ((const char **)((focus_info->chat_line)->data)->tags_array, ","); str_message = gui_color_decode (((focus_info->chat_line)->data)->message, NULL); nick = gui_line_get_nick_tag (focus_info->chat_line); - HASHTABLE_SET_PTR("_chat_line", focus_info->chat_line); + HASHTABLE_SET_POINTER("_chat_line", focus_info->chat_line); HASHTABLE_SET_INT("_chat_line_x", focus_info->chat_line_x); HASHTABLE_SET_INT("_chat_line_y", ((focus_info->chat_line)->data)->y); HASHTABLE_SET_TIME("_chat_line_date", ((focus_info->chat_line)->data)->date); @@ -223,7 +223,7 @@ gui_focus_to_hashtable (struct t_gui_focus_info *focus_info, const char *key) } else { - HASHTABLE_SET_PTR("_chat_line", NULL); + HASHTABLE_SET_POINTER("_chat_line", NULL); HASHTABLE_SET_STR("_chat_line_x", "-1"); HASHTABLE_SET_STR("_chat_line_y", "-1"); HASHTABLE_SET_STR("_chat_line_date", "-1"); |