diff --git a/build_clang.bat b/build_clang.bat new file mode 100644 index 0000000..fa742b7 --- /dev/null +++ b/build_clang.bat @@ -0,0 +1,9 @@ +@echo off +rmdir /S /Q build +mkdir build + +pushd build + +clang -g -o cgame.exe ../build.c -O0 -DDEBUG -std=c11 -Wextra -Wno-incompatible-library-redeclaration -Wno-sign-compare -Wno-unused-parameter + +popd \ No newline at end of file diff --git a/build_release_clang.bat b/build_release_clang.bat new file mode 100644 index 0000000..f4a9ec1 --- /dev/null +++ b/build_release_clang.bat @@ -0,0 +1,13 @@ +@echo off +rmdir /S /Q build +mkdir build + +pushd build + +mkdir release +pushd release + +clang -o cgame.exe ../../build.c -O3 -DRELEASE -std=c11 -Wextra -Wno-incompatible-library-redeclaration -Wno-sign-compare -Wno-unused-parameter + +popd +popd \ No newline at end of file diff --git a/main.c b/main.c index 7f20293..5de451c 100644 --- a/main.c +++ b/main.c @@ -20,6 +20,7 @@ int oogabooga_main(int argc, char **argv) { // or we can just do this for temporary allocation int *b = talloc(sizeof(int)); + (void)b; // Call each frame reset_temporary_storage(); @@ -39,6 +40,7 @@ int oogabooga_main(int argc, char **argv) { int hello; hello = 5; + (void)hello; #ifdef DEBUG printf("Hello, balls! (debug)\n"); diff --git a/oogabooga/memory.c b/oogabooga/memory.c index 4fde1cd..7681f41 100644 --- a/oogabooga/memory.c +++ b/oogabooga/memory.c @@ -67,7 +67,7 @@ typedef struct { Heap_Block *heap_head; bool heap_initted = false; Spinlock *heap_lock; // This is terrible but I don't care for now - + u64 get_heap_block_size_excluding_metadata(Heap_Block *block) { return block->size - sizeof(Heap_Block); diff --git a/oogabooga/os_interface.c b/oogabooga/os_interface.c index 712969b..20116f8 100644 --- a/oogabooga/os_interface.c +++ b/oogabooga/os_interface.c @@ -122,7 +122,7 @@ typedef struct Thread { /// // Thread primitive -Thread* os_make_thread(); +Thread* os_make_thread(Thread_Proc proc); void os_start_thread(Thread* t); void os_join_thread(Thread* t); diff --git a/oogabooga/tests.c b/oogabooga/tests.c index 4aa619d..1343f5d 100644 --- a/oogabooga/tests.c +++ b/oogabooga/tests.c @@ -106,7 +106,9 @@ void test_allocator(bool do_log_heap) { int* foo = (int*)alloc(72); *foo = 1337; void* bar = alloc(69); + (void)bar; void* baz = alloc(420); + (void)baz; assert(*foo == 1337, "Temp memory corruptada");