commit 3fe327a68d1448cdd5d02cf6ada6295dcce2210d
parent ec2f526437c82501d5d5b4ce8498e47cf00074c4
Author: Robert Russell <robertrussell.72001@gmail.com>
Date: Wed, 17 Jul 2024 17:19:47 -0700
Rename throw to r_throw, and leave notes to my future self
Diffstat:
4 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/inc/debug.h b/inc/debug.h
@@ -6,7 +6,7 @@
/* REQUIRE is like assert from assert.h, but it never gets disabled and it
* takes an optional message like C11's static_assert. */
-#define REQUIRE(cond, ...) ((void)((cond) || (throw( \
+#define REQUIRE(cond, ...) ((void)((cond) || (r_throw( \
"Assertion failed [%s:%d]: %s\n", \
__FILE__, __LINE__, VA_DEFAULT(,##__VA_ARGS__, #cond) \
), 0)))
@@ -27,4 +27,4 @@
/* Print the given formatted message to stderr followed by a newline,
* and then abort. */
-noreturn void throw(char *fmt, ...);
+noreturn void r_throw(char *fmt, ...);
diff --git a/inc/string.h b/inc/string.h
@@ -8,6 +8,9 @@
#include "def.h"
#include "utf8.h"
+/* TODO: Before next usage of this module, document each function and
+ * add r_/R_/R prefixes. */
+
/* Usage: printf("...%.*s...", STR_FMT(s)) */
#define STR_FMT(s) (ASSERT(str_len(s) <= INT_MAX), (int)str_len(s)), str_bytes(s)
diff --git a/inc/vmem.h b/inc/vmem.h
@@ -4,6 +4,9 @@
#include "def.h"
+/* TODO: Before next usage of this module, document each function and
+ * add r_ prefixes. */
+
usize vmem_page_size(void);
void *vmem_alloc(void *p, usize size);
void *vmem_reserve(void *p, usize size, bool swap);
diff --git a/src/debug.c b/src/debug.c
@@ -7,7 +7,7 @@
#include "rcx.h"
noreturn void
-throw(char *fmt, ...) {
+r_throw(char *fmt, ...) {
va_list args;
va_start(args, fmt);