diff options
author | Kai Blaschke <kai.blaschke@kb-dev.net> | 2024-02-19 16:55:19 +0100 |
---|---|---|
committer | Kai Blaschke <kai.blaschke@kb-dev.net> | 2024-02-19 16:55:19 +0100 |
commit | 431a9c00a56cf4c603be1cf5f773b193621d8150 (patch) | |
tree | 95843aeea9fb6dc18279ee05ff6961f40b19798f /source/windowing/StarCanvasWidget.cpp | |
parent | 30e1871d3f44629e00a1f66d8164e3e62c7f889f (diff) |
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.
Diffstat (limited to 'source/windowing/StarCanvasWidget.cpp')
-rw-r--r-- | source/windowing/StarCanvasWidget.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/source/windowing/StarCanvasWidget.cpp b/source/windowing/StarCanvasWidget.cpp index 0c7ea82..16ec994 100644 --- a/source/windowing/StarCanvasWidget.cpp +++ b/source/windowing/StarCanvasWidget.cpp @@ -27,28 +27,28 @@ void CanvasWidget::clear() { } void CanvasWidget::drawImage(String texName, Vec2F const& position, float scale, Vec4B const& color) { - m_renderOps.append(make_tuple(move(texName), position, scale, color, false)); + m_renderOps.append(make_tuple(std::move(texName), position, scale, color, false)); } void CanvasWidget::drawImageCentered(String texName, Vec2F const& position, float scale, Vec4B const& color) { - m_renderOps.append(make_tuple(move(texName), position, scale, color, true)); + m_renderOps.append(make_tuple(std::move(texName), position, scale, color, true)); } void CanvasWidget::drawImageRect(String texName, RectF const& texCoords, RectF const& screenCoords, Vec4B const& color) { - m_renderOps.append(make_tuple(move(texName), texCoords, screenCoords, color)); + m_renderOps.append(make_tuple(std::move(texName), texCoords, screenCoords, color)); } void CanvasWidget::drawDrawable(Drawable drawable, Vec2F const& screenPos) { - m_renderOps.append(make_tuple(move(drawable), screenPos)); + m_renderOps.append(make_tuple(std::move(drawable), screenPos)); } void CanvasWidget::drawDrawables(List<Drawable> drawables, Vec2F const& screenPos) { for (auto& drawable : drawables) - drawDrawable(move(drawable), screenPos); + drawDrawable(std::move(drawable), screenPos); } void CanvasWidget::drawTiledImage(String texName, float textureScale, Vec2D const& offset, RectF const& screenCoords, Vec4B const& color) { - m_renderOps.append(make_tuple(move(texName), textureScale, offset, screenCoords, color)); + m_renderOps.append(make_tuple(std::move(texName), textureScale, offset, screenCoords, color)); } void CanvasWidget::drawLine(Vec2F const& begin, Vec2F const end, Vec4B const& color, float lineWidth) { @@ -68,7 +68,7 @@ void CanvasWidget::drawTriangles(List<tuple<Vec2F, Vec2F, Vec2F>> const& triangl } void CanvasWidget::drawText(String s, TextPositioning position, unsigned fontSize, Vec4B const& color, FontMode mode, float lineSpacing, String font, String processingDirectives) { - m_renderOps.append(make_tuple(move(s), move(position), fontSize, color, mode, lineSpacing, move(font), move(processingDirectives))); + m_renderOps.append(make_tuple(std::move(s), std::move(position), fontSize, color, mode, lineSpacing, std::move(font), std::move(processingDirectives))); } Vec2I CanvasWidget::mousePosition() const { @@ -174,10 +174,10 @@ void CanvasWidget::renderImageRect(Vec2F const& renderingOffset, String const& t void CanvasWidget::renderDrawable(Vec2F const& renderingOffset, Drawable drawable, Vec2F const& screenPos) { auto& context = GuiContext::singleton(); if (m_ignoreInterfaceScale) - context.drawDrawable(move(drawable), renderingOffset + screenPos, 1); + context.drawDrawable(std::move(drawable), renderingOffset + screenPos, 1); else { drawable.scale(context.interfaceScale()); - context.drawDrawable(move(drawable), renderingOffset * context.interfaceScale() + screenPos * context.interfaceScale(), 1); + context.drawDrawable(std::move(drawable), renderingOffset * context.interfaceScale() + screenPos * context.interfaceScale(), 1); } } |