aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/c8asm/assembler.c7
-rw-r--r--src/c8asm/common.h6
-rw-r--r--src/c8asm/parser.c1
3 files changed, 4 insertions, 10 deletions
diff --git a/src/c8asm/assembler.c b/src/c8asm/assembler.c
index 6160397..353d904 100644
--- a/src/c8asm/assembler.c
+++ b/src/c8asm/assembler.c
@@ -30,7 +30,6 @@ struct labels {
size_t len, cap;
};
-static bool u8eq(struct u8view, struct u8view);
static void pushlabel(struct labels *, struct label);
static uint16_t getaddr(struct raw_addr);
static struct label *getlabel(struct u8view);
@@ -38,12 +37,6 @@ static struct label *getlabel(struct u8view);
static size_t i;
static struct labels locals, globals;
-bool
-u8eq(struct u8view x, struct u8view y)
-{
- return x.len == y.len && memcmp(x.p, y.p, x.len) == 0;
-}
-
struct label *
getlabel(struct u8view sv)
{
diff --git a/src/c8asm/common.h b/src/c8asm/common.h
index 36a7036..165e6bc 100644
--- a/src/c8asm/common.h
+++ b/src/c8asm/common.h
@@ -6,8 +6,10 @@
#define MIN(x, y) ((x) < (y) ? (x) : (y))
#define MAX(x, y) ((x) > (y) ? (x) : (y))
-#define lengthof(a) (sizeof(a) / sizeof(*(a)))
-#define streq(x, y) (!strcmp(x, y))
+#define lengthof(a) (sizeof(a) / sizeof(*(a)))
+#define memeq(x, y, n) (!memcmp(x, y, n))
+#define streq(x, y) (!strcmp(x, y))
+#define u8eq(x, y) (!u8cmp(x, y))
extern size_t filesize;
extern const char *filename;
diff --git a/src/c8asm/parser.c b/src/c8asm/parser.c
index 03d190d..357a082 100644
--- a/src/c8asm/parser.c
+++ b/src/c8asm/parser.c
@@ -23,7 +23,6 @@
#define E_TOOLARGE "expected %s but got out-of-range integer ā€˜%.*sā€™"
#define die_with_off(P, ...) die_with_off(filename, (P)-baseptr, __VA_ARGS__)
-#define memeq(X, Y, N) (!memcmp(X, Y, N))
enum numsize {
NS_NIBBLE = 0xF,