diff --git a/contrib/jenkins/lookup3.h b/contrib/jenkins/lookup3.h index 43a55e54cf9..e7dbd13a0d9 100644 --- a/contrib/jenkins/lookup3.h +++ b/contrib/jenkins/lookup3.h @@ -1,7 +1,8 @@ #ifndef _LOOKUP3_H #define _LOOKUP3_H -#include +#include +#include uint32_t lookup3_hashword( const uint32_t *k, /* the key, an array of uint32_t values */ diff --git a/src/Background.cpp b/src/Background.cpp index bf6447dfe9e..4cf1c00900a 100644 --- a/src/Background.cpp +++ b/src/Background.cpp @@ -367,7 +367,7 @@ namespace Background { RefCountedPtr galaxy; const StarQueryInfo info; - const int32_t starsLimit; + const size_t starsLimit; StarInfo &stars; double &medianBrightness; }; diff --git a/src/SystemView.cpp b/src/SystemView.cpp index 98e3adf6fc3..c2b37140522 100644 --- a/src/SystemView.cpp +++ b/src/SystemView.cpp @@ -306,15 +306,15 @@ SystemMapViewport::SystemMapViewport(GuiApplication *app) : m_app(app), m_renderer(app->GetRenderer()), m_displayMode(SystemView::Mode::Orrery), + m_atlasZoom(1.0f), + m_atlasZoomTo(1.0f), + m_atlasPos(vector2f()), m_showGravpoints(false), m_showL4L5(LAG_OFF), m_shipDrawing(OFF), m_gridDrawing(GridDrawing::OFF), - m_atlasPos(vector2f()), - m_atlasZoom(1.0f), - m_atlasZoomTo(1.0f), - m_rot_y(0), m_rot_x(50), + m_rot_y(0), m_zoom(1.0f / float(AU)), m_trans(0.0), m_transTo(0.0), diff --git a/src/collider/CollisionContact.h b/src/collider/CollisionContact.h index 663f4f6fd97..196f5eeecd5 100644 --- a/src/collider/CollisionContact.h +++ b/src/collider/CollisionContact.h @@ -36,9 +36,9 @@ struct CollisionContact { distance(0), timestep(dt), triIdx(-1), + geomFlag(0), userData1(u1), - userData2(u2), - geomFlag(0) + userData2(u2) {} }; diff --git a/src/collider/GeomTree.cpp b/src/collider/GeomTree.cpp index 4ba679d3e73..d0853f1a81e 100644 --- a/src/collider/GeomTree.cpp +++ b/src/collider/GeomTree.cpp @@ -26,7 +26,7 @@ GeomTree::GeomTree(const int numVerts, const int numTris, const std::vector(vertices.size()) == m_numVertices); + assert(vertices.size() == m_numVertices); m_aabb.min = vector3d(FLT_MAX, FLT_MAX, FLT_MAX); m_aabb.max = vector3d(-FLT_MAX, -FLT_MAX, -FLT_MAX); @@ -133,7 +133,7 @@ GeomTree::GeomTree(const int numVerts, const int numTris, const std::vector> ed.v1i >> ed.v2i >> ed.len >> ed.dir >> ed.triFlag; } } m_vertices.resize(m_numVertices); - for (Sint32 iVert = 0; iVert < m_numVertices; ++iVert) { + for (uint32_t iVert = 0; iVert < m_numVertices; ++iVert) { m_vertices[iVert] = rd.Vector3f(); } - const int numIndicies(m_numTris * 3); + const uint32_t numIndicies(m_numTris * 3); m_indices.resize(numIndicies); - for (Sint32 iIndi = 0; iIndi < numIndicies; ++iIndi) { + for (uint32_t iIndi = 0; iIndi < numIndicies; ++iIndi) { m_indices[iIndi] = rd.Int32(); } m_triFlags.resize(m_numTris); - for (Sint32 iTri = 0; iTri < m_numTris; ++iTri) { + for (uint32_t iTri = 0; iTri < m_numTris; ++iTri) { m_triFlags[iTri] = rd.Int32(); } @@ -209,7 +209,7 @@ GeomTree::GeomTree(Serializer::Reader &rd) // TODO: triangle AABBs should be written to the SGM file similarly to edge AABBs m_triAABBs.reset(new AABBd[m_numTris]); - for (size_t i = 0; i < m_numTris; i++) { + for (uint32_t i = 0; i < m_numTris; i++) { const vector3d v0 = vector3d(m_vertices[m_indices[i * 3 + 0]]); const vector3d v1 = vector3d(m_vertices[m_indices[i * 3 + 1]]); const vector3d v2 = vector3d(m_vertices[m_indices[i * 3 + 2]]); @@ -292,26 +292,26 @@ void GeomTree::Save(Serializer::Writer &wr) const // loaded in future SGM versions rather than being re-computed on each load wr.Int32(m_numEdges); - for (Sint32 iAabb = 0; iAabb < m_numEdges; ++iAabb) { + for (uint32_t iAabb = 0; iAabb < m_numEdges; ++iAabb) { AABBd &aabb = m_edgeAABBs.get()[iAabb]; // Write back an old-style min-max-radius Aabb for compatibility with old SGM versions wr << aabb.min << aabb.max << double(0.0); } - for (Sint32 iEdge = 0; iEdge < m_numEdges; ++iEdge) { + for (uint32_t iEdge = 0; iEdge < m_numEdges; ++iEdge) { auto &ed = m_edges[iEdge]; wr << ed.v1i << ed.v2i << ed.len << ed.dir << ed.triFlag; } - for (Sint32 iVert = 0; iVert < m_numVertices; ++iVert) { + for (uint32_t iVert = 0; iVert < m_numVertices; ++iVert) { wr.Vector3f(m_vertices[iVert]); } - for (Sint32 iIndi = 0; iIndi < (m_numTris * 3); ++iIndi) { + for (uint32_t iIndi = 0; iIndi < (m_numTris * 3); ++iIndi) { wr.Int32(m_indices[iIndi]); } - for (Sint32 iTri = 0; iTri < m_numTris; ++iTri) { + for (uint32_t iTri = 0; iTri < m_numTris; ++iTri) { wr.Int32(m_triFlags[iTri]); } } diff --git a/src/collider/GeomTree.h b/src/collider/GeomTree.h index dc5823bd5c7..8fe1d183a66 100644 --- a/src/collider/GeomTree.h +++ b/src/collider/GeomTree.h @@ -70,9 +70,9 @@ class GeomTree { void RayTriIntersect(int numRays, const vector3f &origin, const vector3f *dirs, int triIdx, isect_t *isects) const; private: - int m_numVertices; - int m_numEdges; - int m_numTris; + uint32_t m_numVertices; + uint32_t m_numEdges; + uint32_t m_numTris; double m_radius; Aabb m_aabb; diff --git a/src/galaxy/StarSystem.cpp b/src/galaxy/StarSystem.cpp index e75dbdffa16..989213d435f 100644 --- a/src/galaxy/StarSystem.cpp +++ b/src/galaxy/StarSystem.cpp @@ -222,6 +222,7 @@ SystemPath StarSystem::GetPathOf(const SystemBody *sbody) const StarSystem::StarSystem(const SystemPath &path, RefCountedPtr galaxy, StarSystemCache *cache, Random &rand) : m_galaxy(galaxy), m_path(path.SystemOnly()), + m_pos(0.0), m_numStars(0), m_isCustom(false), m_faction(nullptr), @@ -229,7 +230,6 @@ StarSystem::StarSystem(const SystemPath &path, RefCountedPtr galaxy, Sta m_exploredTime(0.0), m_econType(GalacticEconomy::InvalidEconomyId), m_seed(0), - m_pos(0.0), m_tradeLevel(GalacticEconomy::Commodities().size() + 1, 0), m_commodityLegal(GalacticEconomy::Commodities().size() + 1, true), m_cache(cache) diff --git a/src/pigui/PerfInfo.cpp b/src/pigui/PerfInfo.cpp index 963ded548cd..de2fbcc51bd 100644 --- a/src/pigui/PerfInfo.cpp +++ b/src/pigui/PerfInfo.cpp @@ -63,12 +63,12 @@ PerfInfo::CounterInfo::CounterInfo(const char *n, const char *u, uint32_t recent } PerfInfo::PerfInfo() : - m_state(new ImGuiState({})), m_fpsCounter("Frame Time", "ms"), m_physCounter("Update Time", "ms"), m_piguiCounter("PiGui Time", "ms"), m_procMemCounter("Process memory usage", "MB", 1), - m_luaMemCounter("Lua memory usage", "MB", 1) + m_luaMemCounter("Lua memory usage", "MB", 1), + m_state(new ImGuiState({})) { } diff --git a/src/pigui/Widgets.cpp b/src/pigui/Widgets.cpp index 78cea44ec69..4126db58f0e 100644 --- a/src/pigui/Widgets.cpp +++ b/src/pigui/Widgets.cpp @@ -82,7 +82,6 @@ int Draw::RadialPopupSelectMenu(const ImVec2 center, const char *popup_id, int m if (drag_angle >= item_inner_ang_min && drag_angle < item_inner_ang_max) hovered = true; } - bool selected = false; int arc_segments = static_cast((64 * item_arc_span / (2 * IM_PI))) + 1; draw_list->_PathArcToN(center, RADIUS_MAX - border_inout, item_outer_ang_min, item_outer_ang_max, arc_segments);