7 Commits

Author SHA1 Message Date
5829530652 Use optional for Singleton
All checks were successful
Bigfoot / Build & Test Debug (Unity Build: OFF) (push) Successful in 26s
Bigfoot / Build & Test Debug (Unity Build: ON) (push) Successful in 25s
Bigfoot / Build & Test RelWithDebInfo (Unity Build: OFF) (push) Successful in 24s
Bigfoot / Build & Test RelWithDebInfo (Unity Build: ON) (push) Successful in 25s
Bigfoot / Build & Test Release (Unity Build: OFF) (push) Successful in 20s
Bigfoot / Build & Test Release (Unity Build: ON) (push) Successful in 19s
Bigfoot / Clang Format Checks (push) Successful in 10s
Bigfoot / Sonarqube (push) Successful in 1m4s
2026-02-02 08:13:26 +01:00
a062a058cd Reworked SonarQube trigger
All checks were successful
Bigfoot / Build & Test Debug (Unity Build: OFF) (push) Successful in 25s
Bigfoot / Build & Test Debug (Unity Build: ON) (push) Successful in 23s
Bigfoot / Build & Test RelWithDebInfo (Unity Build: OFF) (push) Successful in 25s
Bigfoot / Build & Test RelWithDebInfo (Unity Build: ON) (push) Successful in 24s
Bigfoot / Build & Test Release (Unity Build: OFF) (push) Successful in 21s
Bigfoot / Build & Test Release (Unity Build: ON) (push) Successful in 19s
Bigfoot / Clang Format Checks (push) Successful in 11s
Bigfoot / Sonarqube (push) Successful in 1m5s
2026-02-02 07:46:58 +01:00
46b8095c6a Reworked SonarQube trigger
All checks were successful
Bigfoot / Build & Test Debug (Unity Build: ON) (push) Successful in 26s
Bigfoot / Build & Test RelWithDebInfo (Unity Build: OFF) (push) Successful in 24s
Bigfoot / Build & Test RelWithDebInfo (Unity Build: ON) (push) Successful in 28s
Bigfoot / Build & Test Debug (Unity Build: OFF) (push) Successful in 24s
Bigfoot / Build & Test Release (Unity Build: OFF) (push) Successful in 19s
Bigfoot / Build & Test Release (Unity Build: ON) (push) Successful in 20s
Bigfoot / Clang Format Checks (push) Successful in 9s
Bigfoot / Sonarqube (push) Successful in 1m18s
2026-02-02 07:38:15 +01:00
63fd92c584 Reworked SonarQube trigger
Some checks failed
Bigfoot / Build & Test Debug (Unity Build: OFF) (push) Successful in 24s
Bigfoot / Build & Test Debug (Unity Build: ON) (push) Successful in 25s
Bigfoot / Build & Test RelWithDebInfo (Unity Build: OFF) (push) Successful in 25s
Bigfoot / Build & Test RelWithDebInfo (Unity Build: ON) (push) Has been cancelled
Bigfoot / Build & Test Release (Unity Build: OFF) (push) Has been cancelled
Bigfoot / Build & Test Release (Unity Build: ON) (push) Has been cancelled
Bigfoot / Clang Format Checks (push) Has been cancelled
2026-02-02 07:36:46 +01:00
3466469440 Merge branch 'main' of https://git.romainboullard.com/BigfootDev/Bigfoot into Development
All checks were successful
Bigfoot / Build & Test Release (Unity Build: ON) (push) Successful in 18s
Bigfoot / Clang Format Checks (push) Successful in 9s
Bigfoot / Build & Test Debug (Unity Build: OFF) (push) Successful in 26s
Bigfoot / Build & Test Debug (Unity Build: ON) (push) Successful in 24s
Bigfoot / Build & Test RelWithDebInfo (Unity Build: OFF) (push) Successful in 23s
Bigfoot / Build & Test RelWithDebInfo (Unity Build: ON) (push) Successful in 25s
Bigfoot / Build & Test Release (Unity Build: OFF) (push) Successful in 20s
# Conflicts:
#	.clang-tidy
#	.gitea/workflows/sonarqube.yml
#	sonar-project.properties
2026-02-02 07:33:27 +01:00
b5c2e4936b StaticAnalysis (#11)
All checks were successful
Bigfoot / Build & Test Debug (Unity Build: OFF) (push) Successful in 26s
Bigfoot / Build & Test Debug (Unity Build: ON) (push) Successful in 24s
Bigfoot / Build & Test RelWithDebInfo (Unity Build: OFF) (push) Successful in 25s
Bigfoot / Build & Test RelWithDebInfo (Unity Build: ON) (push) Successful in 26s
Bigfoot / Build & Test Release (Unity Build: OFF) (push) Successful in 19s
Bigfoot / Build & Test Release (Unity Build: ON) (push) Successful in 20s
Bigfoot / Clang Format Checks (push) Successful in 9s
SonarQube step only on push to main
Trigger Infer/Clang-Tidy also in PR

Reviewed-on: #11
Co-authored-by: Romain BOULLARD <romain.boullard@protonmail.com>
Co-committed-by: Romain BOULLARD <romain.boullard@protonmail.com>
2026-02-02 06:18:26 +00:00
3d4394765b StaticAnalysis (#7)
All checks were successful
Bigfoot / Build & Test Debug (Unity Build: OFF) (push) Successful in 23s
Bigfoot / Build & Test Debug (Unity Build: ON) (push) Successful in 22s
Bigfoot / Build & Test RelWithDebInfo (Unity Build: OFF) (push) Successful in 24s
Bigfoot / Build & Test RelWithDebInfo (Unity Build: ON) (push) Successful in 24s
Bigfoot / Build & Test Release (Unity Build: OFF) (push) Successful in 17s
Bigfoot / Build & Test Release (Unity Build: ON) (push) Successful in 17s
Bigfoot / Clang Format Checks (push) Successful in 7s
Bigfoot / Sonarqube (push) Successful in 58s
Reviewed-on: #7
2026-01-30 15:50:56 +00:00
2 changed files with 11 additions and 18 deletions

View File

@@ -1,9 +1,10 @@
name: Bigfoot
pull_request:
branches:
- main
types: [opened, synchronize, reopened]
on:
push:
branches:
- main
- Development
jobs:
build-and-test:
@@ -35,7 +36,7 @@ jobs:
run: infer run --compilation-database build/Debug/compile_commands.json
- name: SonarQube Scan
if: github.event_name == 'push'
if: github.head_ref == 'main' || github.ref_name == 'main'
uses: SonarSource/sonarqube-scan-action@v7.0.0
with:
args: >

View File

@@ -9,6 +9,7 @@
#include <EASTL/array.h>
#include <EASTL/bit.h>
#include <EASTL/optional.h>
#include <EASTL/type_traits.h>
#include <EASTL/utility.h>
@@ -32,7 +33,7 @@ class Singleton
*/
static constexpr TYPE& Instance()
{
return *eastl::bit_cast<TYPE*>(ms_instance.data());
return ms_instance.value();
}
class Lifetime
@@ -78,9 +79,7 @@ class Singleton
template<typename... ARGS>
static void Initialize(ARGS&&... p_args)
{
new (ms_instance.data()) TYPE(eastl::forward<ARGS>(p_args)...);
ms_initialized = true;
ms_instance.emplace(eastl::forward<ARGS>(p_args)...);
}
/**
@@ -89,20 +88,13 @@ class Singleton
*/
static void Finalize()
{
eastl::bit_cast<TYPE*>(ms_instance.data())->~TYPE();
ms_initialized = false;
ms_instance.reset();
}
/**
* The singleton.
*/
alignas(alignof(TYPE)) inline static eastl::array<std::byte, sizeof(TYPE)> ms_instance;
/**
* Is the singleton initialized?
*/
inline static bool ms_initialized = false;
inline static eastl::optional<TYPE> ms_instance;
};
} // namespace Bigfoot
#endif