mirror of
https://github.com/weechat/weechat.git
synced 2026-07-05 09:13:14 +02:00
api: fix type of value returned by functions utf8_prev_char, utf8_next_char and utf8_add_offset
This commit is contained in:
+4
-2
@@ -422,7 +422,8 @@ hook_command_build_completion (struct t_hook_command *hook_command)
|
||||
int i, j, k, length, num_items;
|
||||
struct t_weelist *list;
|
||||
char *pos_completion, *pos_double_pipe, *pos_start, *pos_end;
|
||||
char **items, *last_space, *ptr_template;
|
||||
char **items;
|
||||
const char *last_space, *ptr_template;
|
||||
|
||||
/* split templates using "||" as separator */
|
||||
hook_command->cplt_num_templates = 1;
|
||||
@@ -673,7 +674,8 @@ hook_command_exec (struct t_gui_buffer *buffer, int any_plugin,
|
||||
struct t_hook *ptr_hook, *next_hook;
|
||||
struct t_hook *hook_plugin, *hook_other_plugin, *hook_other_plugin2;
|
||||
struct t_hook *hook_incomplete_command;
|
||||
char **argv, **argv_eol, *ptr_command_name;
|
||||
char **argv, **argv_eol;
|
||||
const char *ptr_command_name;
|
||||
int argc, rc, length_command_name, allow_incomplete_commands;
|
||||
int count_other_plugin, count_incomplete_commands;
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ string_tolower (char *string)
|
||||
{
|
||||
if ((string[0] >= 'A') && (string[0] <= 'Z'))
|
||||
string[0] += ('a' - 'A');
|
||||
string = utf8_next_char (string);
|
||||
string = (char *)utf8_next_char (string);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ string_toupper (char *string)
|
||||
{
|
||||
if ((string[0] >= 'a') && (string[0] <= 'z'))
|
||||
string[0] -= ('a' - 'A');
|
||||
string = utf8_next_char (string);
|
||||
string = (char *)utf8_next_char (string);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1851,7 +1851,7 @@ string_split_shell (const char *string, int *num_items)
|
||||
{
|
||||
add_char_to_temp = 0;
|
||||
add_temp_to_args = 0;
|
||||
ptr_next = utf8_next_char (ptr_string);
|
||||
ptr_next = (char *)utf8_next_char (ptr_string);
|
||||
saved_char = ptr_next[0];
|
||||
ptr_next[0] = '\0';
|
||||
if (state == ' ')
|
||||
@@ -2180,8 +2180,8 @@ string_iconv (int from_utf8, const char *from_code, const char *to_code,
|
||||
|
||||
#ifdef HAVE_ICONV
|
||||
iconv_t cd;
|
||||
char *inbuf, *ptr_inbuf, *ptr_outbuf, *next_char;
|
||||
char *ptr_inbuf_shift;
|
||||
char *inbuf, *ptr_outbuf;
|
||||
const char *ptr_inbuf, *ptr_inbuf_shift, *next_char;
|
||||
int done;
|
||||
size_t err, inbytesleft, outbytesleft;
|
||||
#endif /* HAVE_ICONV */
|
||||
@@ -2711,7 +2711,8 @@ string_is_command_char (const char *string)
|
||||
const char *
|
||||
string_input_for_buffer (const char *string)
|
||||
{
|
||||
char *pos_slash, *pos_space, *next_char;
|
||||
char *pos_slash, *pos_space;
|
||||
const char *next_char;
|
||||
|
||||
if (!string)
|
||||
return NULL;
|
||||
|
||||
+5
-5
@@ -179,7 +179,7 @@ utf8_normalize (char *string, char replacement)
|
||||
* "string_start" was reached).
|
||||
*/
|
||||
|
||||
char *
|
||||
const char *
|
||||
utf8_prev_char (const char *string_start, const char *string)
|
||||
{
|
||||
if (!string || (string <= string_start))
|
||||
@@ -222,7 +222,7 @@ utf8_prev_char (const char *string_start, const char *string)
|
||||
* Returns pointer to next UTF-8 char, NULL if string was NULL.
|
||||
*/
|
||||
|
||||
char *
|
||||
const char *
|
||||
utf8_next_char (const char *string)
|
||||
{
|
||||
if (!string)
|
||||
@@ -673,7 +673,7 @@ utf8_char_size_screen (const char *string)
|
||||
* Returns pointer to the new position in string.
|
||||
*/
|
||||
|
||||
char *
|
||||
const char *
|
||||
utf8_add_offset (const char *string, int offset)
|
||||
{
|
||||
if (!string)
|
||||
@@ -684,7 +684,7 @@ utf8_add_offset (const char *string, int offset)
|
||||
string = utf8_next_char (string);
|
||||
offset--;
|
||||
}
|
||||
return (char *)string;
|
||||
return string;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -701,7 +701,7 @@ int
|
||||
utf8_real_pos (const char *string, int pos)
|
||||
{
|
||||
int count, real_pos;
|
||||
char *next_char;
|
||||
const char *next_char;
|
||||
|
||||
if (!string)
|
||||
return pos;
|
||||
|
||||
+4
-3
@@ -32,8 +32,9 @@ extern void utf8_init ();
|
||||
extern int utf8_has_8bits (const char *string);
|
||||
extern int utf8_is_valid (const char *string, char **error);
|
||||
extern void utf8_normalize (char *string, char replacement);
|
||||
extern char *utf8_prev_char (const char *string_start, const char *string);
|
||||
extern char *utf8_next_char (const char *string);
|
||||
extern const char *utf8_prev_char (const char *string_start,
|
||||
const char *string);
|
||||
extern const char *utf8_next_char (const char *string);
|
||||
extern int utf8_char_int (const char *string);
|
||||
extern void utf8_int_string (unsigned int unicode_value, char *string);
|
||||
extern wint_t utf8_wide_char (const char *string);
|
||||
@@ -46,7 +47,7 @@ extern int utf8_charcasecmp (const char *string1, const char *string2);
|
||||
extern int utf8_charcasecmp_range (const char *string1, const char *string2,
|
||||
int range);
|
||||
extern int utf8_char_size_screen (const char *string);
|
||||
extern char *utf8_add_offset (const char *string, int offset);
|
||||
extern const char *utf8_add_offset (const char *string, int offset);
|
||||
extern int utf8_real_pos (const char *string, int pos);
|
||||
extern int utf8_pos (const char *string, int real_pos);
|
||||
extern char *utf8_strndup (const char *string, int length);
|
||||
|
||||
+2
-1
@@ -718,7 +718,8 @@ util_file_get_content (const char *filename)
|
||||
int
|
||||
util_version_number (const char *version)
|
||||
{
|
||||
char **items, buf[64], *ptr_item, *error;
|
||||
char **items, buf[64], *error;
|
||||
const char *ptr_item;
|
||||
int num_items, i, version_int[4], index_buf;
|
||||
long number;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user