mirror of
https://github.com/weechat/weechat.git
synced 2026-06-12 14:14:48 +02:00
core, plugins: remove unneeded break after return
This commit is contained in:
@@ -2406,7 +2406,6 @@ config_file_option_value_to_string (struct t_config_option *option,
|
||||
(use_colors) ? GUI_COLOR(GUI_COLOR_CHAT_VALUE) : "",
|
||||
(enabled) ? "on" : "off");
|
||||
return value;
|
||||
break;
|
||||
case CONFIG_OPTION_TYPE_INTEGER:
|
||||
length = 31 + ((use_colors) ? 64 : 0) + 1;
|
||||
value = malloc (length);
|
||||
@@ -2417,7 +2416,6 @@ config_file_option_value_to_string (struct t_config_option *option,
|
||||
(use_colors) ? GUI_COLOR(GUI_COLOR_CHAT_VALUE) : "",
|
||||
(default_value) ? CONFIG_INTEGER_DEFAULT(option) : CONFIG_INTEGER(option));
|
||||
return value;
|
||||
break;
|
||||
case CONFIG_OPTION_TYPE_STRING:
|
||||
ptr_value = (default_value) ? CONFIG_STRING_DEFAULT(option) : CONFIG_STRING(option);
|
||||
length = strlen (ptr_value) + ((use_colors) ? 64 : 0) + 1;
|
||||
@@ -2433,7 +2431,6 @@ config_file_option_value_to_string (struct t_config_option *option,
|
||||
(use_colors && use_delimiters) ? GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS) : "",
|
||||
(use_delimiters) ? "\"" : "");
|
||||
return value;
|
||||
break;
|
||||
case CONFIG_OPTION_TYPE_COLOR:
|
||||
ptr_value = gui_color_get_name (
|
||||
(default_value) ? CONFIG_COLOR_DEFAULT(option) : CONFIG_COLOR(option));
|
||||
@@ -2448,7 +2445,6 @@ config_file_option_value_to_string (struct t_config_option *option,
|
||||
(use_colors) ? GUI_COLOR(GUI_COLOR_CHAT_VALUE) : "",
|
||||
ptr_value);
|
||||
return value;
|
||||
break;
|
||||
case CONFIG_OPTION_TYPE_ENUM:
|
||||
ptr_value = (default_value) ?
|
||||
option->string_values[CONFIG_ENUM_DEFAULT(option)] :
|
||||
@@ -2462,7 +2458,6 @@ config_file_option_value_to_string (struct t_config_option *option,
|
||||
(use_colors) ? GUI_COLOR(GUI_COLOR_CHAT_VALUE) : "",
|
||||
ptr_value);
|
||||
return value;
|
||||
break;
|
||||
case CONFIG_NUM_OPTION_TYPES:
|
||||
/* make C compiler happy */
|
||||
break;
|
||||
|
||||
@@ -553,20 +553,16 @@ hashtable_to_string (enum t_hashtable_type type, const void *value)
|
||||
case HASHTABLE_INTEGER:
|
||||
snprintf (str_value, sizeof (str_value), "%d", *((int *)value));
|
||||
return str_value;
|
||||
break;
|
||||
case HASHTABLE_STRING:
|
||||
return (const char *)value;
|
||||
break;
|
||||
case HASHTABLE_POINTER:
|
||||
case HASHTABLE_BUFFER:
|
||||
snprintf (str_value, sizeof (str_value), "%p", value);
|
||||
return str_value;
|
||||
break;
|
||||
case HASHTABLE_TIME:
|
||||
snprintf (str_value, sizeof (str_value),
|
||||
"%lld", (long long)(*((time_t *)value)));
|
||||
return str_value;
|
||||
break;
|
||||
case HASHTABLE_NUM_TYPES:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1240,7 +1240,6 @@ hdata_set (struct t_hdata *hdata, void *pointer, const char *name,
|
||||
case WEECHAT_HDATA_CHAR:
|
||||
*((char *)(pointer + var->offset)) = (value) ? value[0] : '\0';
|
||||
return 1;
|
||||
break;
|
||||
case WEECHAT_HDATA_INTEGER:
|
||||
error = NULL;
|
||||
number = strtol (value, &error, 10);
|
||||
@@ -1273,13 +1272,11 @@ hdata_set (struct t_hdata *hdata, void *pointer, const char *name,
|
||||
free (*ptr_string);
|
||||
*ptr_string = (value) ? strdup (value) : NULL;
|
||||
return 1;
|
||||
break;
|
||||
case WEECHAT_HDATA_SHARED_STRING:
|
||||
ptr_string = (char **)(pointer + var->offset);
|
||||
string_shared_free (*ptr_string);
|
||||
*ptr_string = (value) ? (char *)string_shared_get (value) : NULL;
|
||||
return 1;
|
||||
break;
|
||||
case WEECHAT_HDATA_POINTER:
|
||||
if (value)
|
||||
{
|
||||
|
||||
@@ -359,7 +359,6 @@ gui_chat_string_next_char (struct t_gui_window *window, struct t_gui_line *line,
|
||||
break;
|
||||
default:
|
||||
return (char *)string;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -760,18 +760,15 @@ gui_color_code_size (const char *string)
|
||||
break;
|
||||
}
|
||||
return ptr_string - string;
|
||||
break;
|
||||
case GUI_COLOR_SET_ATTR_CHAR:
|
||||
case GUI_COLOR_REMOVE_ATTR_CHAR:
|
||||
ptr_string++;
|
||||
if (ptr_string[0])
|
||||
ptr_string++;
|
||||
return ptr_string - string;
|
||||
break;
|
||||
case GUI_COLOR_RESET_CHAR:
|
||||
ptr_string++;
|
||||
return ptr_string - string;
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -1668,7 +1668,6 @@ gui_window_search_text (struct t_gui_window *window)
|
||||
window->buffer,
|
||||
(window->buffer->text_search_history == GUI_BUFFER_SEARCH_HISTORY_LOCAL) ?
|
||||
window->buffer->history : gui_history);
|
||||
break;
|
||||
case GUI_BUFFER_NUM_SEARCH:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -214,7 +214,6 @@ exec_decode_color (struct t_exec_cmd *exec_cmd, const char *string)
|
||||
{
|
||||
case EXEC_COLOR_ANSI:
|
||||
return strdup (string);
|
||||
break;
|
||||
case EXEC_COLOR_AUTO:
|
||||
irc_color = (exec_cmd->output_to_buffer || exec_cmd->pipe_command);
|
||||
break;
|
||||
|
||||
@@ -112,10 +112,8 @@ irc_msgbuffer_get_target_buffer (struct t_irc_server *server, const char *nick,
|
||||
{
|
||||
case IRC_MSGBUFFER_TARGET_WEECHAT:
|
||||
return NULL;
|
||||
break;
|
||||
case IRC_MSGBUFFER_TARGET_SERVER:
|
||||
return (server) ? server->buffer : NULL;
|
||||
break;
|
||||
case IRC_MSGBUFFER_TARGET_CURRENT:
|
||||
break;
|
||||
case IRC_MSGBUFFER_TARGET_PRIVATE:
|
||||
@@ -130,7 +128,6 @@ irc_msgbuffer_get_target_buffer (struct t_irc_server *server, const char *nick,
|
||||
break;
|
||||
default:
|
||||
return (server) ? server->buffer : NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
ptr_buffer = weechat_current_buffer ();
|
||||
|
||||
Reference in New Issue
Block a user