mirror of
https://github.com/weechat/weechat.git
synced 2026-06-30 14:56:39 +02:00
Use of const for some functions returning "char *"
This commit is contained in:
@@ -2411,7 +2411,7 @@ void
|
||||
command_set_display_option (struct t_config_option *option,
|
||||
const char *message)
|
||||
{
|
||||
char *color_name;
|
||||
const char *color_name;
|
||||
|
||||
switch (option->type)
|
||||
{
|
||||
|
||||
@@ -1412,7 +1412,7 @@ config_file_option_integer (struct t_config_option *option)
|
||||
* config_file_option_string: return string value of an option
|
||||
*/
|
||||
|
||||
char *
|
||||
const char *
|
||||
config_file_option_string (struct t_config_option *option)
|
||||
{
|
||||
if (!option)
|
||||
@@ -1443,7 +1443,7 @@ config_file_option_string (struct t_config_option *option)
|
||||
* config_file_option_color: return color value of an option
|
||||
*/
|
||||
|
||||
char *
|
||||
const char *
|
||||
config_file_option_color (struct t_config_option *option)
|
||||
{
|
||||
if (!option)
|
||||
@@ -2412,7 +2412,7 @@ config_file_print_stdout (struct t_config_file *config_file)
|
||||
{
|
||||
struct t_config_section *ptr_section;
|
||||
struct t_config_option *ptr_option;
|
||||
char *color_name;
|
||||
const char *color_name;
|
||||
int i;
|
||||
|
||||
for (ptr_section = config_file->sections; ptr_section;
|
||||
|
||||
@@ -228,8 +228,8 @@ extern int config_file_option_set_with_string (const char *option_name, const ch
|
||||
extern int config_file_option_unset_with_string (const char *option_name);
|
||||
extern int config_file_option_boolean (struct t_config_option *option);
|
||||
extern int config_file_option_integer (struct t_config_option *option);
|
||||
extern char *config_file_option_string (struct t_config_option *option);
|
||||
extern char *config_file_option_color (struct t_config_option *option);
|
||||
extern const char *config_file_option_string (struct t_config_option *option);
|
||||
extern const char *config_file_option_color (struct t_config_option *option);
|
||||
|
||||
extern void config_file_write_line (struct t_config_file *config_file,
|
||||
const char *option_name, const char *value, ...);
|
||||
|
||||
+2
-2
@@ -1470,12 +1470,12 @@ hook_info (struct t_weechat_plugin *plugin, const char *info_name,
|
||||
* hook_info_get: get info via info hook
|
||||
*/
|
||||
|
||||
char *
|
||||
const char *
|
||||
hook_info_get (struct t_weechat_plugin *plugin, const char *info_name,
|
||||
const char *arguments)
|
||||
{
|
||||
struct t_hook *ptr_hook, *next_hook;
|
||||
char *value;
|
||||
const char *value;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) plugin;
|
||||
|
||||
+5
-5
@@ -198,8 +198,8 @@ struct t_hook_modifier
|
||||
char *modifier; /* name of modifier */
|
||||
};
|
||||
|
||||
typedef char *(t_hook_callback_info)(void *data, const char *info_name,
|
||||
const char *arguments);
|
||||
typedef const char *(t_hook_callback_info)(void *data, const char *info_name,
|
||||
const char *arguments);
|
||||
|
||||
struct t_hook_info
|
||||
{
|
||||
@@ -305,9 +305,9 @@ extern struct t_hook *hook_info (struct t_weechat_plugin *plugin,
|
||||
const char *description,
|
||||
t_hook_callback_info *callback,
|
||||
void *callback_data);
|
||||
extern char *hook_info_get (struct t_weechat_plugin *plugin,
|
||||
const char *info_name,
|
||||
const char *arguments);
|
||||
extern const char *hook_info_get (struct t_weechat_plugin *plugin,
|
||||
const char *info_name,
|
||||
const char *arguments);
|
||||
extern struct t_hook *hook_infolist (struct t_weechat_plugin *plugin,
|
||||
const char *infolist_name,
|
||||
const char *description,
|
||||
|
||||
@@ -331,7 +331,7 @@ infolist_reset_item_cursor (struct t_infolist *infolist)
|
||||
* infolist_fields: get list of fields for current infolist item
|
||||
*/
|
||||
|
||||
char *
|
||||
const char *
|
||||
infolist_fields (struct t_infolist *infolist)
|
||||
{
|
||||
struct t_infolist_var *ptr_var;
|
||||
@@ -417,7 +417,7 @@ infolist_integer (struct t_infolist *infolist, const char *var)
|
||||
* infolist_string: get a string variable value in current list item
|
||||
*/
|
||||
|
||||
char *
|
||||
const char *
|
||||
infolist_string (struct t_infolist *infolist, const char *var)
|
||||
{
|
||||
struct t_infolist_var *ptr_var;
|
||||
|
||||
@@ -88,10 +88,10 @@ extern int infolist_valid (struct t_infolist *infolist);
|
||||
extern struct t_infolist_item *infolist_next (struct t_infolist *infolist);
|
||||
extern struct t_infolist_item *infolist_prev (struct t_infolist *infolist);
|
||||
extern void infolist_reset_item_cursor (struct t_infolist *infolist);
|
||||
extern char *infolist_fields (struct t_infolist *infolist);
|
||||
extern const char *infolist_fields (struct t_infolist *infolist);
|
||||
extern int infolist_integer (struct t_infolist *infolist,
|
||||
const char *var);
|
||||
extern char *infolist_string (struct t_infolist *infolist,
|
||||
extern const char *infolist_string (struct t_infolist *infolist,
|
||||
const char *var);
|
||||
extern void *infolist_pointer (struct t_infolist *infolist,
|
||||
const char *var);
|
||||
|
||||
+1
-1
@@ -293,7 +293,7 @@ weelist_prev (struct t_weelist_item *item)
|
||||
* weelist_string: get string pointer to item data
|
||||
*/
|
||||
|
||||
char *
|
||||
const char *
|
||||
weelist_string (struct t_weelist_item *item)
|
||||
{
|
||||
if (item)
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ extern struct t_weelist_item *weelist_get (struct t_weelist *weelist,
|
||||
extern void weelist_set (struct t_weelist_item *item, const char *value);
|
||||
extern struct t_weelist_item *weelist_next (struct t_weelist_item *item);
|
||||
extern struct t_weelist_item *weelist_prev (struct t_weelist_item *item);
|
||||
extern char *weelist_string (struct t_weelist_item *item);
|
||||
extern const char *weelist_string (struct t_weelist_item *item);
|
||||
extern int weelist_size (struct t_weelist *weelist);
|
||||
extern void weelist_remove (struct t_weelist *weelist,
|
||||
struct t_weelist_item *item);
|
||||
|
||||
@@ -116,7 +116,8 @@ upgrade_file_write_time (struct t_upgrade_file *upgrade_file, time_t date)
|
||||
*/
|
||||
|
||||
int
|
||||
upgrade_file_write_string (struct t_upgrade_file *upgrade_file, char *string)
|
||||
upgrade_file_write_string (struct t_upgrade_file *upgrade_file,
|
||||
const char *string)
|
||||
{
|
||||
int length;
|
||||
|
||||
@@ -239,7 +240,8 @@ upgrade_file_write_object (struct t_upgrade_file *upgrade_file, int object_id,
|
||||
struct t_infolist *infolist)
|
||||
{
|
||||
int i, argc, length;
|
||||
char *fields, **argv;
|
||||
char **argv;
|
||||
const char *fields;
|
||||
void *buf;
|
||||
|
||||
/* write all infolist variables */
|
||||
|
||||
@@ -279,8 +279,8 @@ int
|
||||
upgrade_weechat_read_cb (int object_id,
|
||||
struct t_infolist *infolist)
|
||||
{
|
||||
char *type, *name, *prefix, *group_name, option_name[64], *key;
|
||||
char *option_key, *var_name, *option_var;
|
||||
const char *key, *var_name, *type, *name, *prefix, *group_name;
|
||||
char option_name[64], *option_key, *option_var;
|
||||
struct t_gui_nick_group *ptr_group;
|
||||
struct t_gui_buffer *ptr_buffer;
|
||||
struct t_gui_line *new_line;
|
||||
|
||||
Reference in New Issue
Block a user