mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Tweaked CFLAGS, and fixed related errors
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#compiler settings
|
||||
CC=gcc
|
||||
CFLAGS+=-std=c17 -g -Wall -Werror -Wno-unused-parameter -Wno-unused-function -Wno-unused-variable -Wformat=2
|
||||
CFLAGS+=-std=c17 -g -Wall -Werror -Wextra -Wformat=2
|
||||
LIBS+=-lm
|
||||
LDFLAGS+=
|
||||
|
||||
|
||||
@@ -25,10 +25,10 @@ int test_buckets() {
|
||||
Toy_Bucket* bucket = Toy_allocateBucket(sizeof(int) * 32);
|
||||
|
||||
//grab some memory
|
||||
int* a = Toy_partitionBucket(&bucket, sizeof(int));
|
||||
int* b = Toy_partitionBucket(&bucket, sizeof(int));
|
||||
int* c = Toy_partitionBucket(&bucket, sizeof(int));
|
||||
int* d = Toy_partitionBucket(&bucket, sizeof(int));
|
||||
Toy_partitionBucket(&bucket, sizeof(int));
|
||||
Toy_partitionBucket(&bucket, sizeof(int));
|
||||
Toy_partitionBucket(&bucket, sizeof(int));
|
||||
Toy_partitionBucket(&bucket, sizeof(int));
|
||||
|
||||
//check
|
||||
if (bucket == NULL || bucket->count != 4 * sizeof(int)) {
|
||||
@@ -46,12 +46,12 @@ int test_buckets() {
|
||||
Toy_Bucket* bucket = Toy_allocateBucket(sizeof(int) * 4);
|
||||
|
||||
//grab some memory
|
||||
int* a = Toy_partitionBucket(&bucket, sizeof(int));
|
||||
int* b = Toy_partitionBucket(&bucket, sizeof(int));
|
||||
int* c = Toy_partitionBucket(&bucket, sizeof(int));
|
||||
int* d = Toy_partitionBucket(&bucket, sizeof(int));
|
||||
int* e = Toy_partitionBucket(&bucket, sizeof(int));
|
||||
int* f = Toy_partitionBucket(&bucket, sizeof(int));
|
||||
Toy_partitionBucket(&bucket, sizeof(int));
|
||||
Toy_partitionBucket(&bucket, sizeof(int));
|
||||
Toy_partitionBucket(&bucket, sizeof(int));
|
||||
Toy_partitionBucket(&bucket, sizeof(int));
|
||||
Toy_partitionBucket(&bucket, sizeof(int));
|
||||
Toy_partitionBucket(&bucket, sizeof(int));
|
||||
|
||||
//checks - please note that the top-most bucket is what is being filled - older buckets are further along
|
||||
if (
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
int counter = 0;
|
||||
|
||||
void count(const char* msg) {
|
||||
void count(const char*) {
|
||||
counter++;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ int test_routine_expressions(Toy_Bucket** bucketHandle) {
|
||||
|
||||
//run
|
||||
void* buffer = Toy_compileRoutine(ast);
|
||||
int len = ((int*)buffer)[0];
|
||||
|
||||
//check header
|
||||
int* ptr = (int*)buffer;
|
||||
@@ -68,7 +67,6 @@ int test_routine_expressions(Toy_Bucket** bucketHandle) {
|
||||
|
||||
//run
|
||||
void* buffer = Toy_compileRoutine(ast);
|
||||
int len = ((int*)buffer)[0];
|
||||
|
||||
//check header
|
||||
int* ptr = (int*)buffer;
|
||||
@@ -117,7 +115,6 @@ int test_routine_expressions(Toy_Bucket** bucketHandle) {
|
||||
|
||||
//run
|
||||
void* buffer = Toy_compileRoutine(ast);
|
||||
int len = ((int*)buffer)[0];
|
||||
|
||||
//check header
|
||||
int* ptr = (int*)buffer;
|
||||
@@ -170,7 +167,6 @@ int test_routine_expressions(Toy_Bucket** bucketHandle) {
|
||||
|
||||
//run
|
||||
void* buffer = Toy_compileRoutine(ast);
|
||||
int len = ((int*)buffer)[0];
|
||||
|
||||
//check header
|
||||
int* ptr = (int*)buffer;
|
||||
@@ -223,7 +219,6 @@ int test_routine_expressions(Toy_Bucket** bucketHandle) {
|
||||
|
||||
//run
|
||||
void* buffer = Toy_compileRoutine(ast);
|
||||
int len = ((int*)buffer)[0];
|
||||
|
||||
//check header
|
||||
int* ptr = (int*)buffer;
|
||||
@@ -277,7 +272,6 @@ int test_routine_expressions(Toy_Bucket** bucketHandle) {
|
||||
|
||||
//run
|
||||
void* buffer = Toy_compileRoutine(ast);
|
||||
int len = ((int*)buffer)[0];
|
||||
|
||||
//check header
|
||||
int* ptr = (int*)buffer;
|
||||
@@ -331,7 +325,6 @@ int test_routine_expressions(Toy_Bucket** bucketHandle) {
|
||||
|
||||
//run
|
||||
void* buffer = Toy_compileRoutine(ast);
|
||||
int len = ((int*)buffer)[0];
|
||||
|
||||
//check header
|
||||
int* header = (int*)buffer;
|
||||
@@ -438,7 +431,6 @@ int test_routine_binary(Toy_Bucket** bucketHandle) {
|
||||
|
||||
//run
|
||||
void* buffer = Toy_compileRoutine(ast);
|
||||
int len = ((int*)buffer)[0];
|
||||
|
||||
//check header
|
||||
int* ptr = (int*)buffer;
|
||||
@@ -504,7 +496,6 @@ int test_routine_binary(Toy_Bucket** bucketHandle) {
|
||||
|
||||
//run
|
||||
void* buffer = Toy_compileRoutine(ast);
|
||||
int len = ((int*)buffer)[0];
|
||||
|
||||
//check header
|
||||
int* ptr = (int*)buffer;
|
||||
@@ -570,7 +561,6 @@ int test_routine_binary(Toy_Bucket** bucketHandle) {
|
||||
|
||||
//run
|
||||
void* buffer = Toy_compileRoutine(ast);
|
||||
int len = ((int*)buffer)[0];
|
||||
|
||||
//check header
|
||||
int* ptr = (int*)buffer;
|
||||
@@ -636,7 +626,6 @@ int test_routine_binary(Toy_Bucket** bucketHandle) {
|
||||
|
||||
//run
|
||||
void* buffer = Toy_compileRoutine(ast);
|
||||
int len = ((int*)buffer)[0];
|
||||
|
||||
//check header
|
||||
int* ptr = (int*)buffer;
|
||||
@@ -732,7 +721,6 @@ int test_routine_keywords(Toy_Bucket** bucketHandle) {
|
||||
|
||||
//run
|
||||
void* buffer = Toy_compileRoutine(ast);
|
||||
int len = ((int*)buffer)[0];
|
||||
|
||||
//check header
|
||||
int* ptr = (int*)buffer;
|
||||
@@ -791,7 +779,6 @@ int test_routine_keywords(Toy_Bucket** bucketHandle) {
|
||||
|
||||
//run
|
||||
void* buffer = Toy_compileRoutine(ast);
|
||||
int len = ((int*)buffer)[0];
|
||||
|
||||
//check header
|
||||
int* ptr = (int*)buffer;
|
||||
@@ -855,7 +842,6 @@ int test_routine_keywords(Toy_Bucket** bucketHandle) {
|
||||
|
||||
//run
|
||||
void* buffer = Toy_compileRoutine(ast);
|
||||
int len = ((int*)buffer)[0];
|
||||
|
||||
//check header
|
||||
int* ptr = (int*)buffer;
|
||||
@@ -946,7 +932,6 @@ int test_routine_keywords(Toy_Bucket** bucketHandle) {
|
||||
|
||||
//run
|
||||
void* buffer = Toy_compileRoutine(ast);
|
||||
int len = ((int*)buffer)[0];
|
||||
|
||||
//check header
|
||||
int* ptr = (int*)buffer;
|
||||
@@ -1061,7 +1046,6 @@ int test_routine_keywords(Toy_Bucket** bucketHandle) {
|
||||
|
||||
//run
|
||||
void* buffer = Toy_compileRoutine(ast);
|
||||
int len = ((int*)buffer)[0];
|
||||
|
||||
//check header
|
||||
int* ptr = (int*)buffer;
|
||||
@@ -1119,7 +1103,6 @@ int test_routine_keywords(Toy_Bucket** bucketHandle) {
|
||||
|
||||
//run
|
||||
void* buffer = Toy_compileRoutine(ast);
|
||||
int len = ((int*)buffer)[0];
|
||||
|
||||
//check header
|
||||
int* header = (int*)buffer;
|
||||
@@ -1227,7 +1210,6 @@ int test_routine_keywords(Toy_Bucket** bucketHandle) {
|
||||
|
||||
//run
|
||||
void* buffer = Toy_compileRoutine(ast);
|
||||
int len = ((int*)buffer)[0];
|
||||
|
||||
//check header
|
||||
int* header = (int*)buffer;
|
||||
|
||||
@@ -400,7 +400,6 @@ int test_string_equality() {
|
||||
Toy_Bucket* bucket = Toy_allocateBucket(1024);
|
||||
Toy_String* helloWorldOne = Toy_createString(&bucket, "Hello world");
|
||||
Toy_String* helloWorldTwo = Toy_concatStrings(&bucket, Toy_createString(&bucket, "Hello "), Toy_createString(&bucket, "world"));
|
||||
Toy_String* helloEveryone = Toy_createString(&bucket, "Hello everyone");
|
||||
|
||||
int result = 0; //for print the errors
|
||||
|
||||
|
||||
Reference in New Issue
Block a user