diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | README.md | 31 | ||||
-rwxr-xr-x | build.sh | 25 | ||||
-rw-r--r-- | src/un_strings.c | 4 |
4 files changed, 51 insertions, 10 deletions
@@ -1,2 +1,3 @@ bin/ +obj/ lib/ @@ -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; @@ -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; |