Skip to content

Commit

Permalink
insane clang
Browse files Browse the repository at this point in the history
  • Loading branch information
joonicks committed Sep 7, 2021
1 parent b2ab3ce commit d1574f9
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/SystemView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions src/collider/Weld.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ namespace nv {
Uint32 operator()(std::vector<T> &p, std::vector<Uint32> &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)
Expand Down
7 changes: 6 additions & 1 deletion src/galaxy/SystemPath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions src/graphics/opengl/RendererGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down
5 changes: 4 additions & 1 deletion src/graphics/opengl/Shader.h
Original file line number Diff line number Diff line change
Expand Up @@ -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(); }
Expand Down

0 comments on commit d1574f9

Please sign in to comment.