aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--string.h3
-rw-r--r--testing.h4
3 files changed, 5 insertions, 4 deletions
diff --git a/README.md b/README.md
index bacfc0d..7ee2af7 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@
- Benchmark 1MB file
- More modern include pragma (once)
- File structure
-- Ignore some errors
+- Static functions for private?
## Resources
diff --git a/string.h b/string.h
index 2420f91..a984929 100644
--- a/string.h
+++ b/string.h
@@ -6,7 +6,8 @@
#ifndef STRING_H
#define STRING_H
-#define S(s) (Str){s, sizeof(s) - 1}
+#define S(s) \
+ (Str) { s, lengthof(s) }
typedef struct {
byte *data;
size len;
diff --git a/testing.h b/testing.h
index 3fc5df5..d7247f1 100644
--- a/testing.h
+++ b/testing.h
@@ -10,7 +10,7 @@
#define t_assert_equal(a, b) \
if (!(a == b)) { \
fprintf(stderr, \
- "Assertion failed: %d (%s) != %d (%s) at %s:%d in %s()\n", a, \
- #a, b, #b, __FILE__, __LINE__, __func__); \
+ "Assertion failed: %d (%s) != %d (%s) at %s:%d in %s()\n", \
+ (int)a, #a, (int)b, #b, __FILE__, __LINE__, __func__); \
return 1; \
}