uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

commit 18f545f3c954cea701009811b892278161fcf190
parent c5a5eaff0e17f35cc11b0f90133cce4af3315554
Author: Devine Lu Linvega <aliceffekt@gmail.com>
Date:   Wed, 27 Mar 2024 09:21:34 -0700

(uxnasm) Starting to merge buffers

Diffstat:
Msrc/uxnasm.c | 16++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/uxnasm.c b/src/uxnasm.c @@ -24,7 +24,7 @@ typedef struct { } Macro; typedef struct { - char name[0x40]; + char *name; Uint16 addr, refs; } Label; @@ -73,6 +73,18 @@ static char *scat(char *dst, char *src) { char *ptr = dst + slen(dst); while(*sr /* clang-format on */ +char storage[0x10000], *storenext = storage; + +static char * +store(char *s) +{ + char *ptr = storenext; + while((*storenext++ = *s++)) + ; + *storenext++ = 0; + return ptr; +} + static int parse(char *w, FILE *f); static char *makesublabel(char *src, char *name); @@ -180,7 +192,7 @@ makelabel(char *name, int setscope) l = &p.labels[p.label_len++]; l->addr = p.ptr; l->refs = 0; - scpy(name, l->name, 0x40); + l->name = store(name); if(setscope) { int i = 0; while(name[i] != '/' && i < 0x3e && (scope[i] = name[i])) i++;