From a4d37d76512c293b12aab1f77961f96d572557b7 Mon Sep 17 00:00:00 2001 From: bonmas14 Date: Sun, 3 Aug 2025 17:08:34 +0000 Subject: Small changes --- .gitignore | 1 + README.md | 31 ++++++++++++++++++++++++++----- build.sh | 25 +++++++++++++++++++++---- src/un_strings.c | 4 +++- 4 files changed, 51 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 85d0bbc..cd106a5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ bin/ +obj/ lib/ diff --git a/README.md b/README.md index 3d40b34..49c0470 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Ungrateful -C99 standard library for game development. +C99 standard libraries for game development. # Note: @@ -14,7 +14,28 @@ Only core features of C99 were used: # TODO: -- File IO. -- Memory allocation. -- Threading. -- Strings. ++ Memory allocation; ++ Strings; +- compressing algorithms; +- Wide strings; +- vecs/ivec; +- matrix; +- splines (qubic); +- easing; +- Quaternions; +- noise; +- random; +- sorting; +- raycasting; +- sorting; + +# Serf +- Library loading; +- Threading; +- non-blocking logging; +- Clocks; +- File IO; +- Configurations; + + +- Internal, compressable filesystem for speeding up IO work; diff --git a/build.sh b/build.sh index 4cf5e42..7984d22 100755 --- a/build.sh +++ b/build.sh @@ -2,23 +2,33 @@ cc="gcc" ld="gcc" +ar="ar" + +proc=$(nproc) rm -rf ./lib/ rm -rf ./bin/ +rm -rf ./obj/ mkdir ./lib/ mkdir ./bin/ +mkdir ./obj/ + +echo "[BUILD] ungrateful.c" -echo "[BUILD] entry.c" +cflags="-std=c99 -fPIC -Wall -Wextra -g -Wno-error -pedantic" -cflags="-std=c99 -Wall -Wextra -g -Wno-error -pedantic" $cc $cflags \ - -c -o lib/ungrateful.o \ + -c -o obj/ungrateful.o \ -g src/ungrateful.c if [[ $? -ne 0 ]]; then exit fi +$ar rcs lib/libungrateful.a obj/ungrateful.o + +# ------------ Tests from here +# if [[ $1 == "no_tests" ]]; then exit fi @@ -31,9 +41,16 @@ for test in tests/*.c; do echo "[BUILD] $test" - $cc $cflags -o bin/$fname $test lib/ungrateful.o -Isrc/ + $cc $cflags -o bin/$fname $test -Llib/ -Isrc/ -lungrateful & + + if [[ $(jobs -r -p | wc -l) -ge $proc ]]; then + wait + fi done +wait +echo + for case in bin/*; do if [[ $1 == "quiet" ]]; then $case > /dev/null 2>&1 diff --git a/src/un_strings.c b/src/un_strings.c index 1499726..7d73d0b 100644 --- a/src/un_strings.c +++ b/src/un_strings.c @@ -322,6 +322,7 @@ String un_string_format(Allocator alloc, String buffer, ...) { String s; List output; s64 i, j; + u32 b; Allocator talloc = un_allocator_get_temporary(); output = un_list_create(UN_KB(1), sizeof(u8), talloc); @@ -339,9 +340,10 @@ String un_string_format(Allocator alloc, String buffer, ...) { { un_list_append(&output, buffer.data + i); } break; + case 'c': { - u32 b = va_arg(args, u32); + b = va_arg(args, u32); un_list_append(&output, &b); } break; -- cgit v1.2.3-70-g09d2