From 00bc412bf83e71ec1a05078acfdbbffc98a94bf4 Mon Sep 17 00:00:00 2001 From: kshku <1211shree@gmail.com> Date: Tue, 9 Jun 2026 23:48:44 +0530 Subject: [PATCH] chore: update submodules and fix type renames --- external/SnFile | 2 +- external/SnLogger | 2 +- external/SnMemory | 2 +- include/snuk/interpreter/interpreter.h | 2 +- include/snuk/logger.h | 4 ++-- repl/runtime.h | 6 +++--- src/interpreter/interpreter.c | 4 ++-- src/io.c | 2 +- src/logger.c | 12 ++++++------ src/memory.c | 2 +- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/external/SnFile b/external/SnFile index 72d71c3..993e294 160000 --- a/external/SnFile +++ b/external/SnFile @@ -1 +1 @@ -Subproject commit 72d71c350046f818719bb0dc41c4137197739686 +Subproject commit 993e2944f5f2c4b09f52f5c11d663fa5eb06fcbd diff --git a/external/SnLogger b/external/SnLogger index 0951c82..534235d 160000 --- a/external/SnLogger +++ b/external/SnLogger @@ -1 +1 @@ -Subproject commit 0951c82977cb5cf8b352edab3546cbb42c1bed75 +Subproject commit 534235d7d483f589ebc08410e6c2b379d3634cc2 diff --git a/external/SnMemory b/external/SnMemory index 89a0dc9..b0e1d57 160000 --- a/external/SnMemory +++ b/external/SnMemory @@ -1 +1 @@ -Subproject commit 89a0dc9547fef490b83e12a67b52a2f2cb2d82ef +Subproject commit b0e1d578c19c6819f243ee75353295f69a9d79da diff --git a/include/snuk/interpreter/interpreter.h b/include/snuk/interpreter/interpreter.h index 1d4a2ea..2c6433a 100644 --- a/include/snuk/interpreter/interpreter.h +++ b/include/snuk/interpreter/interpreter.h @@ -32,7 +32,7 @@ typedef struct SnukInterpreter { SnukSignal signal; void *mem; SnukAllocator allocator; - snLinearAllocator la; + SnLinearAllocator la; SnukError err; SnukSrcLoc cur_loc; char err_msg_buf[256]; diff --git a/include/snuk/logger.h b/include/snuk/logger.h index 16592a7..97b2876 100644 --- a/include/snuk/logger.h +++ b/include/snuk/logger.h @@ -8,8 +8,8 @@ SNUK_API void snuk_logger_init(void); SNUK_API void snuk_logger_deinit(void); SNUK_API void snuk_log_msg( - snLogLevel level, const char *file, const char *function, long line, const char *format_string, ...); -SNUK_API void snuk_set_log_level(snLogLevel level); + SnLogLevel level, const char *file, const char *function, long line, const char *format_string, ...); +SNUK_API void snuk_set_log_level(SnLogLevel level); #define log_trace(msg, ...) \ snuk_log_msg(SN_LOG_LEVEL_TRACE, __FILE__, __func__, __LINE__, msg, ##__VA_ARGS__) diff --git a/repl/runtime.h b/repl/runtime.h index 8e235b8..96f8653 100644 --- a/repl/runtime.h +++ b/repl/runtime.h @@ -10,18 +10,18 @@ typedef struct Runtime { void *mem; - snLinearAllocator la; + SnLinearAllocator la; SnukInterpreter interpreter; SnukAllocator parser_allocator; } Runtime; SNUK_INLINE void *runtime_alloc_fn(void *data, uint64_t size, uint64_t align) { - snLinearAllocator *la = (snLinearAllocator *)data; + SnLinearAllocator *la = (SnLinearAllocator *)data; return sn_linear_allocator_allocate(la, size, align); } SNUK_INLINE void *runtime_realloc_fn(void *data, void *ptr, uint64_t new_size, uint64_t align) { - snLinearAllocator *la = (snLinearAllocator *)data; + SnLinearAllocator *la = (SnLinearAllocator *)data; void *new = sn_linear_allocator_allocate(la, new_size, align); // No need to worry about how much to copy // since it is inside the given memory itself diff --git a/src/interpreter/interpreter.c b/src/interpreter/interpreter.c index 5f540b1..9c1ebf3 100644 --- a/src/interpreter/interpreter.c +++ b/src/interpreter/interpreter.c @@ -11,12 +11,12 @@ #define PAGES 10 SNUK_INLINE void *alloc_fn(void *data, uint64_t size, uint64_t align) { - snLinearAllocator *la = (snLinearAllocator *)data; + SnLinearAllocator *la = (SnLinearAllocator *)data; return sn_linear_allocator_allocate(la, size, align); } SNUK_INLINE void *realloc_fn(void *data, void *ptr, uint64_t new_size, uint64_t align) { - snLinearAllocator *la = (snLinearAllocator *)data; + SnLinearAllocator *la = (SnLinearAllocator *)data; void *new = sn_linear_allocator_allocate(la, new_size, align); memcpy(new, ptr, new_size); return new; diff --git a/src/io.c b/src/io.c index 0d58ca2..c31c7fc 100644 --- a/src/io.c +++ b/src/io.c @@ -15,7 +15,7 @@ char *snuk_read_line(char *buffer, uint64_t size) { // reads entire file, caller should free char *snuk_read_file(const char *path) { - snFile file; + SnFile file; if (!sn_file_open(path, SN_FILE_OPEN_FLAG_READ, &file)) return NULL; uint64_t file_size = sn_file_size(&file); diff --git a/src/logger.c b/src/logger.c index 29d6644..3f8ac9a 100644 --- a/src/logger.c +++ b/src/logger.c @@ -21,14 +21,14 @@ typedef struct stdout_stderr_sink { bool colored_enabled[2]; } stdout_stderr_sink; -static void stdout_stderr_sink_write(const char *msg, size_t len, snLogLevel level, void *data); +static void stdout_stderr_sink_write(const char *msg, size_t len, SnLogLevel level, void *data); static void stdout_stderr_sink_open(void *data); static void stdout_stderr_sink_flush(void *data); -static snStaticLogger sl; +static SnStaticLogger sl; static char log_buffer[LOGGER_BUFFER_SIZE]; static stdout_stderr_sink sink_data; -static snSink sinks[] = { +static SnSink sinks[] = { {.open = stdout_stderr_sink_open, .flush = stdout_stderr_sink_flush, .write = stdout_stderr_sink_write, .data = &sink_data} }; @@ -36,7 +36,7 @@ void snuk_logger_init(void) { sn_static_logger_init(&sl, log_buffer, LOGGER_BUFFER_SIZE, sinks, SNUK_ARRAY_LENGTH(sinks)); } -void snuk_set_log_level(snLogLevel level) { +void snuk_set_log_level(SnLogLevel level) { sn_static_logger_set_level(&sl, level); } @@ -45,7 +45,7 @@ void snuk_logger_deinit(void) { } void snuk_log_msg( - snLogLevel level, const char *file, const char *function, long line, const char *format_string, ...) { + SnLogLevel level, const char *file, const char *function, long line, const char *format_string, ...) { if (level < sl.level) return; const char *level_string = NULL; @@ -79,7 +79,7 @@ void snuk_log_msg( va_end(args); } -static void stdout_stderr_sink_write(const char *msg, size_t len, snLogLevel level, void *data) { +static void stdout_stderr_sink_write(const char *msg, size_t len, SnLogLevel level, void *data) { stdout_stderr_sink *sink = (stdout_stderr_sink *)data; bool error = level > SN_LOG_LEVEL_WARN; diff --git a/src/memory.c b/src/memory.c index 618f62c..dc11e82 100644 --- a/src/memory.c +++ b/src/memory.c @@ -20,7 +20,7 @@ static void reverse_decommit_pages(SnukPageAllocator *allocator, void *base, uin static void try_increasing_allocator_size(void); static SnukPageAllocator page_allocator; -static snFreeListAllocator galloc; +static SnFreeListAllocator galloc; bool snuk_memory_init(uint64_t reserve_size) { uint64_t page_size = sn_vm_get_page_size();