From b2c4d9a8ebebf87be33dcc357af86102d31dac47 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sat, 15 Nov 2025 06:07:15 +0100 Subject: feat: DDK: compiler improvements and working on fwrk standard and launch design. Signed-off-by: Amlal El Mahrouss --- dev/libSystem/src/SystemCalls.cc | 17 ----------------- dev/libSystem/src/Utils.cc | 29 +++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 17 deletions(-) create mode 100644 dev/libSystem/src/Utils.cc (limited to 'dev/libSystem/src') diff --git a/dev/libSystem/src/SystemCalls.cc b/dev/libSystem/src/SystemCalls.cc index 3db9368d..3d7a7447 100644 --- a/dev/libSystem/src/SystemCalls.cc +++ b/dev/libSystem/src/SystemCalls.cc @@ -11,23 +11,6 @@ using namespace LibSystem; -/// @note this uses the FNV 64-bit variant. -IMPORT_C UInt64 libsys_hash_64(const Char* path) { - if (!path || *path == 0) return 0; - - const UInt64 kFNVSeed = 0xcbf29ce484222325ULL; - const UInt64 kFNVPrime = 0x100000001b3ULL; - - UInt64 hash = kFNVSeed; - - while (*path) { - hash ^= (Char) (*path++); - hash *= kFNVPrime; - } - - return hash; -} - IMPORT_C Char* StrFmt(const Char* fmt, ...) { if (!fmt || *fmt == 0) return const_cast("(null)"); diff --git a/dev/libSystem/src/Utils.cc b/dev/libSystem/src/Utils.cc new file mode 100644 index 00000000..0688cd57 --- /dev/null +++ b/dev/libSystem/src/Utils.cc @@ -0,0 +1,29 @@ +/* ------------------------------------------- + + Copyright (C) 2025, Amlal El Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include +#include +#include +#include + +using namespace LibSystem; + +/// @note This uses the FNV 64-bit variant. +IMPORT_C UInt64 libsys_hash_64(const Char* path) { + if (!path || *path == 0) return 0; + + const UInt64 kFNVSeed = 0xcbf29ce484222325ULL; + const UInt64 kFNVPrime = 0x100000001b3ULL; + + UInt64 hash = kFNVSeed; + + while (*path) { + hash ^= (Char) (*path++); + hash *= kFNVPrime; + } + + return hash; +} -- cgit v1.2.3