From fcab6677ac6a6f45db7cf18f20ade6c6ad5464a4 Mon Sep 17 00:00:00 2001 From: ChUrl Date: Fri, 29 Jul 2022 14:19:02 +0200 Subject: [PATCH] use std::size_t --- c_os/user/lib/mem/Memory.cc | 4 ++-- c_os/user/lib/mem/Memory.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/c_os/user/lib/mem/Memory.cc b/c_os/user/lib/mem/Memory.cc index 9abdb4d..5f97d1f 100755 --- a/c_os/user/lib/mem/Memory.cc +++ b/c_os/user/lib/mem/Memory.cc @@ -1,7 +1,7 @@ #include "Memory.h" -void bse::memset(char* destination, const char value, const unsigned int bytes) { - for (unsigned int byte = 0; byte < bytes; ++byte) { +void bse::memset(char* destination, const char value, std::size_t bytes) { + for (std::size_t byte = 0; byte < bytes; ++byte) { *(destination + byte) = value; } } diff --git a/c_os/user/lib/mem/Memory.h b/c_os/user/lib/mem/Memory.h index 93b9697..ff2b481 100755 --- a/c_os/user/lib/mem/Memory.h +++ b/c_os/user/lib/mem/Memory.h @@ -1,26 +1,26 @@ #ifndef MYSTDLIB_INCLUDE_H_ #define MYSTDLIB_INCLUDE_H_ +#include + namespace bse { // add using byte or sth to replace char template - void memcpy(T* destination, const T* source, const unsigned int count = 1) { + void memcpy(T* destination, const T* source, std::size_t count = 1) { for (unsigned int i = 0; i < count; ++i) { *(destination + i) = *(source + i); } } - void memset(char* destination, char value, unsigned int bytes); + void memset(char* destination, char value, std::size_t bytes); template void zero(T* destination) { memset(reinterpret_cast(destination), '\0', sizeof(T)); } - // void strcpy(char* destination, char* source); - // unsigned int strlen(char* string); } // namespace bse #endif