From d1574f9d13c226f82180ce4fa1f3b29f1a5b01a1 Mon Sep 17 00:00:00 2001 From: joonicks Date: Wed, 8 Sep 2021 01:31:22 +0200 Subject: [PATCH] insane clang --- src/SystemView.cpp | 8 ++++---- src/collider/Weld.h | 8 ++++---- src/galaxy/SystemPath.cpp | 7 ++++++- src/graphics/opengl/RendererGL.cpp | 4 ++-- src/graphics/opengl/Shader.h | 5 ++++- 5 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/SystemView.cpp b/src/SystemView.cpp index e2e13ea0950..7d9f39d71fd 100644 --- a/src/SystemView.cpp +++ b/src/SystemView.cpp @@ -197,10 +197,10 @@ static vector3d position_of_surface_starport_relative_to_parent(const SystemBody vector3d(0.0, 1.0, 0.0) * // we need the distance to the center of the planet (Pi::game->IsNormalSpace() && Pi::game->GetSpace()->GetStarSystem()->GetPath().IsSameSystem(Pi::game->GetSectorView()->GetSelected()) ? - // if we look at the current system, the relief is known, we take the height from the physical body - Pi::game->GetSpace()->FindBodyForPath(&(starport->GetPath()))->GetPosition().Length() : - // if the remote system - take the radius of the planet - parent->GetRadius()); + // if we look at the current system, the relief is known, we take the height from the physical body + Pi::game->GetSpace()->FindBodyForPath(&(starport->GetPath()))->GetPosition().Length() : + // if the remote system - take the radius of the planet + parent->GetRadius()); } void SystemView::PutBody(const SystemBody *b, const vector3d &offset, const matrix4x4f &trans) diff --git a/src/collider/Weld.h b/src/collider/Weld.h index 4e3353ec9b1..e85d0682173 100644 --- a/src/collider/Weld.h +++ b/src/collider/Weld.h @@ -89,11 +89,11 @@ namespace nv { Uint32 operator()(std::vector &p, std::vector &xrefs) { #pragma message("FIX: warning of data loss (x64)") - const Uint32 N = 0xFFFFFFFF & p.size(); // # of input vertices. - Uint32 outputCount = 0; // # of output vertices - Uint32 hashSize = nextPowerOfTwo(N); // size of the hash table + const Uint32 N = 0xFFFFFFFF & p.size(); // # of input vertices. + Uint32 outputCount = 0; // # of output vertices + Uint32 hashSize = nextPowerOfTwo(N); // size of the hash table Uint32 *hashTable = new Uint32[hashSize + N]; // hash table + linked list - Uint32 *next = hashTable + hashSize; // use bottom part as linked list + Uint32 *next = hashTable + hashSize; // use bottom part as linked list xrefs.resize(N); memset(hashTable, NIL, (hashSize + N) * sizeof(Uint32)); // init hash table (NIL = 0xFFFFFFFF so memset works) diff --git a/src/galaxy/SystemPath.cpp b/src/galaxy/SystemPath.cpp index 4d38e2415e5..a0256ad4f13 100644 --- a/src/galaxy/SystemPath.cpp +++ b/src/galaxy/SystemPath.cpp @@ -27,13 +27,18 @@ static int ParseInt(const std::string &str) int i = 0; try { i = std::stoi(str); +#ifndef __GNUC__ +/* GCC doesnt know pragma warning push/disable/pop */ #pragma message("FIX: warning of unused variable") #pragma warning(push) -#pragma warning(disable: 4101) +#pragma warning(disable : 4101) +#endif /* __GNUC__ */ } catch (const std::invalid_argument &e) { throw SystemPath::ParseFailure(); } +#ifndef __GNUC__ #pragma warning(pop) +#endif /* __GNUC__ */ return i; } diff --git a/src/graphics/opengl/RendererGL.cpp b/src/graphics/opengl/RendererGL.cpp index 7f6644b029b..4c7a3692518 100644 --- a/src/graphics/opengl/RendererGL.cpp +++ b/src/graphics/opengl/RendererGL.cpp @@ -272,8 +272,8 @@ namespace Graphics { if (!m_windowRenderTarget->CheckStatus()) { GLuint status = glCheckFramebufferStatus(GL_FRAMEBUFFER); Log::Fatal("Pioneer window render target is invalid. (Error: {})\n" - "Does your graphics driver support multisample anti-aliasing?\n" - "If this issue persists, try setting AntiAliasingMode=0 in your config file.\n", + "Does your graphics driver support multisample anti-aliasing?\n" + "If this issue persists, try setting AntiAliasingMode=0 in your config file.\n", gl_framebuffer_error_to_string(status)); } diff --git a/src/graphics/opengl/Shader.h b/src/graphics/opengl/Shader.h index c1bc781868e..a8241ba3633 100644 --- a/src/graphics/opengl/Shader.h +++ b/src/graphics/opengl/Shader.h @@ -76,7 +76,10 @@ namespace Graphics { Program *GetProgramForDesc(const MaterialDescriptor &desc); #pragma message("FIX: warning of data loss (x64)") - uint32_t GetNumVariants() const { return 0xFFFFFFFF & m_variants.size(); } + uint32_t GetNumVariants() const + { + return 0xFFFFFFFF & m_variants.size(); + } TextureBindingData GetTextureBindingInfo(size_t name) const; size_t GetNumTextureBindings() const { return m_textureBindingInfo.size(); }