From 431a9c00a56cf4c603be1cf5f773b193621d8150 Mon Sep 17 00:00:00 2001 From: Kai Blaschke Date: Mon, 19 Feb 2024 16:55:19 +0100 Subject: Fixed a huge amount of Clang warnings On Linux and macOS, using Clang to compile OpenStarbound produces about 400 MB worth of warnings during the build, making the compiler output unreadable and slowing the build down considerably. 99% of the warnings were unqualified uses of std::move and std::forward, which are now all properly qualified. Fixed a few other minor warnings about non-virtual destructors and some uses of std::move preventing copy elision on temporary objects. Most remaining warnings are now unused parameters. --- source/windowing/StarLabelWidget.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'source/windowing/StarLabelWidget.cpp') diff --git a/source/windowing/StarLabelWidget.cpp b/source/windowing/StarLabelWidget.cpp index b55ecc1..35f8618 100644 --- a/source/windowing/StarLabelWidget.cpp +++ b/source/windowing/StarLabelWidget.cpp @@ -10,18 +10,18 @@ LabelWidget::LabelWidget(String text, VerticalAnchor const& vAnchor, Maybe wrapWidth, Maybe lineSpacing) - : m_color(color), + : m_fontMode(FontMode::Normal), + m_color(color), m_hAnchor(hAnchor), m_vAnchor(vAnchor), - m_wrapWidth(move(wrapWidth)), - m_lineSpacing(move(lineSpacing)), - m_fontMode(FontMode::Normal) { + m_wrapWidth(std::move(wrapWidth)), + m_lineSpacing(std::move(lineSpacing)) { auto assets = Root::singleton().assets(); auto fontConfig = assets->json("/interface.config:font"); m_fontSize = fontConfig.getInt("baseSize"); m_processingDirectives = fontConfig.getString("defaultDirectives"); m_font = fontConfig.queryString("defaultFont", ""); - setText(move(text)); + setText(std::move(text)); } String const& LabelWidget::text() const { @@ -33,7 +33,7 @@ Maybe LabelWidget::getTextCharLimit() const { } void LabelWidget::setText(String newText) { - m_text = move(newText); + m_text = std::move(newText); updateTextRegion(); } @@ -47,7 +47,7 @@ void LabelWidget::setFontMode(FontMode fontMode) { } void LabelWidget::setColor(Color newColor) { - m_color = move(newColor); + m_color = std::move(newColor); } void LabelWidget::setAnchor(HorizontalAnchor hAnchor, VerticalAnchor vAnchor) { @@ -57,12 +57,12 @@ void LabelWidget::setAnchor(HorizontalAnchor hAnchor, VerticalAnchor vAnchor) { } void LabelWidget::setWrapWidth(Maybe wrapWidth) { - m_wrapWidth = move(wrapWidth); + m_wrapWidth = std::move(wrapWidth); updateTextRegion(); } void LabelWidget::setLineSpacing(Maybe lineSpacing) { - m_lineSpacing = move(lineSpacing); + m_lineSpacing = std::move(lineSpacing); updateTextRegion(); } -- cgit v1.2.3