From e7d0a2106dd84a3608f7d3ba951e91d494c57f5e Mon Sep 17 00:00:00 2001 From: Twan van Laarhoven Date: Tue, 12 May 2020 17:49:42 +0200 Subject: [PATCH] Fixed warnings --- src/gui/set/console_panel.cpp | 10 +++++----- src/gui/set/console_panel.hpp | 2 +- src/render/text/viewer.cpp | 1 - src/util/error.hpp | 3 ++- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/gui/set/console_panel.cpp b/src/gui/set/console_panel.cpp index a03062b4..6e0ec33f 100644 --- a/src/gui/set/console_panel.cpp +++ b/src/gui/set/console_panel.cpp @@ -49,7 +49,8 @@ class MessageCtrl : public wxPanel { { SetBackgroundStyle(wxBG_STYLE_CUSTOM); // icons - BOOST_STATIC_ASSERT(MESSAGE_TYPE_MAX == 6); + static_assert(MESSAGE_TYPE_MAX == 7); + icons[MESSAGE_NONE] = wxBitmap(); icons[MESSAGE_INPUT] = wxBitmap(load_resource_image(_("message_input"))); icons[MESSAGE_OUTPUT] = wxBitmap(); icons[MESSAGE_INFO] = wxBitmap(load_resource_image(_("message_information"))); @@ -233,7 +234,6 @@ class MessageCtrl : public wxPanel { void draw(wxDC& dc) const { clearDC(dc, wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); dc.SetFont(*wxNORMAL_FONT); - int height = GetClientSize().y; FOR_EACH_CONST(msg, messages) { draw(dc, *msg); } @@ -450,11 +450,11 @@ END_EVENT_TABLE() ConsolePanel::ConsolePanel(Window* parent, int id) : SetWindowPanel(parent, id) + , messages(nullptr) + , entry(nullptr) , is_active_window(false) , blinker_state(0) , blinker_timer(this) - , messages(nullptr) - , entry(nullptr) { // init controls splitter = new wxSplitterWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); @@ -617,7 +617,7 @@ void ConsolePanel::start_blinker() { } void ConsolePanel::stop_blinker() { blinker_state = 0; - new_errors_since_last_view = static_cast(0); + new_errors_since_last_view = MESSAGE_NONE; blinker_timer.Stop(); update_blinker(); } diff --git a/src/gui/set/console_panel.hpp b/src/gui/set/console_panel.hpp index 0ad149b1..39d94d58 100644 --- a/src/gui/set/console_panel.hpp +++ b/src/gui/set/console_panel.hpp @@ -55,7 +55,7 @@ private: // notification of new messages bool is_active_window; - MessageType new_errors_since_last_view; + MessageType new_errors_since_last_view = MESSAGE_NONE; int blinker_state; wxTimer blinker_timer; static const int MAX_BLINKS = 6; diff --git a/src/render/text/viewer.cpp b/src/render/text/viewer.cpp index 2160fbc8..f35cd6da 100644 --- a/src/render/text/viewer.cpp +++ b/src/render/text/viewer.cpp @@ -353,7 +353,6 @@ void update_size(LineLayout& layout, TextViewer::Line const& l) { TextLayoutP TextViewer::extractLayoutInfo() const { // store information about the content/layout TextLayoutP layout = make_intrusive(); - LineBreak last_break = BREAK_LINE; LineLayoutP paragraph, block; for (auto const& l : lines) { LineLayoutP line = make_intrusive(l.width(), l.top, l.line_height, LineLayout::Type::LINE); diff --git a/src/util/error.hpp b/src/util/error.hpp index 03fe8980..b148c5ed 100644 --- a/src/util/error.hpp +++ b/src/util/error.hpp @@ -139,7 +139,8 @@ extern bool write_errors_to_cli; /// Types/levels of (error)messages enum MessageType -{ MESSAGE_INPUT +{ MESSAGE_NONE +, MESSAGE_INPUT , MESSAGE_OUTPUT , MESSAGE_INFO , MESSAGE_WARNING