diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-06-23 22:59:26 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-06-23 22:59:26 +0200 |
| commit | 0d44c75062a313f7d1b8813816843bc8ab51b135 (patch) | |
| tree | 6d44b12ba358c19f8512f1fe61dce58cd3a11a3c /dev/boot/src/BootSupport.cc | |
| parent | cbda3fef30c3575eb12a22b5fd7cd7d5d2e01c20 (diff) | |
fix: Fix AP init code, and format codebase.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/boot/src/BootSupport.cc')
| -rw-r--r-- | dev/boot/src/BootSupport.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/dev/boot/src/BootSupport.cc b/dev/boot/src/BootSupport.cc index 96c6594e..4bf3e68a 100644 --- a/dev/boot/src/BootSupport.cc +++ b/dev/boot/src/BootSupport.cc @@ -18,13 +18,14 @@ /// @param dst destination pointer. /// @param byte value to fill in. /// @param len length of of src. -EXTERN_C VoidPtr memnset(void* dst, int byte, long long unsigned int len, long long unsigned int dst_size) { +EXTERN_C VoidPtr memnset(void* dst, int byte, long long unsigned int len, + long long unsigned int dst_size) { if (!dst || len > dst_size) { // For now, we return nullptr or an error status. return nullptr; } - unsigned char* p = (unsigned char*)dst; - unsigned char val = (unsigned char)byte; + unsigned char* p = (unsigned char*) dst; + unsigned char val = (unsigned char) byte; for (size_t i = 0UL; i < len; ++i) { p[i] = val; } @@ -35,13 +36,14 @@ EXTERN_C VoidPtr memnset(void* dst, int byte, long long unsigned int len, long l /// @param dst destination pointer. /// @param src source pointer. /// @param len length of of src. -EXTERN_C VoidPtr memncpy(void* dst, const void* src, long long unsigned int len, long long unsigned int dst_size) { +EXTERN_C VoidPtr memncpy(void* dst, const void* src, long long unsigned int len, + long long unsigned int dst_size) { if (!dst || !src || len > dst_size) { // Similar to memset, this is a critical failure. return nullptr; } - unsigned char* d = (unsigned char*)dst; - const unsigned char* s = (const unsigned char*)src; + unsigned char* d = (unsigned char*) dst; + const unsigned char* s = (const unsigned char*) src; for (size_t i = 0UL; i < len; ++i) { d[i] = s[i]; } @@ -67,7 +69,7 @@ EXTERN_C int strncmp(const char* whatToCheck, const char* whatToCheckRight, size if (i == max_len) { return 0; } - return (unsigned char)whatToCheck[i] - (unsigned char)whatToCheckRight[i]; + return (unsigned char) whatToCheck[i] - (unsigned char) whatToCheckRight[i]; } /// @brief something specific to the Microsoft's ABI, When the stack grows too big. |
