From 26c01e30c32f6cff9b8f5dbdc03524da1f68b6b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Mon, 10 Jun 2024 15:10:25 +0200 Subject: [PATCH] core, plugins: remove unneeded `break` after `return` --- src/core/core-config-file.c | 5 ----- src/core/core-hashtable.c | 4 ---- src/core/core-hdata.c | 3 --- src/gui/curses/gui-curses-chat.c | 1 - src/gui/gui-color.c | 3 --- src/gui/gui-window.c | 1 - src/plugins/exec/exec.c | 1 - src/plugins/irc/irc-msgbuffer.c | 3 --- 8 files changed, 21 deletions(-) diff --git a/src/core/core-config-file.c b/src/core/core-config-file.c index a76078157..a5de9e92a 100644 --- a/src/core/core-config-file.c +++ b/src/core/core-config-file.c @@ -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; diff --git a/src/core/core-hashtable.c b/src/core/core-hashtable.c index 6adbe3eb2..381a77239 100644 --- a/src/core/core-hashtable.c +++ b/src/core/core-hashtable.c @@ -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; } diff --git a/src/core/core-hdata.c b/src/core/core-hdata.c index ad80ed805..bddae1248 100644 --- a/src/core/core-hdata.c +++ b/src/core/core-hdata.c @@ -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) { diff --git a/src/gui/curses/gui-curses-chat.c b/src/gui/curses/gui-curses-chat.c index 2af70a624..90abc93a9 100644 --- a/src/gui/curses/gui-curses-chat.c +++ b/src/gui/curses/gui-curses-chat.c @@ -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; } } diff --git a/src/gui/gui-color.c b/src/gui/gui-color.c index 8823bde65..ee9cedf26 100644 --- a/src/gui/gui-color.c +++ b/src/gui/gui-color.c @@ -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; diff --git a/src/gui/gui-window.c b/src/gui/gui-window.c index 20ea5464b..8532355d4 100644 --- a/src/gui/gui-window.c +++ b/src/gui/gui-window.c @@ -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; } diff --git a/src/plugins/exec/exec.c b/src/plugins/exec/exec.c index 8d7d4a1f5..a996666dc 100644 --- a/src/plugins/exec/exec.c +++ b/src/plugins/exec/exec.c @@ -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; diff --git a/src/plugins/irc/irc-msgbuffer.c b/src/plugins/irc/irc-msgbuffer.c index 044047b2e..a1ec7028c 100644 --- a/src/plugins/irc/irc-msgbuffer.c +++ b/src/plugins/irc/irc-msgbuffer.c @@ -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 ();