aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authoraqua <aqua@iserlohn-fortress.net>2023-02-12 17:28:33 +0200
committeraqua <aqua@iserlohn-fortress.net>2023-02-12 17:28:33 +0200
commit878cdffb3f69c780cb55f1fbb54747d9066a385a (patch)
treecd8bb7352bdb6d14ed20f5aa2d3d0e649f0f0427 /lib
parentMake shadowing variables an error (diff)
downloadkernel-878cdffb3f69c780cb55f1fbb54747d9066a385a.tar.xz
Generate dependency files for source code
Use the compiler to generate dependency files for all C, C++ and .S assembly source code files. These are included in the makefiles where the files are used.
Diffstat (limited to 'lib')
-rw-r--r--lib/Makefile4
-rw-r--r--lib/stdlib/memset.c2
-rw-r--r--lib/tst/linked_list_allocator.cc4
3 files changed, 5 insertions, 5 deletions
diff --git a/lib/Makefile b/lib/Makefile
index 385e5ba..cace677 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -6,10 +6,10 @@ libk.SRCS = \
stdlib/memcpy.c stdlib/memset.c stdlib/linked_list_allocator.c \
string/itoa.c
-TESTS += tst/test_endian_little tst/test_mem tst/test_string tst/test_linked_list_allocator
+TESTS += tst/endian_little tst/mem tst/string tst/linked_list_allocator
blake2.SRCS = blake2/blake2s.c
-TESTS += tst/test_blake2s_selftest
+TESTS += tst/blake2s_selftest
include ../rules.mk
diff --git a/lib/stdlib/memset.c b/lib/stdlib/memset.c
index ccd46dd..a16bd05 100644
--- a/lib/stdlib/memset.c
+++ b/lib/stdlib/memset.c
@@ -2,6 +2,6 @@ void *
memset(void *s, int c, long unsigned n)
{
char *pDest = (char *)s;
- for (unsigned i = 0; i < n; ++i) pDest[i] = c;
+ for (unsigned i = 0; i < n; ++i) pDest[i] = (char)c;
return s;
}
diff --git a/lib/tst/linked_list_allocator.cc b/lib/tst/linked_list_allocator.cc
index f3af8e2..280a6d5 100644
--- a/lib/tst/linked_list_allocator.cc
+++ b/lib/tst/linked_list_allocator.cc
@@ -6,9 +6,9 @@ namespace libk {
#include "../stdlib/linked_list_allocator.c"
std::ostream &
-operator<<(std::ostream &os, const Chunk &begin)
+operator<<(std::ostream &os, const Chunk &b)
{
- for (const Chunk *iter = &begin; iter != nullptr; iter = iter->next) {
+ for (const Chunk *iter = &b; iter != nullptr; iter = iter->next) {
os << iter << " used=" << iter->used << " size=" << std::setw(4) << iter->size << " next=" << iter->next
<< std::endl;
}