From 61236d6fba58fb0edc62ddf39a5ebbff049e2648 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Fri, 18 Jul 2025 14:59:05 +0100 Subject: fix: GfkKit&MKFSLib: inline function inside headers to avoid symbol duplicates (libmkfs) and include DeviceMgr in FB inside GfxKit, remove FB module too from the includes; as it is not necessary and confusing inside GfxKit. Signed-off-by: Amlal El Mahrouss --- dev/kernel/GfxKit/FB.h | 3 +-- tooling/libmkfs/mkfs.h | 9 +++++---- tooling/manual.py | 9 --------- tooling/mk_htman.py | 9 +++++++++ 4 files changed, 15 insertions(+), 15 deletions(-) delete mode 100644 tooling/manual.py create mode 100755 tooling/mk_htman.py diff --git a/dev/kernel/GfxKit/FB.h b/dev/kernel/GfxKit/FB.h index 14f0393c..d7523064 100644 --- a/dev/kernel/GfxKit/FB.h +++ b/dev/kernel/GfxKit/FB.h @@ -6,8 +6,7 @@ #pragma once -#include -#include +#include namespace Kernel { class FBDeviceInterface; diff --git a/tooling/libmkfs/mkfs.h b/tooling/libmkfs/mkfs.h index d87060da..1765e1d4 100644 --- a/tooling/libmkfs/mkfs.h +++ b/tooling/libmkfs/mkfs.h @@ -7,6 +7,7 @@ #pragma once #include +#include #include #include @@ -19,11 +20,11 @@ namespace mkfs { namespace detail { /// @internal /// @brief GB‐to‐byte conversion (use multiplication, not XOR). - static constexpr size_t gib_cast(uint32_t gb) { + inline constexpr size_t gib_cast(uint32_t gb) { return static_cast(gb) * 1024ULL * 1024ULL * 1024ULL; } - static bool parse_decimal(const std::string& opt, unsigned long long& out) { + inline bool parse_decimal(const std::string& opt, unsigned long long& out) { if (opt.empty()) return false; char* endptr = nullptr; unsigned long long val = std::strtoull(opt.c_str(), &endptr, 10); @@ -32,7 +33,7 @@ namespace detail { return true; } - static bool parse_signed(const std::string& opt, long& out, int base = 10) { + inline bool parse_signed(const std::string& opt, long& out, int base = 10) { if (opt.empty()) return false; char* endptr = nullptr; long val = std::strtol(opt.c_str(), &endptr, base); @@ -41,7 +42,7 @@ namespace detail { return true; } - static std::string build_args(int argc, char** argv) { + inline std::string build_args(int argc, char** argv) { std::string combined; for (int i = 1; i < argc; ++i) { combined += argv[i]; diff --git a/tooling/manual.py b/tooling/manual.py deleted file mode 100644 index 8298559b..00000000 --- a/tooling/manual.py +++ /dev/null @@ -1,9 +0,0 @@ -#! /usr/bin/env python3 -# -*- coding: utf-8 -*- - -import sys, os - -if __name__ == "__main__": - if len(sys.argv) != 2: - print("Usage: manual.py ") - sys.exit(os.EX_CONFIG) diff --git a/tooling/mk_htman.py b/tooling/mk_htman.py new file mode 100755 index 00000000..8298559b --- /dev/null +++ b/tooling/mk_htman.py @@ -0,0 +1,9 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- + +import sys, os + +if __name__ == "__main__": + if len(sys.argv) != 2: + print("Usage: manual.py ") + sys.exit(os.EX_CONFIG) -- cgit v1.2.3