diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-08-25 10:28:07 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-25 10:28:07 +0200 |
| commit | 1057fd299e17fcc04f6b3a1aa3ace1026f8652a0 (patch) | |
| tree | a663c7dcd26779295ce0d9681418964f802f2d14 /tools | |
| parent | 1a32b9307357ac0fc9095e853b2b6d94f9fe62bb (diff) | |
| parent | 328b34360ab8b2462ea5858441693277b3d23f08 (diff) | |
Merge pull request #56 from nekernel-org/dev
Errata: v0.0.4
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/fsck.hefs.cc | 22 | ||||
| -rw-r--r-- | tools/fsck.hefs.json | 8 | ||||
| -rwxr-xr-x[-rw-r--r--] | tools/mk_app.py | 0 | ||||
| -rwxr-xr-x[-rw-r--r--] | tools/mk_fwrk.py | 0 | ||||
| -rwxr-xr-x[-rw-r--r--] | tools/mk_htman.py | 0 | ||||
| -rw-r--r-- | tools/mkfs.hefs.json | 8 |
6 files changed, 20 insertions, 18 deletions
diff --git a/tools/fsck.hefs.cc b/tools/fsck.hefs.cc index eb6a66d8..df89bf07 100644 --- a/tools/fsck.hefs.cc +++ b/tools/fsck.hefs.cc @@ -9,29 +9,32 @@ #include <cstdlib> #include <fstream> +/// @note decimal base. static uint16_t kNumericalBase = 10; int main(int argc, char** argv) { if (argc < 2) { - mkfs::console_out() << "fsck: hefs: usage: fsck.hefs -i=<input_device> -o=<origin>" << "\n"; + mkfs::console_out() << "fsck: hefs: usage: fsck.hefs -in=<input_device> -org=<origin>" + << "\n"; return EXIT_FAILURE; } auto args = mkfs::detail::build_args(argc, argv); - auto opt_disk = mkfs::get_option<char>(args, "-i"); + auto opt_disk = mkfs::get_option<char>(args, "-in"); - auto origin = mkfs::get_option<char>(args, "-o"); + auto origin = mkfs::get_option<char>(args, "-org"); if (opt_disk.empty()) { - mkfs::console_out() << "fsck: hefs: error: HeFS is empty! Exiting..." << "\n"; + mkfs::console_out() << "fsck: hefs: error: HeFS partition is empty! Exiting..." + << "\n"; return EXIT_FAILURE; } auto out_origin = 0L; if (!mkfs::detail::parse_signed(origin, out_origin, kNumericalBase)) { - mkfs::console_out() << "hefs: error: Invalid -o <dec> argument.\n"; + mkfs::console_out() << "hefs: error: Invalid -org=<dec> argument.\n"; return EXIT_FAILURE; } @@ -49,9 +52,8 @@ int main(int argc, char** argv) { return EXIT_FAILURE; } - mkfs::hefs::BootNode boot_node; - - std::memset(&boot_node, 0, sizeof(boot_node)); + // @note use modern intializer list here to empty out the fields according to the struct layout. + mkfs::hefs::BootNode boot_node{}; output_device.read(reinterpret_cast<char*>(&boot_node), sizeof(boot_node)); @@ -66,9 +68,9 @@ int main(int argc, char** argv) { return EXIT_FAILURE; } - mkfs::console_out() << "hefs: HeFS partition is is healthy, exiting...\n"; + mkfs::console_out() << "hefs: HeFS partition is healthy, exiting...\n"; output_device.close(); return EXIT_SUCCESS; -}
\ No newline at end of file +} diff --git a/tools/fsck.hefs.json b/tools/fsck.hefs.json index d6ff4b0f..970665aa 100644 --- a/tools/fsck.hefs.json +++ b/tools/fsck.hefs.json @@ -1,5 +1,5 @@ { - "compiler_path": "g++", + "compiler_path": "clang++", "compiler_std": "c++20", "headers_path": [ "../" @@ -9,8 +9,8 @@ ], "output_name": "./dist/fsck.hefs", "cpp_macros": [ - "kFSCKHEFSVersion=0x0100", - "kFSCKHEFSVersionHighest=0x0100", - "kFSCKHEFSVersionLowest=0x0100" + "kFsckHeFSVersion=0x0100", + "kFsckHeFSVersionHighest=0x0100", + "kFsckHeFSVersionLowest=0x0100" ] }
\ No newline at end of file diff --git a/tools/mk_app.py b/tools/mk_app.py index 7f7cef17..7f7cef17 100644..100755 --- a/tools/mk_app.py +++ b/tools/mk_app.py diff --git a/tools/mk_fwrk.py b/tools/mk_fwrk.py index b2ef99ff..b2ef99ff 100644..100755 --- a/tools/mk_fwrk.py +++ b/tools/mk_fwrk.py diff --git a/tools/mk_htman.py b/tools/mk_htman.py index e865f7c5..e865f7c5 100644..100755 --- a/tools/mk_htman.py +++ b/tools/mk_htman.py diff --git a/tools/mkfs.hefs.json b/tools/mkfs.hefs.json index d29b7f73..542fa473 100644 --- a/tools/mkfs.hefs.json +++ b/tools/mkfs.hefs.json @@ -1,5 +1,5 @@ { - "compiler_path": "g++", + "compiler_path": "clang++", "compiler_std": "c++20", "headers_path": [ "../" @@ -9,8 +9,8 @@ ], "output_name": "./dist/mkfs.hefs", "cpp_macros": [ - "kMKFSHEFSVersion=0x0100", - "kMKFSHEFSVersionHighest=0x0100", - "kMKFSHEFSVersionLowest=0x0100" + "kMkfsHeFSVersion=0x0100", + "kMkfsHeFSVersionHighest=0x0100", + "kMkfsHeFSVersionLowest=0x0100" ] }
\ No newline at end of file |
