diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/hook/wee-hook-command.c | 5 | ||||
-rw-r--r-- | src/core/hook/wee-hook-completion.c | 3 | ||||
-rw-r--r-- | src/core/hook/wee-hook-info-hashtable.c | 3 | ||||
-rw-r--r-- | src/core/hook/wee-hook-info.c | 3 | ||||
-rw-r--r-- | src/core/hook/wee-hook-infolist.c | 3 | ||||
-rw-r--r-- | src/core/wee-completion.c | 2 | ||||
-rw-r--r-- | src/core/wee-config-file.c | 65 | ||||
-rw-r--r-- | src/core/wee-config.c | 6 | ||||
-rw-r--r-- | src/core/wee-debug.c | 2 | ||||
-rw-r--r-- | src/core/wee-hashtable.c | 62 | ||||
-rw-r--r-- | src/core/wee-hdata.c | 16 | ||||
-rw-r--r-- | src/core/wee-hook.c | 11 | ||||
-rw-r--r-- | src/core/wee-infolist.c | 12 | ||||
-rw-r--r-- | src/core/wee-proxy.c | 14 |
14 files changed, 102 insertions, 105 deletions
diff --git a/src/core/hook/wee-hook-command.c b/src/core/hook/wee-hook-command.c index 2cf2d8349..435b0d702 100644 --- a/src/core/hook/wee-hook-command.c +++ b/src/core/hook/wee-hook-command.c @@ -69,7 +69,7 @@ hook_command_search (struct t_weechat_plugin *plugin, const char *command) { if (!ptr_hook->deleted && (ptr_hook->plugin == plugin) - && (string_strcmp (HOOK_COMMAND(ptr_hook, command), command) == 0)) + && (strcmp (HOOK_COMMAND(ptr_hook, command), command) == 0)) return ptr_hook; } @@ -409,8 +409,7 @@ hook_command_exec (struct t_gui_buffer *buffer, int any_plugin, if (!ptr_hook->deleted) { - if (string_strcmp (ptr_command_name, - HOOK_COMMAND(ptr_hook, command)) == 0) + if (strcmp (ptr_command_name, HOOK_COMMAND(ptr_hook, command)) == 0) { if (ptr_hook->plugin == plugin) { diff --git a/src/core/hook/wee-hook-completion.c b/src/core/hook/wee-hook-completion.c index 06cc36ff6..16b1a566e 100644 --- a/src/core/hook/wee-hook-completion.c +++ b/src/core/hook/wee-hook-completion.c @@ -132,8 +132,7 @@ hook_completion_exec (struct t_weechat_plugin *plugin, if (!ptr_hook->deleted && !ptr_hook->running - && (string_strcmp (HOOK_COMPLETION(ptr_hook, completion_item), - item) == 0)) + && (strcmp (HOOK_COMPLETION(ptr_hook, completion_item), item) == 0)) { ptr_hook->running = 1; (void) (HOOK_COMPLETION(ptr_hook, callback)) diff --git a/src/core/hook/wee-hook-info-hashtable.c b/src/core/hook/wee-hook-info-hashtable.c index 1734c8704..66b493c79 100644 --- a/src/core/hook/wee-hook-info-hashtable.c +++ b/src/core/hook/wee-hook-info-hashtable.c @@ -123,8 +123,7 @@ hook_info_get_hashtable (struct t_weechat_plugin *plugin, const char *info_name, if (!ptr_hook->deleted && !ptr_hook->running - && (string_strcmp (HOOK_INFO_HASHTABLE(ptr_hook, info_name), - info_name) == 0)) + && (strcmp (HOOK_INFO_HASHTABLE(ptr_hook, info_name), info_name) == 0)) { ptr_hook->running = 1; value = (HOOK_INFO_HASHTABLE(ptr_hook, callback)) diff --git a/src/core/hook/wee-hook-info.c b/src/core/hook/wee-hook-info.c index 9d96a5252..b66c867eb 100644 --- a/src/core/hook/wee-hook-info.c +++ b/src/core/hook/wee-hook-info.c @@ -122,8 +122,7 @@ hook_info_get (struct t_weechat_plugin *plugin, const char *info_name, if (!ptr_hook->deleted && !ptr_hook->running - && (string_strcmp (HOOK_INFO(ptr_hook, info_name), - info_name) == 0)) + && (strcmp (HOOK_INFO(ptr_hook, info_name), info_name) == 0)) { ptr_hook->running = 1; value = (HOOK_INFO(ptr_hook, callback)) diff --git a/src/core/hook/wee-hook-infolist.c b/src/core/hook/wee-hook-infolist.c index a3a5f29cc..b75722c11 100644 --- a/src/core/hook/wee-hook-infolist.c +++ b/src/core/hook/wee-hook-infolist.c @@ -123,8 +123,7 @@ hook_infolist_get (struct t_weechat_plugin *plugin, const char *infolist_name, if (!ptr_hook->deleted && !ptr_hook->running - && (string_strcmp (HOOK_INFOLIST(ptr_hook, infolist_name), - infolist_name) == 0)) + && (strcmp (HOOK_INFOLIST(ptr_hook, infolist_name), infolist_name) == 0)) { ptr_hook->running = 1; value = (HOOK_INFOLIST(ptr_hook, callback)) diff --git a/src/core/wee-completion.c b/src/core/wee-completion.c index 1a544cdd9..0e307c203 100644 --- a/src/core/wee-completion.c +++ b/src/core/wee-completion.c @@ -1262,7 +1262,7 @@ completion_list_add_plugins_commands_cb (const void *pointer, void *data, arg_index = argc - 1; ptr_plugin = NULL; - if (string_strcmp (argv[arg_index], PLUGIN_CORE) != 0) + if (strcmp (argv[arg_index], PLUGIN_CORE) != 0) { /* * plugin name is different from "core", then search it in diff --git a/src/core/wee-config-file.c b/src/core/wee-config-file.c index 560309c27..14a682516 100644 --- a/src/core/wee-config-file.c +++ b/src/core/wee-config-file.c @@ -692,7 +692,7 @@ config_file_new_option (struct t_config_file *config_file, option_name = NULL; parent_name = NULL; - if (!name) + if (!name || !type) goto error; pos = strstr (name, " << "); @@ -715,7 +715,7 @@ config_file_new_option (struct t_config_file *config_file, var_type = -1; for (i = 0; i < CONFIG_NUM_OPTION_TYPES; i++) { - if (string_strcmp (type, config_option_type_string[i]) == 0) + if (strcmp (type, config_option_type_string[i]) == 0) { var_type = i; break; @@ -802,8 +802,8 @@ config_file_new_option (struct t_config_file *config_file, index_value = 0; for (i = 0; i < argc; i++) { - if (string_strcmp (new_option->string_values[i], - default_value) == 0) + if (strcmp (new_option->string_values[i], + default_value) == 0) { index_value = i; break; @@ -819,8 +819,8 @@ config_file_new_option (struct t_config_file *config_file, index_value = 0; for (i = 0; i < argc; i++) { - if (string_strcmp (new_option->string_values[i], - value) == 0) + if (strcmp (new_option->string_values[i], + value) == 0) { index_value = i; break; @@ -1162,13 +1162,13 @@ config_file_string_boolean_is_valid (const char *text) for (i = 0; config_boolean_true[i]; i++) { - if (string_strcmp (text, config_boolean_true[i]) == 0) + if (strcmp (text, config_boolean_true[i]) == 0) return 1; } for (i = 0; config_boolean_false[i]; i++) { - if (string_strcmp (text, config_boolean_false[i]) == 0) + if (strcmp (text, config_boolean_false[i]) == 0) return 1; } @@ -1194,7 +1194,7 @@ config_file_string_to_boolean (const char *text) for (i = 0; config_boolean_true[i]; i++) { - if (string_strcmp (text, config_boolean_true[i]) == 0) + if (strcmp (text, config_boolean_true[i]) == 0) return CONFIG_BOOLEAN_TRUE; } @@ -1380,7 +1380,7 @@ config_file_option_set (struct t_config_option *option, const char *value, option->value = malloc (sizeof (int)); if (option->value) { - if (string_strcmp (value, "toggle") == 0) + if (strcmp (value, "toggle") == 0) { CONFIG_BOOLEAN(option) = CONFIG_BOOLEAN_TRUE; rc = WEECHAT_CONFIG_OPTION_SET_OK_CHANGED; @@ -1403,7 +1403,7 @@ config_file_option_set (struct t_config_option *option, const char *value, } else { - if (string_strcmp (value, "toggle") == 0) + if (strcmp (value, "toggle") == 0) { CONFIG_BOOLEAN(option) = (CONFIG_BOOLEAN(option) == CONFIG_BOOLEAN_TRUE) ? @@ -1463,8 +1463,7 @@ config_file_option_set (struct t_config_option *option, const char *value, { for (i = 0; option->string_values[i]; i++) { - if (string_strcmp (option->string_values[i], - value) == 0) + if (strcmp (option->string_values[i], value) == 0) { value_int = i; break; @@ -2106,17 +2105,17 @@ config_file_option_get_string (struct t_config_option *option, if (!option || !property) return NULL; - if (string_strcmp (property, "config_name") == 0) + if (strcmp (property, "config_name") == 0) return option->config_file->name; - else if (string_strcmp (property, "section_name") == 0) + else if (strcmp (property, "section_name") == 0) return option->section->name; - else if (string_strcmp (property, "name") == 0) + else if (strcmp (property, "name") == 0) return option->name; - else if (string_strcmp (property, "parent_name") == 0) + else if (strcmp (property, "parent_name") == 0) return option->parent_name; - else if (string_strcmp (property, "type") == 0) + else if (strcmp (property, "type") == 0) return config_option_type_string[option->type]; - else if (string_strcmp (property, "description") == 0) + else if (strcmp (property, "description") == 0) return option->description; return NULL; @@ -2133,31 +2132,31 @@ config_file_option_get_pointer (struct t_config_option *option, if (!option || !property) return NULL; - if (string_strcmp (property, "config_file") == 0) + if (strcmp (property, "config_file") == 0) return option->config_file; - else if (string_strcmp (property, "section") == 0) + else if (strcmp (property, "section") == 0) return option->section; - else if (string_strcmp (property, "name") == 0) + else if (strcmp (property, "name") == 0) return option->name; - else if (string_strcmp (property, "parent_name") == 0) + else if (strcmp (property, "parent_name") == 0) return option->parent_name; - else if (string_strcmp (property, "type") == 0) + else if (strcmp (property, "type") == 0) return &option->type; - else if (string_strcmp (property, "description") == 0) + else if (strcmp (property, "description") == 0) return option->description; - else if (string_strcmp (property, "string_values") == 0) + else if (strcmp (property, "string_values") == 0) return option->string_values; - else if (string_strcmp (property, "min") == 0) + else if (strcmp (property, "min") == 0) return &option->min; - else if (string_strcmp (property, "max") == 0) + else if (strcmp (property, "max") == 0) return &option->max; - else if (string_strcmp (property, "default_value") == 0) + else if (strcmp (property, "default_value") == 0) return option->default_value; - else if (string_strcmp (property, "value") == 0) + else if (strcmp (property, "value") == 0) return option->value; - else if (string_strcmp (property, "prev_option") == 0) + else if (strcmp (property, "prev_option") == 0) return option->prev_option; - else if (string_strcmp (property, "next_option") == 0) + else if (strcmp (property, "next_option") == 0) return option->next_option; return NULL; @@ -2944,7 +2943,7 @@ config_file_read_internal (struct t_config_file *config_file, int reload) } if (pos[0] - && string_strcmp (pos, WEECHAT_CONFIG_OPTION_NULL) != 0) + && strcmp (pos, WEECHAT_CONFIG_OPTION_NULL) != 0) { undefined_value = 0; /* remove simple or double quotes and spaces at the end */ diff --git a/src/core/wee-config.c b/src/core/wee-config.c index b11755eed..72d9ec72c 100644 --- a/src/core/wee-config.c +++ b/src/core/wee-config.c @@ -2114,7 +2114,7 @@ config_weechat_layout_read_cb (const void *pointer, void *data, gui_layout_add (ptr_layout); } - if (string_strcmp (ptr_option_name, "buffer") == 0) + if (strcmp (ptr_option_name, "buffer") == 0) { argv = string_split (value, ";", NULL, WEECHAT_STRING_SPLIT_STRIP_LEFT @@ -2133,7 +2133,7 @@ config_weechat_layout_read_cb (const void *pointer, void *data, string_free_split (argv); } } - else if (string_strcmp (ptr_option_name, "window") == 0) + else if (strcmp (ptr_option_name, "window") == 0) { argv = string_split (value, ";", NULL, WEECHAT_STRING_SPLIT_STRIP_LEFT @@ -2171,7 +2171,7 @@ config_weechat_layout_read_cb (const void *pointer, void *data, string_free_split (argv); } } - else if (string_strcmp (ptr_option_name, "current") == 0) + else if (strcmp (ptr_option_name, "current") == 0) { if (config_file_string_to_boolean (value)) gui_layout_current = ptr_layout; diff --git a/src/core/wee-debug.c b/src/core/wee-debug.c index a6cb5a3be..49e7cca61 100644 --- a/src/core/wee-debug.c +++ b/src/core/wee-debug.c @@ -137,7 +137,7 @@ debug_dump_cb (const void *pointer, void *data, (void) signal; (void) type_data; - if (!signal_data || (string_strcmp ((char *)signal_data, PLUGIN_CORE) == 0)) + if (!signal_data || (strcmp ((char *)signal_data, PLUGIN_CORE) == 0)) debug_dump (0); return WEECHAT_RC_OK; diff --git a/src/core/wee-hashtable.c b/src/core/wee-hashtable.c index d6dd45d0d..8be417dba 100644 --- a/src/core/wee-hashtable.c +++ b/src/core/wee-hashtable.c @@ -747,13 +747,13 @@ hashtable_get_list_keys (struct t_hashtable *hashtable) int hashtable_get_integer (struct t_hashtable *hashtable, const char *property) { - if (hashtable && property) - { - if (string_strcmp (property, "size") == 0) - return hashtable->size; - else if (string_strcmp (property, "items_count") == 0) - return hashtable->items_count; - } + if (!hashtable || !property) + return 0; + + if (strcmp (property, "size") == 0) + return hashtable->size; + else if (strcmp (property, "items_count") == 0) + return hashtable->items_count; return 0; } @@ -1003,23 +1003,23 @@ hashtable_get_keys_values (struct t_hashtable *hashtable, const char * hashtable_get_string (struct t_hashtable *hashtable, const char *property) { - if (hashtable && property) - { - if (string_strcmp (property, "type_keys") == 0) - return hashtable_type_string[hashtable->type_keys]; - else if (string_strcmp (property, "type_values") == 0) - return hashtable_type_string[hashtable->type_values]; - else if (string_strcmp (property, "keys") == 0) - return hashtable_get_keys_values (hashtable, 1, 0, 0); - else if (string_strcmp (property, "keys_sorted") == 0) - return hashtable_get_keys_values (hashtable, 1, 1, 0); - else if (string_strcmp (property, "values") == 0) - return hashtable_get_keys_values (hashtable, 0, 0, 1); - else if (string_strcmp (property, "keys_values") == 0) - return hashtable_get_keys_values (hashtable, 1, 0, 1); - else if (string_strcmp (property, "keys_values_sorted") == 0) - return hashtable_get_keys_values (hashtable, 1, 1, 1); - } + if (!hashtable || !property) + return NULL; + + if (strcmp (property, "type_keys") == 0) + return hashtable_type_string[hashtable->type_keys]; + else if (strcmp (property, "type_values") == 0) + return hashtable_type_string[hashtable->type_values]; + else if (strcmp (property, "keys") == 0) + return hashtable_get_keys_values (hashtable, 1, 0, 0); + else if (strcmp (property, "keys_sorted") == 0) + return hashtable_get_keys_values (hashtable, 1, 1, 0); + else if (strcmp (property, "values") == 0) + return hashtable_get_keys_values (hashtable, 0, 0, 1); + else if (strcmp (property, "keys_values") == 0) + return hashtable_get_keys_values (hashtable, 1, 0, 1); + else if (strcmp (property, "keys_values_sorted") == 0) + return hashtable_get_keys_values (hashtable, 1, 1, 1); return NULL; } @@ -1032,13 +1032,13 @@ void hashtable_set_pointer (struct t_hashtable *hashtable, const char *property, void *pointer) { - if (hashtable && property) - { - if (string_strcmp (property, "callback_free_key") == 0) - hashtable->callback_free_key = pointer; - else if (string_strcmp (property, "callback_free_value") == 0) - hashtable->callback_free_value = pointer; - } + if (!hashtable || !property) + return; + + if (strcmp (property, "callback_free_key") == 0) + hashtable->callback_free_key = pointer; + else if (strcmp (property, "callback_free_value") == 0) + hashtable->callback_free_value = pointer; } /* diff --git a/src/core/wee-hdata.c b/src/core/wee-hdata.c index 3c0a804d0..502f30c32 100644 --- a/src/core/wee-hdata.c +++ b/src/core/wee-hdata.c @@ -1207,21 +1207,21 @@ hdata_get_string (struct t_hdata *hdata, const char *property) if (!hdata || !property) return NULL; - if (string_strcmp (property, "var_keys") == 0) + if (strcmp (property, "var_keys") == 0) return hashtable_get_string (hdata->hash_var, "keys"); - else if (string_strcmp (property, "var_values") == 0) + else if (strcmp (property, "var_values") == 0) return hashtable_get_string (hdata->hash_var, "values"); - else if (string_strcmp (property, "var_keys_values") == 0) + else if (strcmp (property, "var_keys_values") == 0) return hashtable_get_string (hdata->hash_var, "keys_values"); - else if (string_strcmp (property, "var_prev") == 0) + else if (strcmp (property, "var_prev") == 0) return hdata->var_prev; - else if (string_strcmp (property, "var_next") == 0) + else if (strcmp (property, "var_next") == 0) return hdata->var_next; - else if (string_strcmp (property, "list_keys") == 0) + else if (strcmp (property, "list_keys") == 0) return hashtable_get_string (hdata->hash_list, "keys"); - else if (string_strcmp (property, "list_values") == 0) + else if (strcmp (property, "list_values") == 0) return hashtable_get_string (hdata->hash_list, "values"); - else if (string_strcmp (property, "list_keys_values") == 0) + else if (strcmp (property, "list_keys_values") == 0) return hashtable_get_string (hdata->hash_list, "keys_values"); return NULL; diff --git a/src/core/wee-hook.c b/src/core/wee-hook.c index db44ba307..4af120833 100644 --- a/src/core/wee-hook.c +++ b/src/core/wee-hook.c @@ -454,13 +454,16 @@ hook_set (struct t_hook *hook, const char *property, const char *value) if (!hook_valid (hook)) return; - if (string_strcmp (property, "subplugin") == 0) + if (!property) + return; + + if (strcmp (property, "subplugin") == 0) { if (hook->subplugin) free (hook->subplugin); hook->subplugin = strdup (value); } - else if (string_strcmp (property, "stdin") == 0) + else if (strcmp (property, "stdin") == 0) { if (!hook->deleted && (hook->type == HOOK_TYPE_PROCESS) @@ -472,7 +475,7 @@ hook_set (struct t_hook *hook, const char *property, const char *value) (void) num_written; } } - else if (string_strcmp (property, "stdin_close") == 0) + else if (strcmp (property, "stdin_close") == 0) { if (!hook->deleted && (hook->type == HOOK_TYPE_PROCESS) @@ -483,7 +486,7 @@ hook_set (struct t_hook *hook, const char *property, const char *value) HOOK_PROCESS(hook, child_write[HOOK_PROCESS_STDIN]) = -1; } } - else if (string_strcmp (property, "signal") == 0) + else if (strcmp (property, "signal") == 0) { if (!hook->deleted && (hook->type == HOOK_TYPE_PROCESS) diff --git a/src/core/wee-infolist.c b/src/core/wee-infolist.c index 9ae9d35a5..b8bdf8764 100644 --- a/src/core/wee-infolist.c +++ b/src/core/wee-infolist.c @@ -366,7 +366,7 @@ infolist_search_var (struct t_infolist *infolist, const char *name) for (ptr_var = infolist->ptr_item->vars; ptr_var; ptr_var = ptr_var->next_var) { - if (string_strcmp (ptr_var->name, name) == 0) + if (strcmp (ptr_var->name, name) == 0) return ptr_var; } @@ -447,7 +447,7 @@ infolist_integer (struct t_infolist *infolist, const char *var) for (ptr_var = infolist->ptr_item->vars; ptr_var; ptr_var = ptr_var->next_var) { - if (string_strcmp (ptr_var->name, var) == 0) + if (strcmp (ptr_var->name, var) == 0) { if (ptr_var->type == INFOLIST_INTEGER) return *((int *)ptr_var->value); @@ -475,7 +475,7 @@ infolist_string (struct t_infolist *infolist, const char *var) for (ptr_var = infolist->ptr_item->vars; ptr_var; ptr_var = ptr_var->next_var) { - if (string_strcmp (ptr_var->name, var) == 0) + if (strcmp (ptr_var->name, var) == 0) { if (ptr_var->type == INFOLIST_STRING) return (char *)ptr_var->value; @@ -503,7 +503,7 @@ infolist_pointer (struct t_infolist *infolist, const char *var) for (ptr_var = infolist->ptr_item->vars; ptr_var; ptr_var = ptr_var->next_var) { - if (string_strcmp (ptr_var->name, var) == 0) + if (strcmp (ptr_var->name, var) == 0) { if (ptr_var->type == INFOLIST_POINTER) return ptr_var->value; @@ -534,7 +534,7 @@ infolist_buffer (struct t_infolist *infolist, const char *var, for (ptr_var = infolist->ptr_item->vars; ptr_var; ptr_var = ptr_var->next_var) { - if (string_strcmp (ptr_var->name, var) == 0) + if (strcmp (ptr_var->name, var) == 0) { if (ptr_var->type == INFOLIST_BUFFER) { @@ -565,7 +565,7 @@ infolist_time (struct t_infolist *infolist, const char *var) for (ptr_var = infolist->ptr_item->vars; ptr_var; ptr_var = ptr_var->next_var) { - if (string_strcmp (ptr_var->name, var) == 0) + if (strcmp (ptr_var->name, var) == 0) { if (ptr_var->type == INFOLIST_TIME) return *((time_t *)ptr_var->value); diff --git a/src/core/wee-proxy.c b/src/core/wee-proxy.c index 0b910930b..c35fea5d4 100644 --- a/src/core/wee-proxy.c +++ b/src/core/wee-proxy.c @@ -203,37 +203,37 @@ proxy_set (struct t_proxy *proxy, const char *property, const char *value) if (!proxy || !property || !value) return 0; - if (string_strcmp (property, "name") == 0) + if (strcmp (property, "name") == 0) { proxy_set_name (proxy, value); return 1; } - else if (string_strcmp (property, "type") == 0) + else if (strcmp (property, "type") == 0) { config_file_option_set (proxy->options[PROXY_OPTION_TYPE], value, 1); return 1; } - else if (string_strcmp (property, "ipv6") == 0) + else if (strcmp (property, "ipv6") == 0) { config_file_option_set (proxy->options[PROXY_OPTION_IPV6], value, 1); return 1; } - else if (string_strcmp (property, "address") == 0) + else if (strcmp (property, "address") == 0) { config_file_option_set (proxy->options[PROXY_OPTION_ADDRESS], value, 1); return 1; } - else if (string_strcmp (property, "port") == 0) + else if (strcmp (property, "port") == 0) { config_file_option_set (proxy->options[PROXY_OPTION_PORT], value, 1); return 1; } - else if (string_strcmp (property, "username") == 0) + else if (strcmp (property, "username") == 0) { config_file_option_set (proxy->options[PROXY_OPTION_USERNAME], value, 1); return 1; } - else if (string_strcmp (property, "password") == 0) + else if (strcmp (property, "password") == 0) { config_file_option_set (proxy->options[PROXY_OPTION_PASSWORD], value, 1); return 1; |