1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-05 01:03:14 +02:00

core: fix type of value returned by functions gui_chat_string_next_char, gui_chat_string_add_offset and gui_chat_string_add_offset_screen

This commit is contained in:
Sébastien Helleu
2015-07-04 16:32:18 +02:00
parent 23fd23fd1a
commit 0c79b2fda8
4 changed files with 18 additions and 20 deletions
+2 -3
View File
@@ -223,7 +223,7 @@ gui_chat_display_horizontal_line (struct t_gui_window *window, int simulate)
* colors/attributes are skipped and optionally applied.
*/
char *
const char *
gui_chat_string_next_char (struct t_gui_window *window, struct t_gui_line *line,
const unsigned char *string, int apply_style,
int apply_style_inactive,
@@ -1231,9 +1231,8 @@ gui_chat_display_line (struct t_gui_window *window, struct t_gui_line *line,
int read_marker_x, read_marker_y;
int word_start_offset, word_end_offset;
int word_length_with_spaces, word_length;
char *ptr_data, *ptr_end_offset;
char *message_with_tags, *message_with_search;
const char *ptr_style, *next_char;
const char *ptr_data, *ptr_end_offset, *ptr_style, *next_char;
struct t_gui_line *ptr_prev_line, *ptr_next_line;
struct tm local_time, local_time2;
struct timeval tv_time;
+5 -6
View File
@@ -197,7 +197,7 @@ gui_chat_strlen_screen (const char *string)
* colors/attributes).
*/
char *
const char *
gui_chat_string_add_offset (const char *string, int offset)
{
while (string && string[0] && (offset > 0))
@@ -211,7 +211,7 @@ gui_chat_string_add_offset (const char *string, int offset)
offset--;
}
}
return (char *)string;
return string;
}
/*
@@ -219,7 +219,7 @@ gui_chat_string_add_offset (const char *string, int offset)
* formatting chars (like colors/attributes).
*/
char *
const char *
gui_chat_string_add_offset_screen (const char *string, int offset_screen)
{
int size_on_screen;
@@ -236,7 +236,7 @@ gui_chat_string_add_offset_screen (const char *string, int offset_screen)
string = utf8_next_char (string);
}
}
return (char *)string;
return string;
}
/*
@@ -326,8 +326,7 @@ gui_chat_get_word_info (struct t_gui_window *window,
int *word_start_offset, int *word_end_offset,
int *word_length_with_spaces, int *word_length)
{
char *next_char;
const char *start_data, *next_char2;
const char *start_data, *next_char, *next_char2;
int leading_spaces, char_size_screen;
*word_start_offset = 0;
+9 -9
View File
@@ -67,9 +67,9 @@ extern void gui_chat_init ();
extern void gui_chat_prefix_build ();
extern int gui_chat_utf_char_valid (const char *utf_char);
extern int gui_chat_strlen_screen (const char *string);
extern char *gui_chat_string_add_offset (const char *string, int offset);
extern char *gui_chat_string_add_offset_screen (const char *string,
int offset_screen);
extern const char *gui_chat_string_add_offset (const char *string, int offset);
extern const char *gui_chat_string_add_offset_screen (const char *string,
int offset_screen);
extern int gui_chat_string_real_pos (const char *string, int pos,
int use_screen_size);
extern int gui_chat_string_pos (const char *string, int real_pos);
@@ -95,12 +95,12 @@ extern void gui_chat_end ();
/* chat functions (GUI dependent) */
extern char *gui_chat_string_next_char (struct t_gui_window *window,
struct t_gui_line *line,
const unsigned char *string,
int apply_style,
int apply_style_inactive,
int nick_offline);
extern const char *gui_chat_string_next_char (struct t_gui_window *window,
struct t_gui_line *line,
const unsigned char *string,
int apply_style,
int apply_style_inactive,
int nick_offline);
extern void gui_chat_draw (struct t_gui_buffer *buffer, int clear_chat);
extern void gui_chat_draw_line (struct t_gui_buffer *buffer,
struct t_gui_line *line);
+2 -2
View File
@@ -140,8 +140,8 @@ gui_window_get_context_at_xy (struct t_gui_window *window,
char **end)
{
int win_x, win_y;
char *ptr_data, *data_next_line, *str_temp;
const char *word_start, *word_end, *last_space;
char *data_next_line, *str_temp;
const char *ptr_data, *word_start, *word_end, *last_space;
*chat = 0;
*line = NULL;