1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-04 16:53:14 +02:00

core, api: use "const char *" variables for result of string functions with const parameter

This commit is contained in:
Sébastien Helleu
2026-06-15 07:44:01 +02:00
parent cf702d541f
commit 7e3afaf46d
16 changed files with 61 additions and 41 deletions
+2 -1
View File
@@ -138,7 +138,8 @@ gui_bar_item_custom_search (const char *item_name)
struct t_gui_bar_item_custom *
gui_bar_item_custom_search_with_option_name (const char *option_name)
{
char *item_name, *pos_option;
const char *pos_option;
char *item_name;
struct t_gui_bar_item_custom *ptr_item;
if (!option_name)
+2 -1
View File
@@ -515,7 +515,8 @@ gui_bar_search (const char *name)
struct t_gui_bar *
gui_bar_search_with_option_name (const char *option_name)
{
char *bar_name, *pos_option;
const char *pos_option;
char *bar_name;
struct t_gui_bar *ptr_bar;
if (!option_name)
+2 -2
View File
@@ -118,8 +118,8 @@ gui_chat_init (void)
void
gui_chat_prefix_build (void)
{
const char *ptr_prefix;
char prefix[512], *pos_color;
const char *ptr_prefix, *pos_color;
char prefix[512];
int prefix_color[GUI_CHAT_NUM_PREFIXES] =
{ GUI_COLOR_CHAT_PREFIX_ERROR, GUI_COLOR_CHAT_PREFIX_NETWORK,
GUI_COLOR_CHAT_PREFIX_ACTION, GUI_COLOR_CHAT_PREFIX_JOIN,
+2 -2
View File
@@ -254,8 +254,8 @@ gui_color_get_custom (const char *color_name)
static char color[32][96];
static int index_color = 0;
char color_fg[32], color_bg[32];
char *pos_delim, *str_fg, *pos_bg, *error, *color_attr;
const char *ptr_color_name;
char *str_fg, *error, *color_attr;
const char *ptr_color_name, *pos_delim, *pos_bg;
/* attribute or other color name (GUI dependent) */
index_color = (index_color + 1) % 32;
+2 -2
View File
@@ -366,8 +366,8 @@ gui_filter_new (int enabled, const char *name, const char *buffer_name,
{
struct t_gui_filter *new_filter;
regex_t *regex1, *regex2;
char *pos_tab, *regex_prefix, buf[512], str_error[1024];
const char *ptr_start_regex, *pos_regex_message;
char *regex_prefix, buf[512], str_error[1024];
const char *ptr_start_regex, *pos_regex_message, *pos_tab;
int rc;
if (!name || !buffer_name || !tags || !regex)
+1 -1
View File
@@ -1076,7 +1076,7 @@ gui_key_set_area_type_name (const char *area,
int *area_type, char **area_name)
{
int focus, length;
char *pos_end;
const char *pos_end;
for (focus = 0; focus < GUI_KEY_NUM_FOCUS; focus++)
{