uxn

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

commit 17fd40af436315939d803ecbf98f4671889363aa
parent 18b73f48611f565f3b01728da9f1a60c5cf3d435
Author: Devine Lu Linvega <aliceffekt@gmail.com>
Date:   Tue, 31 May 2022 14:04:54 -0700

(uxnasm) Minor cleanup

Diffstat:
Msrc/uxnasm.c | 13+++++--------
1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/src/uxnasm.c b/src/uxnasm.c @@ -208,13 +208,10 @@ static int writeopcode(char *w) { Uint8 res; - /* tail-call optimization */ - if(scmp(w, "JMP2r", 5)) { - if(jsrlast) { - p.data[p.ptr - 1] = jsrlast == 2 ? findopcode("JMP2") : findopcode("JMP"); - jsrlast = 0; - return 1; - } + if(jsrlast && scmp(w, "JMP2r", 5)) { /* tail-call optimization */ + p.data[p.ptr - 1] = jsrlast == 2 ? findopcode("JMP2") : findopcode("JMP"); + jsrlast = 0; + return 1; } res = writebyte(findopcode(w)); if(scmp(w, "JSR2", 4)) @@ -235,7 +232,7 @@ writeshort(Uint16 s, int lit) static int writelitbyte(Uint8 b) { - if(litlast) { /* combine literals */ + if(litlast) { /* literals optimization */ Uint8 hb = p.data[p.ptr - 1]; p.ptr -= 2; p.length = p.ptr;