From 52ed3bcbaa88717ab50f71150ed9fc0b6af4715a Mon Sep 17 00:00:00 2001 From: Charles Pigott Date: Sun, 14 Oct 2018 19:31:14 +0100 Subject: Remove: A few bits of dead code --- src/music_gui.cpp | 1 - src/news_type.h | 13 ------------- src/rail_cmd.cpp | 4 +--- src/string.cpp | 3 +-- src/viewport.cpp | 1 - src/water_cmd.cpp | 4 ++-- 6 files changed, 4 insertions(+), 22 deletions(-) diff --git a/src/music_gui.cpp b/src/music_gui.cpp index e7552fe02..7bf08fd1d 100644 --- a/src/music_gui.cpp +++ b/src/music_gui.cpp @@ -592,7 +592,6 @@ struct MusicTrackSelectionWindow : public Window { break; default: NOT_REACHED(); - break; } } }; diff --git a/src/news_type.h b/src/news_type.h index fee7ae38e..cad15ecbe 100644 --- a/src/news_type.h +++ b/src/news_type.h @@ -17,19 +17,6 @@ #include "strings_type.h" #include "sound_type.h" -/** Constants in the message options window. */ -enum MessageOptionsSpace { - MOS_WIDG_PER_SETTING = 4, ///< Number of widgets needed for each news category, starting at widget #WID_MO_START_OPTION. - - MOS_LEFT_EDGE = 6, ///< Number of pixels between left edge of the window and the options buttons column. - MOS_COLUMN_SPACING = 4, ///< Number of pixels between the buttons and the description columns. - MOS_RIGHT_EDGE = 6, ///< Number of pixels between right edge of the window and the options descriptions column. - MOS_BUTTON_SPACE = 10, ///< Additional space in the button with the option value (for better looks). - - MOS_ABOVE_GLOBAL_SETTINGS = 6, ///< Number of vertical pixels between the categories and the global options. - MOS_BOTTOM_EDGE = 6, ///< Number of pixels between bottom edge of the window and bottom of the global options. -}; - /** * Type of news. */ diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index d5194e0c3..a0fd968cc 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -2897,11 +2897,9 @@ int TicksToLeaveDepot(const Train *v) case DIAGDIR_NE: return ((int)(v->x_pos & 0x0F) - ((_fractcoords_enter[dir] & 0x0F) - (length + 1))); case DIAGDIR_SE: return -((int)(v->y_pos & 0x0F) - ((_fractcoords_enter[dir] >> 4) + (length + 1))); case DIAGDIR_SW: return -((int)(v->x_pos & 0x0F) - ((_fractcoords_enter[dir] & 0x0F) + (length + 1))); - default: case DIAGDIR_NW: return ((int)(v->y_pos & 0x0F) - ((_fractcoords_enter[dir] >> 4) - (length + 1))); + default: NOT_REACHED(); } - - return 0; // make compilers happy } /** diff --git a/src/string.cpp b/src/string.cpp index 521d96c4a..66140b7d4 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -351,9 +351,8 @@ bool IsValidChar(WChar key, CharSetFilter afilter) case CS_NUMERAL_SPACE: return (key >= '0' && key <= '9') || key == ' '; case CS_ALPHA: return IsPrintable(key) && !(key >= '0' && key <= '9'); case CS_HEXADECIMAL: return (key >= '0' && key <= '9') || (key >= 'a' && key <= 'f') || (key >= 'A' && key <= 'F'); + default: NOT_REACHED(); } - - return false; } #ifdef WIN32 diff --git a/src/viewport.cpp b/src/viewport.cpp index 6e7dfc495..13f87de1d 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -2445,7 +2445,6 @@ void UpdateTileSelection() break; default: NOT_REACHED(); - break; } _thd.new_pos.x = x1 & ~TILE_UNIT_MASK; _thd.new_pos.y = y1 & ~TILE_UNIT_MASK; diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp index 737257a82..31dafe57f 100644 --- a/src/water_cmd.cpp +++ b/src/water_cmd.cpp @@ -895,7 +895,7 @@ static void GetTileDesc_Water(TileIndex tile, TileDesc *td) case WATER_CLASS_SEA: td->str = STR_LAI_WATER_DESCRIPTION_WATER; break; case WATER_CLASS_CANAL: td->str = STR_LAI_WATER_DESCRIPTION_CANAL; break; case WATER_CLASS_RIVER: td->str = STR_LAI_WATER_DESCRIPTION_RIVER; break; - default: NOT_REACHED(); break; + default: NOT_REACHED(); } break; case WATER_TILE_COAST: td->str = STR_LAI_WATER_DESCRIPTION_COAST_OR_RIVERBANK; break; @@ -904,7 +904,7 @@ static void GetTileDesc_Water(TileIndex tile, TileDesc *td) td->str = STR_LAI_WATER_DESCRIPTION_SHIP_DEPOT; td->build_date = Depot::GetByTile(tile)->build_date; break; - default: NOT_REACHED(); break; + default: NOT_REACHED(); } td->owner[0] = GetTileOwner(tile); -- cgit v1.2.3-70-g09d2