From 9f16b032d38613ca95e321e1d1e652c43129c68b Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sat, 15 Aug 2020 17:42:36 +0200 Subject: Added libgui --- lib/mem.c | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 lib/mem.c (limited to 'lib/mem.c') diff --git a/lib/mem.c b/lib/mem.c deleted file mode 100644 index 58c337b..0000000 --- a/lib/mem.c +++ /dev/null @@ -1,35 +0,0 @@ -// MIT License, Copyright (c) 2020 Marvin Borner - -#include -#include -#include - -void *memcpy(void *dst, const void *src, u32 n) -{ - const char *sp = (const char *)src; - char *dp = (char *)dst; - for (; n != 0; n--) - *dp++ = *sp++; - return dst; -} - -void *memset(void *dst, char val, u32 n) -{ - char *temp = (char *)dst; - for (; n != 0; n--) - *temp++ = val; - return dst; -} - -int memcmp(const void *s1, const void *s2, u32 n) -{ - const u8 *a = (const u8 *)s1; - const u8 *b = (const u8 *)s2; - for (u32 i = 0; i < n; i++) { - if (a[i] < b[i]) - return -1; - else if (b[i] < a[i]) - return 1; - } - return 0; -} -- cgit v1.2.3