From 64e8bc30abaa7109adb62330d94be41ef4769e0c Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Thu, 11 Apr 2024 09:26:55 -0700 Subject: [PATCH] Housekeeping --- src/modal.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modal.c b/src/modal.c index 7f7ca72..781a801 100644 --- a/src/modal.c +++ b/src/modal.c @@ -5,14 +5,14 @@ typedef struct { char *a, *b; } Rule; -static int direction; +static int dst; static Rule rules[0x1000], lambda, *rules_ = rules; static char dict[0x8000], *dict_ = dict; static char bank_a[0x4000], *prog_ = bank_a; static char bank_b[0x4000], *outp_ = bank_b; static char *regs[0x100]; -#define spacer(c) (c < 0x21 || c == '(' || c == ')') +#define spacer(c) (c <= ' ' || c == '(' || c == ')') static char * walk(char *s) @@ -118,7 +118,7 @@ commit_rule(Rule *r, char *s, int create) while((*outp_++ = *s++)) ; *outp_++ = 0; - if((direction = !direction)) + if((dst = !dst)) prog_ = bank_b, outp_ = bank_a; else prog_ = bank_a, outp_ = bank_b; @@ -168,7 +168,7 @@ create_rule(Rule *r, int id, char *s) static int rewrite(void) { - char c, last = 0, *p = direction ? bank_b : bank_a, *res; + char c, last = 0, *p = dst ? bank_b : bank_a, *res; while((c = *p) && c <= ' ') p++; while((c = *p)) { if(spacer(last)) {