From e7436f20e610679326d4a6de213a5818ad582e5b Mon Sep 17 00:00:00 2001 From: Adrien GIVRY Date: Mon, 24 Nov 2025 17:07:22 -0500 Subject: [PATCH 1/3] Fixed clang warnings --- .../OvCore/Rendering/PostProcess/AEffect.h | 7 ++++- .../Rendering/ReflectionRenderFeature.h | 2 +- .../OvCore/ECS/Components/CAudioSource.cpp | 2 +- .../Rendering/PostProcessRenderPass.cpp | 27 +++++++++++-------- .../src/OvCore/Rendering/SceneRenderer.cpp | 1 + .../ResourceManagement/MaterialManager.cpp | 2 +- .../ResourceManagement/ModelManager.cpp | 6 +++-- .../ResourceManagement/ShaderManager.cpp | 4 ++- .../ResourceManagement/SoundManager.cpp | 4 ++- .../ResourceManagement/TextureManager.cpp | 4 ++- .../OvEditor/Panels/AViewControllable.h | 2 +- .../include/OvEditor/Panels/SceneView.h | 4 +-- .../src/OvEditor/Core/CameraController.cpp | 2 +- .../OvEditor/src/OvEditor/Core/Context.cpp | 2 +- .../src/OvEditor/Core/EditorActions.cpp | 9 +++++-- .../OvEditor/src/OvEditor/Core/ProjectHub.cpp | 15 +++++------ .../src/OvEditor/Panels/AssetView.cpp | 3 +++ .../src/OvEditor/Panels/SceneView.cpp | 3 ++- Sources/OvGame/src/OvGame/Core/Context.cpp | 2 +- Sources/OvMaths/src/OvMaths/FQuaternion.cpp | 2 +- .../OvPhysics/Entities/PhysicalObject.h | 4 +-- .../OvRendering/Core/CompositeRenderer.h | 2 +- .../OvRendering/Core/CompositeRenderer.inl | 2 +- .../OvRendering/Core/CompositeRenderer.cpp | 7 +++-- .../src/OvRendering/Entities/Light.cpp | 3 +-- .../src/OvRendering/Utils/ShaderUtil.cpp | 3 +-- .../OvTools/src/OvTools/Utils/PathParser.cpp | 3 +-- Sources/OvUI/include/OvUI/Plugins/DDSource.h | 5 +++- Sources/OvUI/include/OvUI/Plugins/IPlugin.h | 5 ++++ Sources/OvUI/src/OvUI/Modules/Canvas.cpp | 2 +- .../src/OvUI/Panels/APanelTransformable.cpp | 4 +++ Sources/OvUI/src/OvUI/Widgets/AWidget.cpp | 2 +- Sources/OvUI/src/OvUI/Widgets/Texts/Text.cpp | 2 +- .../src/OvUI/Widgets/Texts/TextColored.cpp | 2 +- .../src/OvUI/Widgets/Texts/TextDisabled.cpp | 2 +- .../src/OvUI/Widgets/Texts/TextLabelled.cpp | 2 +- .../src/OvUI/Widgets/Texts/TextWrapped.cpp | 2 +- 37 files changed, 97 insertions(+), 58 deletions(-) diff --git a/Sources/OvCore/include/OvCore/Rendering/PostProcess/AEffect.h b/Sources/OvCore/include/OvCore/Rendering/PostProcess/AEffect.h index 99f499c52..0377647ac 100644 --- a/Sources/OvCore/include/OvCore/Rendering/PostProcess/AEffect.h +++ b/Sources/OvCore/include/OvCore/Rendering/PostProcess/AEffect.h @@ -32,13 +32,18 @@ namespace OvCore::Rendering::PostProcess */ AEffect(OvRendering::Core::CompositeRenderer& p_renderer); + /** + * Virtual destructor + */ + virtual ~AEffect() = default; + /** * Returns true if the effect is applicable with the given settings. * If the effect is not applicable, it will be skipped by the post processing render pass * @param p_settings */ virtual bool IsApplicable(const EffectSettings& p_settings) const; - + /** * Draw the effect * @note: make sure the effect is applicable before calling this method diff --git a/Sources/OvCore/include/OvCore/Rendering/ReflectionRenderFeature.h b/Sources/OvCore/include/OvCore/Rendering/ReflectionRenderFeature.h index 37cdf09c7..cd878b50b 100644 --- a/Sources/OvCore/include/OvCore/Rendering/ReflectionRenderFeature.h +++ b/Sources/OvCore/include/OvCore/Rendering/ReflectionRenderFeature.h @@ -71,6 +71,6 @@ namespace OvCore::Rendering protected: virtual void OnBeginFrame(const OvRendering::Data::FrameDescriptor& p_frameDescriptor) override; - virtual void OnBeforeDraw(OvRendering::Data::PipelineState& p_pso, const OvRendering::Entities::Drawable& p_drawable); + virtual void OnBeforeDraw(OvRendering::Data::PipelineState& p_pso, const OvRendering::Entities::Drawable& p_drawable) override; }; } diff --git a/Sources/OvCore/src/OvCore/ECS/Components/CAudioSource.cpp b/Sources/OvCore/src/OvCore/ECS/Components/CAudioSource.cpp index d45f59296..5c490498a 100644 --- a/Sources/OvCore/src/OvCore/ECS/Components/CAudioSource.cpp +++ b/Sources/OvCore/src/OvCore/ECS/Components/CAudioSource.cpp @@ -207,7 +207,7 @@ void OvCore::ECS::Components::CAudioSource::OnInspector(OvUI::Internal::WidgetCo { float graphY = graphX < m_audioSource.GetAttenuationThreshold() ? 1.0f : 1.0f / (1.0f + 1.0f * (graphX - m_audioSource.GetAttenuationThreshold())); - if (abs(graphX - distanceToListener) <= 0.25f) + if (std::abs(graphX - distanceToListener) <= 0.25f) { graph.forceHover = static_cast(graphX * 4.0f); graph.overlay = std::to_string(static_cast(graphY * 100.0f)) + "%"; diff --git a/Sources/OvCore/src/OvCore/Rendering/PostProcessRenderPass.cpp b/Sources/OvCore/src/OvCore/Rendering/PostProcessRenderPass.cpp index f1b81faee..7a2d1098c 100644 --- a/Sources/OvCore/src/OvCore/Rendering/PostProcessRenderPass.cpp +++ b/Sources/OvCore/src/OvCore/Rendering/PostProcessRenderPass.cpp @@ -68,18 +68,23 @@ void OvCore::Rendering::PostProcessRenderPass::Draw(OvRendering::Data::PipelineS for (auto& effect : m_effects) { - const auto& settings = stack->Get(typeid(*effect)); - - if (effect && effect->IsApplicable(settings)) + if (effect) { - effect->Draw( - p_pso, - m_pingPongBuffers[0], - m_pingPongBuffers[1], - settings - ); - - ++m_pingPongBuffers; + auto& effectRef = *effect; + const auto& effectType = typeid(effectRef); + const auto& settings = stack->Get(effectType); + + if (effect->IsApplicable(settings)) + { + effect->Draw( + p_pso, + m_pingPongBuffers[0], + m_pingPongBuffers[1], + settings + ); + + ++m_pingPongBuffers; + } } } diff --git a/Sources/OvCore/src/OvCore/Rendering/SceneRenderer.cpp b/Sources/OvCore/src/OvCore/Rendering/SceneRenderer.cpp index dfc5ad7d8..f7266702f 100644 --- a/Sources/OvCore/src/OvCore/Rendering/SceneRenderer.cpp +++ b/Sources/OvCore/src/OvCore/Rendering/SceneRenderer.cpp @@ -297,6 +297,7 @@ SceneRenderer::SceneDrawablesDescriptor OvCore::Rendering::SceneRenderer::ParseS case MESH_BOUNDS: return mesh->GetBoundingSphere(); case DEPRECATED_MODEL_BOUNDS: return model->GetBoundingSphere(); case CUSTOM_BOUNDS: return modelRenderer->GetCustomBoundingSphere(); + default: return std::nullopt; } return std::nullopt; }(); diff --git a/Sources/OvCore/src/OvCore/ResourceManagement/MaterialManager.cpp b/Sources/OvCore/src/OvCore/ResourceManagement/MaterialManager.cpp index 3f810a215..45f51d494 100644 --- a/Sources/OvCore/src/OvCore/ResourceManagement/MaterialManager.cpp +++ b/Sources/OvCore/src/OvCore/ResourceManagement/MaterialManager.cpp @@ -13,7 +13,7 @@ OvCore::Resources::Material * OvCore::ResourceManagement::MaterialManager::Creat Resources::Material* material = OvCore::Resources::Loaders::MaterialLoader::Create(realPath); if (material) { - *reinterpret_cast(reinterpret_cast(material) + offsetof(Resources::Material, path)) = p_path.string(); // Force the resource path to fit the given path + const_cast(material->path) = p_path.string(); // Force the resource path to fit the given path } return material; diff --git a/Sources/OvCore/src/OvCore/ResourceManagement/ModelManager.cpp b/Sources/OvCore/src/OvCore/ResourceManagement/ModelManager.cpp index fc6851df8..00d9b7107 100644 --- a/Sources/OvCore/src/OvCore/ResourceManagement/ModelManager.cpp +++ b/Sources/OvCore/src/OvCore/ResourceManagement/ModelManager.cpp @@ -46,7 +46,7 @@ OvRendering::Resources::Parsers::EModelParserFlags GetAssetMetadata(const std::s if (metaFile.GetOrDefault("DROP_NORMALS", false)) flags |= OvRendering::Resources::Parsers::EModelParserFlags::DROP_NORMALS; if (metaFile.GetOrDefault("GEN_BOUNDING_BOXES", false)) flags |= OvRendering::Resources::Parsers::EModelParserFlags::GEN_BOUNDING_BOXES; - return { flags }; + return flags; } OvRendering::Resources::Model* OvCore::ResourceManagement::ModelManager::CreateResource(const std::filesystem::path& p_path) @@ -54,7 +54,9 @@ OvRendering::Resources::Model* OvCore::ResourceManagement::ModelManager::CreateR std::string realPath = GetRealPath(p_path).string(); auto model = OvRendering::Resources::Loaders::ModelLoader::Create(realPath, GetAssetMetadata(realPath)); if (model) - *reinterpret_cast(reinterpret_cast(model) + offsetof(OvRendering::Resources::Model, path)) = p_path.string(); // Force the resource path to fit the given path + { + const_cast(model->path) = p_path.string(); // Force the resource path to fit the given path + } return model; } diff --git a/Sources/OvCore/src/OvCore/ResourceManagement/ShaderManager.cpp b/Sources/OvCore/src/OvCore/ResourceManagement/ShaderManager.cpp index 79959433c..735980af8 100644 --- a/Sources/OvCore/src/OvCore/ResourceManagement/ShaderManager.cpp +++ b/Sources/OvCore/src/OvCore/ResourceManagement/ShaderManager.cpp @@ -12,7 +12,9 @@ OvRendering::Resources::Shader* OvCore::ResourceManagement::ShaderManager::Creat auto pathParserCallback = [this](const std::string& s) { return GetRealPath(std::filesystem::path{s}).string(); }; OvRendering::Resources::Shader* shader = OvRendering::Resources::Loaders::ShaderLoader::Create(realPath, pathParserCallback); if (shader) - *reinterpret_cast(reinterpret_cast(shader) + offsetof(OvRendering::Resources::Shader, path)) = p_path.string(); // Force the resource path to fit the given path + { + const_cast(shader->path) = p_path.string(); // Force the resource path to fit the given path + } return shader; } diff --git a/Sources/OvCore/src/OvCore/ResourceManagement/SoundManager.cpp b/Sources/OvCore/src/OvCore/ResourceManagement/SoundManager.cpp index 2a53b6e3c..98f7396c1 100644 --- a/Sources/OvCore/src/OvCore/ResourceManagement/SoundManager.cpp +++ b/Sources/OvCore/src/OvCore/ResourceManagement/SoundManager.cpp @@ -11,7 +11,9 @@ OvAudio::Resources::Sound* OvCore::ResourceManagement::SoundManager::CreateResou std::string realPath = GetRealPath(p_path).string(); OvAudio::Resources::Sound* sound = OvAudio::Resources::Loaders::SoundLoader::Create(realPath); if (sound) - *reinterpret_cast(reinterpret_cast(sound) + offsetof(OvAudio::Resources::Sound, path)) = p_path.string(); // Force the resource path to fit the given path + { + const_cast(sound->path) = p_path.string(); // Force the resource path to fit the given path + } return sound; } diff --git a/Sources/OvCore/src/OvCore/ResourceManagement/TextureManager.cpp b/Sources/OvCore/src/OvCore/ResourceManagement/TextureManager.cpp index c3c088b42..ef0209bd3 100644 --- a/Sources/OvCore/src/OvCore/ResourceManagement/TextureManager.cpp +++ b/Sources/OvCore/src/OvCore/ResourceManagement/TextureManager.cpp @@ -56,7 +56,9 @@ OvRendering::Resources::Texture* OvCore::ResourceManagement::TextureManager::Cre ); if (texture) - *reinterpret_cast(reinterpret_cast(texture) + offsetof(OvRendering::Resources::Texture, path)) = p_path.string(); // Force the resource path to fit the given path + { + const_cast(texture->path) = p_path.string(); // Force the resource path to fit the given path + } return texture; } diff --git a/Sources/OvEditor/include/OvEditor/Panels/AViewControllable.h b/Sources/OvEditor/include/OvEditor/Panels/AViewControllable.h index b7b3e0736..cb820b2a1 100644 --- a/Sources/OvEditor/include/OvEditor/Panels/AViewControllable.h +++ b/Sources/OvEditor/include/OvEditor/Panels/AViewControllable.h @@ -50,7 +50,7 @@ namespace OvEditor::Panels /** * Returns the camera used by the camera controller */ - virtual OvRendering::Entities::Camera* GetCamera(); + virtual OvRendering::Entities::Camera* GetCamera() override; /** * Returns the grid color of the view diff --git a/Sources/OvEditor/include/OvEditor/Panels/SceneView.h b/Sources/OvEditor/include/OvEditor/Panels/SceneView.h index 97965b0a0..edaafdf64 100644 --- a/Sources/OvEditor/include/OvEditor/Panels/SceneView.h +++ b/Sources/OvEditor/include/OvEditor/Panels/SceneView.h @@ -41,14 +41,14 @@ namespace OvEditor::Panels /** * Returns the scene used by this view */ - virtual OvCore::SceneSystem::Scene* GetScene(); + virtual OvCore::SceneSystem::Scene* GetScene() override; /** * Set the gizmo operation * @param p_operation */ void SetGizmoOperation(Core::EGizmoOperation p_operation); - + /** * Returns the current gizmo operation */ diff --git a/Sources/OvEditor/src/OvEditor/Core/CameraController.cpp b/Sources/OvEditor/src/OvEditor/Core/CameraController.cpp index 06dc62cd7..a58b14226 100644 --- a/Sources/OvEditor/src/OvEditor/Core/CameraController.cpp +++ b/Sources/OvEditor/src/OvEditor/Core/CameraController.cpp @@ -119,7 +119,7 @@ void OvEditor::Core::CameraController::HandleInputs(float p_deltaTime) { auto camPos = targetPos + offset * dist; auto direction = OvMaths::FVector3::Normalize(targetPos - camPos); - m_camera.SetRotation(OvMaths::FQuaternion::LookAt(direction, abs(direction.y) == 1.0f ? OvMaths::FVector3::Right : OvMaths::FVector3::Up)); + m_camera.SetRotation(OvMaths::FQuaternion::LookAt(direction, std::abs(direction.y) == 1.0f ? OvMaths::FVector3::Right : OvMaths::FVector3::Up)); m_cameraDestinations.push({ camPos, m_camera.GetRotation() }); }; diff --git a/Sources/OvEditor/src/OvEditor/Core/Context.cpp b/Sources/OvEditor/src/OvEditor/Core/Context.cpp index b90471318..729c262d5 100644 --- a/Sources/OvEditor/src/OvEditor/Core/Context.cpp +++ b/Sources/OvEditor/src/OvEditor/Core/Context.cpp @@ -102,7 +102,7 @@ OvEditor::Core::Context::Context(const std::filesystem::path& p_projectFolder) : windowSettings.width = bestFitWindowSizeAndPosition[2]; windowSettings.height = bestFitWindowSizeAndPosition[3]; window = std::make_unique(*device, windowSettings); - std::vector iconRaw = { 0,0,144115188614240000,7500771567664627712,7860776967494637312,0,0,0,0,7212820467466371072,11247766461832697600,14274185407633888512,12905091124788992000,5626708973701824512,514575842263176960,0,0,6564302121125019648,18381468271671515136,18381468271654737920,18237353083595659264,18165295488836311040,6708138037527189504,0,4186681893338480640,7932834557741046016,17876782538917681152,11319824055216379904,15210934132358518784,18381468271520454400,1085667680982603520,0,18093237891929479168,18309410677600032768,11391881649237530624,7932834561381570304,17300321784231761408,15210934132375296000,8293405106311272448,2961143145139082752,16507969723533236736,17516777143216379904,10671305705855129600,7356091234422036224,16580027318695106560,2240567205413984000,18381468271470188544,10959253511276599296,4330520004484136960,10815138323200743424,11607771853338181632,8364614976649238272,17444719546862998784,2669156352,18381468269893064448,6419342512197474304,11103650170688640000,6492244531366860800,14346241902646925312,13841557270159628032,7428148827772098304,3464698581331941120,18381468268953606144,1645680384,18381468271554008832,7140201027266418688,5987558797656659712,17588834734687262208,7284033640602212096,14273902834169157632,18381468269087692288,6852253225049397248,17732667349600245504,16291515470083266560,10022503688432981760,11968059825861367552,9733991836700645376,14850363587428816640,18381468271168132864,16147400282007410688,656430432014827520,18381468270950094848,15715054717226194944,72057596690306560,11823944635485519872,15859169905251653376,17084149004500473856,8581352906816952064,2527949855582584832,18381468271419856896,8581352907253225472,252776704,1376441223417430016,14994761349590357760,10527190521537370112,0,9806614576878321664,18381468271671515136,17156206598538401792,6059619689256392448,10166619973990488064,18381468271403079424,17444719549178451968,420746240,870625192710242304,4906133035823863552,18381468269289150464,18381468271671515136,18381468271671515136,9950729769032620032,14778305994951169792,269422336,0,0,18381468268785833984,8941923452686178304,18381468270950094848,3440842496,1233456333565402880,0,0,0,11823944636091210240,2383877888,16724143605745719296,2316834816,0,0 }; + std::vector iconRaw = { 0,0,144115188614240000ULL,7500771567664627712ULL,7860776967494637312ULL,0,0,0,0,7212820467466371072ULL,11247766461832697600ULL,14274185407633888512ULL,12905091124788992000ULL,5626708973701824512ULL,514575842263176960,0,0,6564302121125019648ULL,18381468271671515136ULL,18381468271654737920ULL,18237353083595659264ULL,18165295488836311040ULL,6708138037527189504ULL,0,4186681893338480640ULL,7932834557741046016ULL,17876782538917681152ULL,11319824055216379904ULL,15210934132358518784ULL,18381468271520454400ULL,1085667680982603520ULL,0,18093237891929479168ULL,18309410677600032768ULL,11391881649237530624ULL,7932834561381570304ULL,17300321784231761408ULL,15210934132375296000ULL,8293405106311272448ULL,2961143145139082752ULL,16507969723533236736ULL,17516777143216379904ULL,10671305705855129600ULL,7356091234422036224ULL,16580027318695106560ULL,2240567205413984000ULL,18381468271470188544ULL,10959253511276599296ULL,4330520004484136960ULL,10815138323200743424ULL,11607771853338181632ULL,8364614976649238272ULL,17444719546862998784ULL,2669156352,18381468269893064448ULL,6419342512197474304ULL,11103650170688640000ULL,6492244531366860800ULL,14346241902646925312ULL,13841557270159628032ULL,7428148827772098304ULL,3464698581331941120ULL,18381468268953606144ULL,1645680384,18381468271554008832ULL,7140201027266418688ULL,5987558797656659712ULL,17588834734687262208ULL,7284033640602212096ULL,14273902834169157632ULL,18381468269087692288ULL,6852253225049397248ULL,17732667349600245504ULL,16291515470083266560ULL,10022503688432981760ULL,11968059825861367552ULL,9733991836700645376ULL,14850363587428816640ULL,18381468271168132864ULL,16147400282007410688ULL,656430432014827520,18381468270950094848ULL,15715054717226194944ULL,72057596690306560,11823944635485519872ULL,15859169905251653376ULL,17084149004500473856ULL,8581352906816952064ULL,2527949855582584832ULL,18381468271419856896ULL,8581352907253225472ULL,252776704,1376441223417430016ULL,14994761349590357760ULL,10527190521537370112ULL,0,9806614576878321664ULL,18381468271671515136ULL,17156206598538401792ULL,6059619689256392448ULL,10166619973990488064ULL,18381468271403079424ULL,17444719549178451968ULL,420746240,870625192710242304,4906133035823863552ULL,18381468269289150464ULL,18381468271671515136ULL,18381468271671515136ULL,9950729769032620032ULL,14778305994951169792ULL,269422336,0,0,18381468268785833984ULL,8941923452686178304ULL,18381468270950094848ULL,3440842496,1233456333565402880ULL,0,0,0,11823944636091210240ULL,2383877888,16724143605745719296ULL,2316834816,0,0 }; window->SetIconFromMemory(reinterpret_cast(iconRaw.data()), 16, 16); inputManager = std::make_unique(*window); window->MakeCurrentContext(); diff --git a/Sources/OvEditor/src/OvEditor/Core/EditorActions.cpp b/Sources/OvEditor/src/OvEditor/Core/EditorActions.cpp index e41b8b22f..8915bee31 100644 --- a/Sources/OvEditor/src/OvEditor/Core/EditorActions.cpp +++ b/Sources/OvEditor/src/OvEditor/Core/EditorActions.cpp @@ -122,10 +122,10 @@ void OvEditor::Core::EditorActions::SaveAs() switch (message.GetUserAction()) { case OvWindowing::Dialogs::MessageBox::EUserAction::YES: break; - case OvWindowing::Dialogs::MessageBox::EUserAction::NO: return; + default: return; } } - + auto currentScene = m_context.sceneManager.GetCurrentScene(); SaveSceneToDisk(*currentScene, dialog.GetSelectedFilePath()); OVLOG_INFO("Current scene saved to: " + dialog.GetSelectedFilePath()); @@ -939,6 +939,8 @@ void OvEditor::Core::EditorActions::PropagateFileRename(std::string p_previousNa { /* If not a real rename is asked (Not delete) */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Winvalid-offsetof" if (OvCore::Global::ServiceLocator::Get().MoveResource(p_previousName, p_newName)) { OvRendering::Resources::Model* resource = OvCore::Global::ServiceLocator::Get()[p_newName]; @@ -968,6 +970,7 @@ void OvEditor::Core::EditorActions::PropagateFileRename(std::string p_previousNa OvAudio::Resources::Sound* resource = OvCore::Global::ServiceLocator::Get()[p_newName]; *reinterpret_cast(reinterpret_cast(resource) + offsetof(OvAudio::Resources::Sound, path)) = p_newName; } +#pragma GCC diagnostic pop } else { @@ -1072,6 +1075,8 @@ void OvEditor::Core::EditorActions::PropagateFileRename(std::string p_previousNa case OvTools::Utils::PathParser::EFileType::SOUND: PropagateFileRenameThroughSavedFilesOfType(p_previousName, p_newName, OvTools::Utils::PathParser::EFileType::SCENE); break; + default: + break; } EDITOR_PANEL(Panels::Inspector, "Inspector").Refresh(); diff --git a/Sources/OvEditor/src/OvEditor/Core/ProjectHub.cpp b/Sources/OvEditor/src/OvEditor/Core/ProjectHub.cpp index d77e32641..e3db7b4c4 100644 --- a/Sources/OvEditor/src/OvEditor/Core/ProjectHub.cpp +++ b/Sources/OvEditor/src/OvEditor/Core/ProjectHub.cpp @@ -144,17 +144,16 @@ namespace OvEditor::Core } }; - deleteButton.ClickedEvent += [this, &text, &actions, project] { - text.Destroy(); - actions.Destroy(); - Utils::ProjectManagement::UnregisterProject(project); - }; + deleteButton.ClickedEvent += [this, &text, &actions, project] { + text.Destroy(); + actions.Destroy(); + Utils::ProjectManagement::UnregisterProject(project); + }; - openButton.lineBreak = false; - deleteButton.lineBreak; + openButton.lineBreak = false; } } - + std::optional GetResult() const { return m_result; diff --git a/Sources/OvEditor/src/OvEditor/Panels/AssetView.cpp b/Sources/OvEditor/src/OvEditor/Panels/AssetView.cpp index 767c51140..8f9c7b180 100644 --- a/Sources/OvEditor/src/OvEditor/Panels/AssetView.cpp +++ b/Sources/OvEditor/src/OvEditor/Panels/AssetView.cpp @@ -83,6 +83,9 @@ OvEditor::Panels::AssetView::AssetView if (auto resource = OvCore::Global::ServiceLocator::Get().GetResource(path); resource) SetMaterial(*resource); break; + + default: + break; } }; } diff --git a/Sources/OvEditor/src/OvEditor/Panels/SceneView.cpp b/Sources/OvEditor/src/OvEditor/Panels/SceneView.cpp index 74929143b..c7a887feb 100644 --- a/Sources/OvEditor/src/OvEditor/Panels/SceneView.cpp +++ b/Sources/OvEditor/src/OvEditor/Panels/SceneView.cpp @@ -61,9 +61,10 @@ OvEditor::Panels::SceneView::SceneView case SCENE: OnSceneDropped(path); break; case MODEL: OnModelDropped(path); break; case MATERIAL: OnMaterialDropped(path); break; + default: break; } }; - + OvCore::ECS::Actor::DestroyedEvent += [this](const OvCore::ECS::Actor& actor) { if (m_highlightedActor.has_value() && m_highlightedActor.value().GetID() == actor.GetID()) diff --git a/Sources/OvGame/src/OvGame/Core/Context.cpp b/Sources/OvGame/src/OvGame/Core/Context.cpp index f23b146a4..6c2f9b4fd 100644 --- a/Sources/OvGame/src/OvGame/Core/Context.cpp +++ b/Sources/OvGame/src/OvGame/Core/Context.cpp @@ -90,7 +90,7 @@ OvGame::Core::Context::Context() : windowSettings.height = bestFitWindowSizeAndPosition[3]; } window = std::make_unique(*device, windowSettings); - auto iconRaw = std::to_array({ 0,0,144115188614240000,7500771567664627712,7860776967494637312,0,0,0,0,7212820467466371072,11247766461832697600,14274185407633888512,12905091124788992000,5626708973701824512,514575842263176960,0,0,6564302121125019648,18381468271671515136,18381468271654737920,18237353083595659264,18165295488836311040,6708138037527189504,0,4186681893338480640,7932834557741046016,17876782538917681152,11319824055216379904,15210934132358518784,18381468271520454400,1085667680982603520,0,18093237891929479168,18309410677600032768,11391881649237530624,7932834561381570304,17300321784231761408,15210934132375296000,8293405106311272448,2961143145139082752,16507969723533236736,17516777143216379904,10671305705855129600,7356091234422036224,16580027318695106560,2240567205413984000,18381468271470188544,10959253511276599296,4330520004484136960,10815138323200743424,11607771853338181632,8364614976649238272,17444719546862998784,2669156352,18381468269893064448,6419342512197474304,11103650170688640000,6492244531366860800,14346241902646925312,13841557270159628032,7428148827772098304,3464698581331941120,18381468268953606144,1645680384,18381468271554008832,7140201027266418688,5987558797656659712,17588834734687262208,7284033640602212096,14273902834169157632,18381468269087692288,6852253225049397248,17732667349600245504,16291515470083266560,10022503688432981760,11968059825861367552,9733991836700645376,14850363587428816640,18381468271168132864,16147400282007410688,656430432014827520,18381468270950094848,15715054717226194944,72057596690306560,11823944635485519872,15859169905251653376,17084149004500473856,8581352906816952064,2527949855582584832,18381468271419856896,8581352907253225472,252776704,1376441223417430016,14994761349590357760,10527190521537370112,0,9806614576878321664,18381468271671515136,17156206598538401792,6059619689256392448,10166619973990488064,18381468271403079424,17444719549178451968,420746240,870625192710242304,4906133035823863552,18381468269289150464,18381468271671515136,18381468271671515136,9950729769032620032,14778305994951169792,269422336,0,0,18381468268785833984,8941923452686178304,18381468270950094848,3440842496,1233456333565402880,0,0,0,11823944636091210240,2383877888,16724143605745719296,2316834816,0,0 }); + auto iconRaw = std::to_array({ 0,0,144115188614240000ULL,7500771567664627712ULL,7860776967494637312ULL,0,0,0,0,7212820467466371072ULL,11247766461832697600ULL,14274185407633888512ULL,12905091124788992000ULL,5626708973701824512ULL,514575842263176960,0,0,6564302121125019648ULL,18381468271671515136ULL,18381468271654737920ULL,18237353083595659264ULL,18165295488836311040ULL,6708138037527189504ULL,0,4186681893338480640ULL,7932834557741046016ULL,17876782538917681152ULL,11319824055216379904ULL,15210934132358518784ULL,18381468271520454400ULL,1085667680982603520ULL,0,18093237891929479168ULL,18309410677600032768ULL,11391881649237530624ULL,7932834561381570304ULL,17300321784231761408ULL,15210934132375296000ULL,8293405106311272448ULL,2961143145139082752ULL,16507969723533236736ULL,17516777143216379904ULL,10671305705855129600ULL,7356091234422036224ULL,16580027318695106560ULL,2240567205413984000ULL,18381468271470188544ULL,10959253511276599296ULL,4330520004484136960ULL,10815138323200743424ULL,11607771853338181632ULL,8364614976649238272ULL,17444719546862998784ULL,2669156352,18381468269893064448ULL,6419342512197474304ULL,11103650170688640000ULL,6492244531366860800ULL,14346241902646925312ULL,13841557270159628032ULL,7428148827772098304ULL,3464698581331941120ULL,18381468268953606144ULL,1645680384,18381468271554008832ULL,7140201027266418688ULL,5987558797656659712ULL,17588834734687262208ULL,7284033640602212096ULL,14273902834169157632ULL,18381468269087692288ULL,6852253225049397248ULL,17732667349600245504ULL,16291515470083266560ULL,10022503688432981760ULL,11968059825861367552ULL,9733991836700645376ULL,14850363587428816640ULL,18381468271168132864ULL,16147400282007410688ULL,656430432014827520,18381468270950094848ULL,15715054717226194944ULL,72057596690306560,11823944635485519872ULL,15859169905251653376ULL,17084149004500473856ULL,8581352906816952064ULL,2527949855582584832ULL,18381468271419856896ULL,8581352907253225472ULL,252776704,1376441223417430016ULL,14994761349590357760ULL,10527190521537370112ULL,0,9806614576878321664ULL,18381468271671515136ULL,17156206598538401792ULL,6059619689256392448ULL,10166619973990488064ULL,18381468271403079424ULL,17444719549178451968ULL,420746240,870625192710242304,4906133035823863552ULL,18381468269289150464ULL,18381468271671515136ULL,18381468271671515136ULL,9950729769032620032ULL,14778305994951169792ULL,269422336,0,0,18381468268785833984ULL,8941923452686178304ULL,18381468270950094848ULL,3440842496,1233456333565402880ULL,0,0,0,11823944636091210240ULL,2383877888,16724143605745719296ULL,2316834816,0,0 }); window->SetIconFromMemory(reinterpret_cast(iconRaw.data()), 16, 16); inputManager = std::make_unique(*window); window->MakeCurrentContext(); diff --git a/Sources/OvMaths/src/OvMaths/FQuaternion.cpp b/Sources/OvMaths/src/OvMaths/FQuaternion.cpp index 28cd8f084..f5f7041bc 100644 --- a/Sources/OvMaths/src/OvMaths/FQuaternion.cpp +++ b/Sources/OvMaths/src/OvMaths/FQuaternion.cpp @@ -237,7 +237,7 @@ bool OvMaths::FQuaternion::IsPure(const FQuaternion & p_target) bool OvMaths::FQuaternion::IsNormalized(const FQuaternion & p_target) { - return abs(Length(p_target) - 1.0f) < 0.0001f; + return std::abs(Length(p_target) - 1.0f) < 0.0001f; } float OvMaths::FQuaternion::DotProduct(const FQuaternion & p_left, const FQuaternion & p_right) diff --git a/Sources/OvPhysics/include/OvPhysics/Entities/PhysicalObject.h b/Sources/OvPhysics/include/OvPhysics/Entities/PhysicalObject.h index 7b42fc1b7..1009a2085 100644 --- a/Sources/OvPhysics/include/OvPhysics/Entities/PhysicalObject.h +++ b/Sources/OvPhysics/include/OvPhysics/Entities/PhysicalObject.h @@ -65,14 +65,14 @@ namespace OvPhysics::Entities /** * PhysicalObject destructor (Free memory if the transform is internally managed) */ - ~PhysicalObject(); + virtual ~PhysicalObject(); /** * Add a force to the physical object * @param p_force */ void AddForce(const OvMaths::FVector3& p_force); - + /** * Add an impulse to the physical object * @param p_impulse diff --git a/Sources/OvRendering/include/OvRendering/Core/CompositeRenderer.h b/Sources/OvRendering/include/OvRendering/Core/CompositeRenderer.h index 97b6ef10a..909f498a3 100644 --- a/Sources/OvRendering/include/OvRendering/Core/CompositeRenderer.h +++ b/Sources/OvRendering/include/OvRendering/Core/CompositeRenderer.h @@ -37,7 +37,7 @@ namespace OvRendering::Core * Begin Frame * @param p_frameDescriptor */ - virtual void BeginFrame(const Data::FrameDescriptor& p_frameDescriptor); + virtual void BeginFrame(const Data::FrameDescriptor& p_frameDescriptor) override; /** * Handle the drawing logic of render pass, invoking DrawPass on the renderer and its diff --git a/Sources/OvRendering/include/OvRendering/Core/CompositeRenderer.inl b/Sources/OvRendering/include/OvRendering/Core/CompositeRenderer.inl index 741cff152..0eeeb5978 100644 --- a/Sources/OvRendering/include/OvRendering/Core/CompositeRenderer.inl +++ b/Sources/OvRendering/include/OvRendering/Core/CompositeRenderer.inl @@ -69,6 +69,6 @@ namespace OvRendering::Core } OVASSERT(true, "Couldn't find a render pass matching the given type T."); - return *static_cast(nullptr); + std::abort(); // Terminate if pass not found } } diff --git a/Sources/OvRendering/src/OvRendering/Core/CompositeRenderer.cpp b/Sources/OvRendering/src/OvRendering/Core/CompositeRenderer.cpp index c47285673..a85009395 100644 --- a/Sources/OvRendering/src/OvRendering/Core/CompositeRenderer.cpp +++ b/Sources/OvRendering/src/OvRendering/Core/CompositeRenderer.cpp @@ -104,9 +104,12 @@ void OvRendering::Core::CompositeRenderer::DrawEntity( return; } + const auto& currentPass = m_currentPass.value(); + const auto& passTypeId = typeid(currentPass); + for (const auto& feature : m_features | std::views::values) { - if (feature->IsEnabledFor(typeid(m_currentPass.value()))) + if (feature->IsEnabledFor(passTypeId)) { feature->OnBeforeDraw(p_pso, p_drawable); } @@ -116,7 +119,7 @@ void OvRendering::Core::CompositeRenderer::DrawEntity( for (const auto& feature : m_features | std::views::values) { - if (feature->IsEnabledFor(typeid(m_currentPass.value()))) + if (feature->IsEnabledFor(passTypeId)) { feature->OnAfterDraw(p_drawable); } diff --git a/Sources/OvRendering/src/OvRendering/Entities/Light.cpp b/Sources/OvRendering/src/OvRendering/Entities/Light.cpp index 5a13eeb90..ad46d2497 100644 --- a/Sources/OvRendering/src/OvRendering/Entities/Light.cpp +++ b/Sources/OvRendering/src/OvRendering/Entities/Light.cpp @@ -220,7 +220,6 @@ float OvRendering::Entities::Light::CalculateEffectRange() const case Settings::ELightType::SPOT: return CalculatePointLightRadius(constant, linear, quadratic, intensity); case Settings::ELightType::AMBIENT_BOX: return CalculateAmbientBoxLightRadius(transform.Get().GetWorldPosition(), {constant, linear, quadratic}); case Settings::ELightType::AMBIENT_SPHERE: return constant; + default: return std::numeric_limits::infinity(); } - - return std::numeric_limits::infinity(); } diff --git a/Sources/OvRendering/src/OvRendering/Utils/ShaderUtil.cpp b/Sources/OvRendering/src/OvRendering/Utils/ShaderUtil.cpp index 3e91d0307..fe19c7cbb 100644 --- a/Sources/OvRendering/src/OvRendering/Utils/ShaderUtil.cpp +++ b/Sources/OvRendering/src/OvRendering/Utils/ShaderUtil.cpp @@ -14,8 +14,7 @@ namespace OvRendering::Utils { case OvRendering::Settings::EShaderType::VERTEX: return "Vertex"; case OvRendering::Settings::EShaderType::FRAGMENT: return "Fragment"; + default: return "None"; } - - return "None"; } } diff --git a/Sources/OvTools/src/OvTools/Utils/PathParser.cpp b/Sources/OvTools/src/OvTools/Utils/PathParser.cpp index 6ef8ba696..3a5cf5a57 100644 --- a/Sources/OvTools/src/OvTools/Utils/PathParser.cpp +++ b/Sources/OvTools/src/OvTools/Utils/PathParser.cpp @@ -94,9 +94,8 @@ std::string OvTools::Utils::PathParser::FileTypeToString(EFileType p_fileType) case OvTools::Utils::PathParser::EFileType::SCENE: return "Scene"; case OvTools::Utils::PathParser::EFileType::SCRIPT: return "Script"; case OvTools::Utils::PathParser::EFileType::FONT: return "Font"; + default: return "Unknown"; } - - return "Unknown"; } OvTools::Utils::PathParser::EFileType OvTools::Utils::PathParser::GetFileType(const std::string & p_path) diff --git a/Sources/OvUI/include/OvUI/Plugins/DDSource.h b/Sources/OvUI/include/OvUI/Plugins/DDSource.h index 3e301fdb0..b788103f3 100644 --- a/Sources/OvUI/include/OvUI/Plugins/DDSource.h +++ b/Sources/OvUI/include/OvUI/Plugins/DDSource.h @@ -58,7 +58,10 @@ namespace OvUI::Plugins m_isDragged = true; if (!(src_flags & ImGuiDragDropFlags_SourceNoPreviewTooltip)) - ImGui::Text(tooltip.c_str()); + { + ImGui::Text("%s", tooltip.c_str()); + } + ImGui::SetDragDropPayload(identifier.c_str(), &data, sizeof(data)); ImGui::EndDragDropSource(); } diff --git a/Sources/OvUI/include/OvUI/Plugins/IPlugin.h b/Sources/OvUI/include/OvUI/Plugins/IPlugin.h index 55075ead7..5ae2643c1 100644 --- a/Sources/OvUI/include/OvUI/Plugins/IPlugin.h +++ b/Sources/OvUI/include/OvUI/Plugins/IPlugin.h @@ -24,6 +24,11 @@ namespace OvUI::Plugins class IPlugin { public: + /** + * Virtual destructor + */ + virtual ~IPlugin() = default; + /** * Execute the plugin behaviour * @param p_context diff --git a/Sources/OvUI/src/OvUI/Modules/Canvas.cpp b/Sources/OvUI/src/OvUI/Modules/Canvas.cpp index 8a7ef27fb..5c3529919 100644 --- a/Sources/OvUI/src/OvUI/Modules/Canvas.cpp +++ b/Sources/OvUI/src/OvUI/Modules/Canvas.cpp @@ -28,7 +28,7 @@ void OvUI::Modules::Canvas::Draw() ImGui::Begin("##dockspace", nullptr, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_MenuBar | ImGuiWindowFlags_NoDocking); ImGuiID dockspace_id = ImGui::GetID("MyDockspace"); - ImGui::DockSpace(dockspace_id, ImVec2(0.0f, 0.0f), ImGuiDockNodeFlags_PassthruCentralNode | ImGuiDockNodeFlags_NoWindowMenuButton); + ImGui::DockSpace(dockspace_id, ImVec2(0.0f, 0.0f), static_cast(static_cast(ImGuiDockNodeFlags_PassthruCentralNode) | static_cast(ImGuiDockNodeFlags_NoWindowMenuButton))); ImGui::SetWindowPos({ 0.f, 0.f }); ImVec2 displaySize = ImGui::GetIO().DisplaySize; ImGui::SetWindowSize({ (float)displaySize.x, (float)displaySize.y }); diff --git a/Sources/OvUI/src/OvUI/Panels/APanelTransformable.cpp b/Sources/OvUI/src/OvUI/Panels/APanelTransformable.cpp index 52a9747c1..d41b4f565 100644 --- a/Sources/OvUI/src/OvUI/Panels/APanelTransformable.cpp +++ b/Sources/OvUI/src/OvUI/Panels/APanelTransformable.cpp @@ -130,6 +130,8 @@ OvMaths::FVector2 OvUI::Panels::APanelTransformable::CalculatePositionAlignmentO case OvUI::Settings::EHorizontalAlignment::RIGHT: result.x -= m_size.x; break; + default: + break; } switch (p_default ? m_defaultVerticalAlignment : m_verticalAlignment) @@ -140,6 +142,8 @@ OvMaths::FVector2 OvUI::Panels::APanelTransformable::CalculatePositionAlignmentO case OvUI::Settings::EVerticalAlignment::BOTTOM: result.y -= m_size.y; break; + default: + break; } return result; diff --git a/Sources/OvUI/src/OvUI/Widgets/AWidget.cpp b/Sources/OvUI/src/OvUI/Widgets/AWidget.cpp index 5218f2833..d99270506 100644 --- a/Sources/OvUI/src/OvUI/Widgets/AWidget.cpp +++ b/Sources/OvUI/src/OvUI/Widgets/AWidget.cpp @@ -60,7 +60,7 @@ void OvUI::Widgets::AWidget::Draw() { if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { - ImGui::SetTooltip(tooltip.c_str()); + ImGui::SetTooltip("%s", tooltip.c_str()); } } diff --git a/Sources/OvUI/src/OvUI/Widgets/Texts/Text.cpp b/Sources/OvUI/src/OvUI/Widgets/Texts/Text.cpp index e5d2a218a..7771c1f80 100644 --- a/Sources/OvUI/src/OvUI/Widgets/Texts/Text.cpp +++ b/Sources/OvUI/src/OvUI/Widgets/Texts/Text.cpp @@ -16,5 +16,5 @@ OvUI::Widgets::Texts::Text::Text(const std::string & p_content) : void OvUI::Widgets::Texts::Text::_Draw_Impl() { - ImGui::Text(content.c_str()); + ImGui::Text("%s", content.c_str()); } diff --git a/Sources/OvUI/src/OvUI/Widgets/Texts/TextColored.cpp b/Sources/OvUI/src/OvUI/Widgets/Texts/TextColored.cpp index ca3b9e17c..c6d2d1591 100644 --- a/Sources/OvUI/src/OvUI/Widgets/Texts/TextColored.cpp +++ b/Sources/OvUI/src/OvUI/Widgets/Texts/TextColored.cpp @@ -14,5 +14,5 @@ OvUI::Widgets::Texts::TextColored::TextColored(const std::string& p_content, con void OvUI::Widgets::Texts::TextColored::_Draw_Impl() { - ImGui::TextColored(Internal::Converter::ToImVec4(color), content.c_str()); + ImGui::TextColored(Internal::Converter::ToImVec4(color), "%s", content.c_str()); } diff --git a/Sources/OvUI/src/OvUI/Widgets/Texts/TextDisabled.cpp b/Sources/OvUI/src/OvUI/Widgets/Texts/TextDisabled.cpp index 64c061897..83e93a138 100644 --- a/Sources/OvUI/src/OvUI/Widgets/Texts/TextDisabled.cpp +++ b/Sources/OvUI/src/OvUI/Widgets/Texts/TextDisabled.cpp @@ -15,5 +15,5 @@ OvUI::Widgets::Texts::TextDisabled::TextDisabled(const std::string & p_content) void OvUI::Widgets::Texts::TextDisabled::_Draw_Impl() { - ImGui::TextDisabled(content.c_str()); + ImGui::TextDisabled("%s", content.c_str()); } diff --git a/Sources/OvUI/src/OvUI/Widgets/Texts/TextLabelled.cpp b/Sources/OvUI/src/OvUI/Widgets/Texts/TextLabelled.cpp index 12cd3d0aa..33dfb4835 100644 --- a/Sources/OvUI/src/OvUI/Widgets/Texts/TextLabelled.cpp +++ b/Sources/OvUI/src/OvUI/Widgets/Texts/TextLabelled.cpp @@ -15,5 +15,5 @@ OvUI::Widgets::Texts::TextLabelled::TextLabelled(const std::string& p_content, c void OvUI::Widgets::Texts::TextLabelled::_Draw_Impl() { - ImGui::LabelText((label + m_widgetID).c_str(), content.c_str()); + ImGui::LabelText((label + m_widgetID).c_str(), "%s", content.c_str()); } diff --git a/Sources/OvUI/src/OvUI/Widgets/Texts/TextWrapped.cpp b/Sources/OvUI/src/OvUI/Widgets/Texts/TextWrapped.cpp index dbb465d88..f315b8af2 100644 --- a/Sources/OvUI/src/OvUI/Widgets/Texts/TextWrapped.cpp +++ b/Sources/OvUI/src/OvUI/Widgets/Texts/TextWrapped.cpp @@ -15,5 +15,5 @@ OvUI::Widgets::Texts::TextWrapped::TextWrapped(const std::string & p_content) : void OvUI::Widgets::Texts::TextWrapped::_Draw_Impl() { - ImGui::TextWrapped(content.c_str()); + ImGui::TextWrapped("%s", content.c_str()); } From f07d79df47933e85d46fb2bbd295c4c942d452f6 Mon Sep 17 00:00:00 2001 From: Adrien GIVRY Date: Tue, 25 Nov 2025 13:54:53 -0500 Subject: [PATCH 2/3] Warnings are now fatal --- Sources/OvAudio/premake5.lua | 1 + Sources/OvCore/premake5.lua | 1 + Sources/OvDebug/premake5.lua | 1 + Sources/OvEditor/premake5.lua | 1 + Sources/OvGame/premake5.lua | 1 + Sources/OvMaths/premake5.lua | 1 + Sources/OvPhysics/premake5.lua | 1 + Sources/OvRendering/premake5.lua | 1 + Sources/OvTools/premake5.lua | 1 + Sources/OvUI/premake5.lua | 1 + Sources/OvWindowing/premake5.lua | 1 + 11 files changed, 11 insertions(+) diff --git a/Sources/OvAudio/premake5.lua b/Sources/OvAudio/premake5.lua index 6fdc70aa1..85bf7ec27 100644 --- a/Sources/OvAudio/premake5.lua +++ b/Sources/OvAudio/premake5.lua @@ -4,6 +4,7 @@ project "OvAudio" cppdialect "C++20" targetdir (outputdir .. "%{cfg.buildcfg}/%{prj.name}") objdir (objoutdir .. "%{cfg.buildcfg}/%{prj.name}") + fatalwarnings { "All" } files { "**.h", diff --git a/Sources/OvCore/premake5.lua b/Sources/OvCore/premake5.lua index 9c7b91c99..2848b1263 100644 --- a/Sources/OvCore/premake5.lua +++ b/Sources/OvCore/premake5.lua @@ -4,6 +4,7 @@ project "OvCore" cppdialect "C++20" targetdir (outputdir .. "%{cfg.buildcfg}/%{prj.name}") objdir (objoutdir .. "%{cfg.buildcfg}/%{prj.name}") + fatalwarnings { "All" } -- If MSVC, set big obj flag filter { "toolset:msc" } diff --git a/Sources/OvDebug/premake5.lua b/Sources/OvDebug/premake5.lua index 083d5b2cb..a2968ab3a 100644 --- a/Sources/OvDebug/premake5.lua +++ b/Sources/OvDebug/premake5.lua @@ -4,6 +4,7 @@ project "OvDebug" cppdialect "C++20" targetdir (outputdir .. "%{cfg.buildcfg}/%{prj.name}") objdir (objoutdir .. "%{cfg.buildcfg}/%{prj.name}") + fatalwarnings { "All" } files { "**.h", diff --git a/Sources/OvEditor/premake5.lua b/Sources/OvEditor/premake5.lua index d3caf81d2..f6e7e854d 100644 --- a/Sources/OvEditor/premake5.lua +++ b/Sources/OvEditor/premake5.lua @@ -4,6 +4,7 @@ project "OvEditor" targetdir (outputdir .. "%{cfg.buildcfg}/%{prj.name}") objdir (objoutdir .. "%{cfg.buildcfg}/%{prj.name}") debugdir "%{wks.location}/Build/%{cfg.buildcfg}" + fatalwarnings { "All" } files { "**.h", diff --git a/Sources/OvGame/premake5.lua b/Sources/OvGame/premake5.lua index 1af6029c5..f4d1b773a 100644 --- a/Sources/OvGame/premake5.lua +++ b/Sources/OvGame/premake5.lua @@ -4,6 +4,7 @@ project "OvGame" targetdir (outputdir .. "%{cfg.buildcfg}/%{prj.name}") objdir (objoutdir .. "%{cfg.buildcfg}/%{prj.name}") debugdir (outputdir .. "%{cfg.buildcfg}/%{prj.name}") + fatalwarnings { "All" } files { "**.h", diff --git a/Sources/OvMaths/premake5.lua b/Sources/OvMaths/premake5.lua index 1836743af..a02a1d63d 100644 --- a/Sources/OvMaths/premake5.lua +++ b/Sources/OvMaths/premake5.lua @@ -4,6 +4,7 @@ project "OvMaths" cppdialect "C++20" targetdir (outputdir .. "%{cfg.buildcfg}/%{prj.name}") objdir (objoutdir .. "%{cfg.buildcfg}/%{prj.name}") + fatalwarnings { "All" } files { "**.h", diff --git a/Sources/OvPhysics/premake5.lua b/Sources/OvPhysics/premake5.lua index b465da3b8..e6ca0799a 100644 --- a/Sources/OvPhysics/premake5.lua +++ b/Sources/OvPhysics/premake5.lua @@ -4,6 +4,7 @@ project "OvPhysics" cppdialect "C++20" targetdir (outputdir .. "%{cfg.buildcfg}/%{prj.name}") objdir (objoutdir .. "%{cfg.buildcfg}/%{prj.name}") + fatalwarnings { "All" } files { "**.h", diff --git a/Sources/OvRendering/premake5.lua b/Sources/OvRendering/premake5.lua index 7d37f6600..d189a71b8 100644 --- a/Sources/OvRendering/premake5.lua +++ b/Sources/OvRendering/premake5.lua @@ -4,6 +4,7 @@ project "OvRendering" cppdialect "C++20" targetdir (outputdir .. "%{cfg.buildcfg}/%{prj.name}") objdir (objoutdir .. "%{cfg.buildcfg}/%{prj.name}") + fatalwarnings { "All" } files { "**.h", diff --git a/Sources/OvTools/premake5.lua b/Sources/OvTools/premake5.lua index eee4e8012..03d15c1cb 100644 --- a/Sources/OvTools/premake5.lua +++ b/Sources/OvTools/premake5.lua @@ -4,6 +4,7 @@ project "OvTools" cppdialect "C++20" targetdir (outputdir .. "%{cfg.buildcfg}/%{prj.name}") objdir (objoutdir .. "%{cfg.buildcfg}/%{prj.name}") + fatalwarnings { "All" } files { "**.h", diff --git a/Sources/OvUI/premake5.lua b/Sources/OvUI/premake5.lua index 31b9f50c3..70333cfc6 100644 --- a/Sources/OvUI/premake5.lua +++ b/Sources/OvUI/premake5.lua @@ -4,6 +4,7 @@ project "OvUI" cppdialect "C++20" targetdir (outputdir .. "%{cfg.buildcfg}/%{prj.name}") objdir (objoutdir .. "%{cfg.buildcfg}/%{prj.name}") + fatalwarnings { "All" } files { "**.h", diff --git a/Sources/OvWindowing/premake5.lua b/Sources/OvWindowing/premake5.lua index 073a950c5..953c5507e 100644 --- a/Sources/OvWindowing/premake5.lua +++ b/Sources/OvWindowing/premake5.lua @@ -4,6 +4,7 @@ project "OvWindowing" cppdialect "C++20" targetdir (outputdir .. "%{cfg.buildcfg}/%{prj.name}") objdir (objoutdir .. "%{cfg.buildcfg}/%{prj.name}") + fatalwarnings { "All" } files { "**.h", From 42ade66a51966688179399f60ba468ab98db50e3 Mon Sep 17 00:00:00 2001 From: Adrien GIVRY Date: Mon, 1 Dec 2025 17:05:54 -0500 Subject: [PATCH 3/3] Removed #pragma GCC in favor of proper const_casts --- .../OvEditor/src/OvEditor/Core/EditorActions.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Sources/OvEditor/src/OvEditor/Core/EditorActions.cpp b/Sources/OvEditor/src/OvEditor/Core/EditorActions.cpp index 8915bee31..c44f2e230 100644 --- a/Sources/OvEditor/src/OvEditor/Core/EditorActions.cpp +++ b/Sources/OvEditor/src/OvEditor/Core/EditorActions.cpp @@ -939,38 +939,35 @@ void OvEditor::Core::EditorActions::PropagateFileRename(std::string p_previousNa { /* If not a real rename is asked (Not delete) */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Winvalid-offsetof" if (OvCore::Global::ServiceLocator::Get().MoveResource(p_previousName, p_newName)) { OvRendering::Resources::Model* resource = OvCore::Global::ServiceLocator::Get()[p_newName]; - *reinterpret_cast(reinterpret_cast(resource) + offsetof(OvRendering::Resources::Model, path)) = p_newName; + const_cast(resource->path) = p_newName; } if (OvCore::Global::ServiceLocator::Get().MoveResource(p_previousName, p_newName)) { OvRendering::Resources::Texture* resource = OvCore::Global::ServiceLocator::Get()[p_newName]; - *reinterpret_cast(reinterpret_cast(resource) + offsetof(OvRendering::Resources::Texture, path)) = p_newName; + const_cast(resource->path) = p_newName; } if (OvCore::Global::ServiceLocator::Get().MoveResource(p_previousName, p_newName)) { OvRendering::Resources::Shader* resource = OvCore::Global::ServiceLocator::Get()[p_newName]; - *reinterpret_cast(reinterpret_cast(resource) + offsetof(OvRendering::Resources::Shader, path)) = p_newName; + const_cast(resource->path) = p_newName; } if (OvCore::Global::ServiceLocator::Get().MoveResource(p_previousName, p_newName)) { OvCore::Resources::Material* resource = OvCore::Global::ServiceLocator::Get()[p_newName]; - *reinterpret_cast(reinterpret_cast(resource) + offsetof(OvCore::Resources::Material, path)) = p_newName; + const_cast(resource->path) = p_newName; } if (OvCore::Global::ServiceLocator::Get().MoveResource(p_previousName, p_newName)) { OvAudio::Resources::Sound* resource = OvCore::Global::ServiceLocator::Get()[p_newName]; - *reinterpret_cast(reinterpret_cast(resource) + offsetof(OvAudio::Resources::Sound, path)) = p_newName; + const_cast(resource->path) = p_newName; } -#pragma GCC diagnostic pop } else {