mirror of
https://github.com/weechat/weechat.git
synced 2026-07-01 23:36:37 +02:00
Use of const for some functions returning "char *"
This commit is contained in:
@@ -262,7 +262,7 @@ gui_color_get_number ()
|
||||
* gui_color_get_name: get color name
|
||||
*/
|
||||
|
||||
char *
|
||||
const char *
|
||||
gui_color_get_name (int num_color)
|
||||
{
|
||||
return gui_weechat_colors[num_color].string;
|
||||
|
||||
@@ -114,7 +114,7 @@ gui_color_get_number ()
|
||||
* gui_color_get_name: get color name
|
||||
*/
|
||||
|
||||
char *
|
||||
const char *
|
||||
gui_color_get_name (int num_color)
|
||||
{
|
||||
return gui_weechat_colors[num_color].string;
|
||||
|
||||
@@ -819,7 +819,7 @@ gui_bar_item_default_buffer_plugin (void *data, struct t_gui_bar_item *item,
|
||||
struct t_gui_window *window,
|
||||
int max_width, int max_height)
|
||||
{
|
||||
char *plugin_name;
|
||||
const char *plugin_name;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
@@ -829,7 +829,7 @@ gui_bar_item_default_buffer_plugin (void *data, struct t_gui_bar_item *item,
|
||||
|
||||
if (!window)
|
||||
window = gui_current_window;
|
||||
|
||||
|
||||
plugin_name = plugin_get_name (window->buffer->plugin);
|
||||
return (plugin_name) ? strdup (plugin_name) : strdup ("");
|
||||
}
|
||||
|
||||
@@ -539,7 +539,7 @@ gui_buffer_get_integer (struct t_gui_buffer *buffer, const char *property)
|
||||
* gui_buffer_get_string: get a buffer property as string
|
||||
*/
|
||||
|
||||
char *
|
||||
const char *
|
||||
gui_buffer_get_string (struct t_gui_buffer *buffer, const char *property)
|
||||
{
|
||||
struct t_gui_buffer_local_var *ptr_local_var;
|
||||
|
||||
@@ -198,8 +198,8 @@ extern void gui_buffer_set_plugin_for_upgrade (char *name,
|
||||
struct t_weechat_plugin *plugin);
|
||||
extern int gui_buffer_get_integer (struct t_gui_buffer *buffer,
|
||||
const char *property);
|
||||
extern char *gui_buffer_get_string (struct t_gui_buffer *buffer,
|
||||
const char *property);
|
||||
extern const char *gui_buffer_get_string (struct t_gui_buffer *buffer,
|
||||
const char *property);
|
||||
extern void *gui_buffer_get_pointer (struct t_gui_buffer *buffer,
|
||||
const char *property);
|
||||
extern void gui_buffer_ask_chat_refresh (struct t_gui_buffer *buffer,
|
||||
|
||||
+2
-2
@@ -77,7 +77,7 @@ gui_color_search_config_int (const char *color_name)
|
||||
* return color configuration name, NULL if not found
|
||||
*/
|
||||
|
||||
char *
|
||||
const char *
|
||||
gui_color_search_config_str (int color_number)
|
||||
{
|
||||
struct t_config_section *ptr_section;
|
||||
@@ -103,7 +103,7 @@ gui_color_search_config_str (int color_number)
|
||||
* gui_color_get_custom: get a custom color with a name (GUI dependent)
|
||||
*/
|
||||
|
||||
char *
|
||||
const char *
|
||||
gui_color_get_custom (const char *color_name)
|
||||
{
|
||||
int fg, bg;
|
||||
|
||||
+3
-3
@@ -123,8 +123,8 @@ extern struct t_gui_color *gui_color[];
|
||||
/* color functions */
|
||||
|
||||
extern int gui_color_search_config_int (const char *color_name);
|
||||
extern char *gui_color_search_config_str (int color_number);
|
||||
extern char *gui_color_get_custom (const char *color_name);
|
||||
extern const char *gui_color_search_config_str (int color_number);
|
||||
extern const char *gui_color_get_custom (const char *color_name);
|
||||
extern unsigned char *gui_color_decode (const unsigned char *string);
|
||||
extern void gui_color_free (struct t_gui_color *color);
|
||||
|
||||
@@ -133,7 +133,7 @@ extern void gui_color_free (struct t_gui_color *color);
|
||||
extern int gui_color_search (const char *color_name);
|
||||
extern int gui_color_assign (int *color, char const *color_name);
|
||||
extern int gui_color_get_number ();
|
||||
extern char *gui_color_get_name (int num_color);
|
||||
extern const char *gui_color_get_name (int num_color);
|
||||
extern void gui_color_init_pairs ();
|
||||
extern void gui_color_init_weechat ();
|
||||
|
||||
|
||||
@@ -700,8 +700,9 @@ gui_completion_list_add_plugin_commands (struct t_gui_completion *completion)
|
||||
void
|
||||
gui_completion_list_add_option_value (struct t_gui_completion *completion)
|
||||
{
|
||||
char *pos_space, *option_full_name, *color_name, *pos_section, *pos_option;
|
||||
char *pos_space, *option_full_name, *pos_section, *pos_option;
|
||||
char *file, *section, *value_string;
|
||||
const char *color_name;
|
||||
int length, i, num_colors;
|
||||
struct t_config_file *ptr_config;
|
||||
struct t_config_section *ptr_section, *section_found;
|
||||
|
||||
@@ -184,7 +184,7 @@ void
|
||||
gui_layout_buffer_apply ()
|
||||
{
|
||||
struct t_gui_buffer *ptr_buffer;
|
||||
char *plugin_name;
|
||||
const char *plugin_name;
|
||||
|
||||
if (gui_layout_buffers)
|
||||
{
|
||||
@@ -408,7 +408,7 @@ void
|
||||
gui_layout_window_check_buffer (struct t_gui_buffer *buffer)
|
||||
{
|
||||
struct t_gui_window *ptr_win;
|
||||
char *plugin_name;
|
||||
const char *plugin_name;
|
||||
|
||||
plugin_name = plugin_get_name (buffer->plugin);
|
||||
|
||||
@@ -436,7 +436,7 @@ gui_layout_window_check_all_buffers ()
|
||||
{
|
||||
struct t_gui_window *ptr_win;
|
||||
struct t_gui_buffer *ptr_buffer;
|
||||
char *plugin_name;
|
||||
const char *plugin_name;
|
||||
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
{
|
||||
|
||||
@@ -300,7 +300,7 @@ gui_window_get_integer (struct t_gui_window *window, const char *property)
|
||||
* gui_window_get_string: get a window property as string
|
||||
*/
|
||||
|
||||
char *
|
||||
const char *
|
||||
gui_window_get_string (struct t_gui_window *window, const char *property)
|
||||
{
|
||||
if (window && property)
|
||||
|
||||
@@ -103,8 +103,8 @@ extern struct t_gui_window *gui_window_new (struct t_gui_window *parent,
|
||||
extern int gui_window_valid (struct t_gui_window *window);
|
||||
extern int gui_window_get_integer (struct t_gui_window *window,
|
||||
const char *property);
|
||||
extern char *gui_window_get_string (struct t_gui_window *window,
|
||||
const char *property);
|
||||
extern const char *gui_window_get_string (struct t_gui_window *window,
|
||||
const char *property);
|
||||
extern void *gui_window_get_pointer (struct t_gui_window *window,
|
||||
const char *property);
|
||||
extern void gui_window_set_layout_plugin_name (struct t_gui_window *window,
|
||||
|
||||
Reference in New Issue
Block a user