diff --git a/Makefile b/Makefile index 9767740..f7be340 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ build_all: build build_fast: - $(CC) $(SRC)main.c -o dobre -Werror -std=c17 + $(CC) $(CFLAGS) $(SRC)main.c -o dobre -Werror -std=c17 cp dobre ./bin/dobre run: diff --git a/src/buffer.h b/src/buffer.h index 8cbc391..fd02c1c 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -144,7 +144,7 @@ char *buffer_to_str(buffer_t *buff) { return result; } -char ustrncmp2(const char *s1, const char *s2, size_t n) { +char ustrncmp2(const unsigned char *s1, const unsigned char *s2, size_t n) { return strncmp((char *)s1, (char *)s2, n); while (n && *s1 == *s2) { n--; @@ -191,7 +191,7 @@ char *string_match_option(char *buff, char *options) { return buff; } - if (!ustrncmp((const unsigned char *)buff, (const unsigned char *)option, option_length)) { + if (!ustrncmp2((const unsigned char *)buff, (const unsigned char *)option, option_length)) { if (reverse) { return NULL; diff --git a/src/dobre.h b/src/dobre.h index e2b2d5e..7260473 100644 --- a/src/dobre.h +++ b/src/dobre.h @@ -1,10 +1,15 @@ #ifndef DOBRE_MAIN #define DOBRE_MAIN -#include <rlib.h> + +#include <rprint.h> +#include <rtime.h> +#include <rmalloc.h> +#include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <string.h> + #ifndef strdup char *_dobre_strdup(const char *s) { if (!s) diff --git a/src/main.c b/src/main.c index c230077..d54d644 100644 --- a/src/main.c +++ b/src/main.c @@ -1,4 +1,4 @@ -#define RMALLOC_OVERRIDE 0 +#define RMALLOC_OVERRIDE 1 #define RMALLOC_DEBUG 1 #include "dobre.h" #define print rprintb diff --git a/tests/parser/declare_function.dob b/tests/parser/declare_function.dob index 4d0db82..ec183cc 100644 --- a/tests/parser/declare_function.dob +++ b/tests/parser/declare_function.dob @@ -2,4 +2,9 @@ class String {} String pony(){} -pony(String arg1, String arg2 = "with_value"){} \ No newline at end of file +pony(String arg1, String arg2 = "with_value"){ + String d = "AAA" +} + + +