Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/application/StarMainApplication_sdl.cpp
diff options
context:
space:
mode:
authorKai Blaschke <kai.blaschke@kb-dev.net>2024-02-19 16:55:19 +0100
committerKai Blaschke <kai.blaschke@kb-dev.net>2024-02-19 16:55:19 +0100
commit431a9c00a56cf4c603be1cf5f773b193621d8150 (patch)
tree95843aeea9fb6dc18279ee05ff6961f40b19798f /source/application/StarMainApplication_sdl.cpp
parent30e1871d3f44629e00a1f66d8164e3e62c7f889f (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/application/StarMainApplication_sdl.cpp')
-rw-r--r--source/application/StarMainApplication_sdl.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/source/application/StarMainApplication_sdl.cpp b/source/application/StarMainApplication_sdl.cpp
index 48b7fa5..08d3813 100644
--- a/source/application/StarMainApplication_sdl.cpp
+++ b/source/application/StarMainApplication_sdl.cpp
@@ -206,7 +206,7 @@ ControllerButton controllerButtonFromSdlControllerButton(uint8_t button) {
class SdlPlatform {
public:
SdlPlatform(ApplicationUPtr application, StringList cmdLineArgs) {
- m_application = move(application);
+ m_application = std::move(application);
// extract application path from command line args
String applicationPath = cmdLineArgs.first();
@@ -215,7 +215,7 @@ public:
StringList platformArguments;
eraseWhere(cmdLineArgs, [&platformArguments](String& argument) {
if (argument.beginsWith("+platform")) {
- platformArguments.append(move(argument));
+ platformArguments.append(std::move(argument));
return true;
}
return false;
@@ -461,7 +461,7 @@ private:
Maybe<String> string;
if (SDL_HasClipboardText()) {
if (auto text = SDL_GetClipboardText()) {
- if (*text != NULL)
+ if (*text != '\0')
string.emplace(text);
SDL_free(text);
}
@@ -482,7 +482,7 @@ private:
}
void setApplicationTitle(String title) override {
- parent->m_windowTitle = move(title);
+ parent->m_windowTitle = std::move(title);
if (parent->m_sdlWindow)
SDL_SetWindowTitle(parent->m_sdlWindow, parent->m_windowTitle.utf8Ptr());
}
@@ -817,10 +817,10 @@ private:
else
operations = { FlipImageOperation{ FlipImageOperation::Mode::FlipY } };
- auto newImage = std::make_shared<Image>(move(processImageOperations(operations, *image)));
+ auto newImage = std::make_shared<Image>(processImageOperations(operations, *image));
// Fix fully transparent pixels inverting the underlying display pixel on Windows (allowing this could be made configurable per cursor later!)
newImage->forEachPixel([](unsigned x, unsigned y, Vec4B& pixel) { if (!pixel[3]) pixel[0] = pixel[1] = pixel[2] = 0; });
- entry->image = move(newImage);
+ entry->image = std::move(newImage);
auto size = entry->image->size();
@@ -907,7 +907,7 @@ private:
int runMainApplication(ApplicationUPtr application, StringList cmdLineArgs) {
try {
{
- SdlPlatform platform(move(application), move(cmdLineArgs));
+ SdlPlatform platform(std::move(application), std::move(cmdLineArgs));
platform.run();
}
Logger::info("Application: stopped gracefully");