mirror of
https://github.com/weechat/weechat.git
synced 2026-06-26 12:56:37 +02:00
Add "const" keyword for some "char *" function arguments (core and plugins API)
This commit is contained in:
@@ -63,7 +63,7 @@ script_config_read (struct t_weechat_plugin *weechat_plugin)
|
||||
*/
|
||||
|
||||
int
|
||||
script_config_cb (void *data, char *option, char *value)
|
||||
script_config_cb (void *data, const char *option, const char *value)
|
||||
{
|
||||
/* make C compiler happy */
|
||||
(void) option;
|
||||
@@ -84,16 +84,16 @@ script_init (struct t_weechat_plugin *weechat_plugin,
|
||||
struct t_gui_buffer *buffer,
|
||||
int argc, char **argv,
|
||||
char **argv_eol),
|
||||
int (*callback_completion)(void *data, char *completion,
|
||||
int (*callback_completion)(void *data, const char *completion,
|
||||
struct t_gui_buffer *buffer,
|
||||
struct t_weelist *list),
|
||||
int (*callback_signal_debug_dump)(void *data, char *signal,
|
||||
char *type_data,
|
||||
int (*callback_signal_debug_dump)(void *data, const char *signal,
|
||||
const char *type_data,
|
||||
void *signal_data),
|
||||
int (*callback_signal_buffer_closed)(void *data, char *signal,
|
||||
char *type_data,
|
||||
int (*callback_signal_buffer_closed)(void *data, const char *signal,
|
||||
const char *type_data,
|
||||
void *signal_data),
|
||||
int (*callback_load_file)(void *data, char *filename))
|
||||
int (*callback_load_file)(void *data, const char *filename))
|
||||
{
|
||||
char *string, *completion = "list|listfull|load|autoload|reload|unload %f";
|
||||
int length;
|
||||
@@ -190,7 +190,7 @@ script_ptr2str (void *pointer)
|
||||
*/
|
||||
|
||||
void *
|
||||
script_str2ptr (char *pointer_str)
|
||||
script_str2ptr (const char *pointer_str)
|
||||
{
|
||||
unsigned int value;
|
||||
|
||||
@@ -208,7 +208,7 @@ script_str2ptr (char *pointer_str)
|
||||
|
||||
void
|
||||
script_auto_load (struct t_weechat_plugin *weechat_plugin,
|
||||
int (*callback)(void *data, char *filename))
|
||||
int (*callback)(void *data, const char *filename))
|
||||
{
|
||||
char *dir_home, *dir_name;
|
||||
int dir_length;
|
||||
@@ -235,7 +235,7 @@ script_auto_load (struct t_weechat_plugin *weechat_plugin,
|
||||
|
||||
struct t_plugin_script *
|
||||
script_search (struct t_weechat_plugin *weechat_plugin,
|
||||
struct t_plugin_script *scripts, char *name)
|
||||
struct t_plugin_script *scripts, const char *name)
|
||||
{
|
||||
struct t_plugin_script *ptr_script;
|
||||
|
||||
@@ -256,7 +256,7 @@ script_search (struct t_weechat_plugin *weechat_plugin,
|
||||
|
||||
char *
|
||||
script_search_full_name (struct t_weechat_plugin *weechat_plugin,
|
||||
char *filename)
|
||||
const char *filename)
|
||||
{
|
||||
char *final_name, *dir_home, *dir_system;
|
||||
int length;
|
||||
@@ -347,9 +347,9 @@ script_search_full_name (struct t_weechat_plugin *weechat_plugin,
|
||||
struct t_plugin_script *
|
||||
script_add (struct t_weechat_plugin *weechat_plugin,
|
||||
struct t_plugin_script **scripts,
|
||||
char *filename, char *name, char *author, char *version,
|
||||
char *license, char *description, char *shutdown_func,
|
||||
char *charset)
|
||||
const char *filename, const char *name, const char *author, const char *version,
|
||||
const char *license, const char *description, const char *shutdown_func,
|
||||
const char *charset)
|
||||
{
|
||||
struct t_plugin_script *new_script;
|
||||
|
||||
@@ -544,7 +544,7 @@ script_completion (struct t_weechat_plugin *weechat_plugin,
|
||||
void
|
||||
script_display_list (struct t_weechat_plugin *weechat_plugin,
|
||||
struct t_plugin_script *scripts,
|
||||
char *name, int full)
|
||||
const char *name, int full)
|
||||
{
|
||||
struct t_plugin_script *ptr_script;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user