(uxnasm) Removed unused param in walkcomment

This commit is contained in:
Devine Lu Linvega 2024-03-27 11:49:05 -07:00
parent 5c4e14555b
commit 59b7ee83c5
1 changed files with 6 additions and 8 deletions

View File

@ -100,16 +100,14 @@ findopcode(char *s)
} }
static int static int
walkcomment(char *w, FILE *f) walkcomment(FILE *f)
{ {
int depth = 1;
char c; char c;
int depth = 1;
while(fread(&c, 1, 1, f)) { while(fread(&c, 1, 1, f)) {
if(c == 0xa) line++; if(c == 0xa) line++;
if(c == '(') if(c == '(') depth++;
depth++; if(c == ')' && --depth < 1) return 1;
else if(c == ')' && --depth < 1)
return 1;
} }
return 0; return 0;
} }
@ -132,7 +130,7 @@ makemacro(char *name, FILE *f)
if(word[0] == '}') break; if(word[0] == '}') break;
if(word[0] == '%') return error_asm("Macro error"); if(word[0] == '%') return error_asm("Macro error");
if(word[0] == '(') { if(word[0] == '(') {
if(!walkcomment(word, f)) return error_asm("Comment error"); if(!walkcomment(f)) return error_asm("Comment error");
continue; continue;
} }
push(word, ' '); push(word, ' ');
@ -287,7 +285,7 @@ parse(char *w, FILE *f)
char c; char c;
Item *m; Item *m;
switch(w[0]) { switch(w[0]) {
case '(': return !walkcomment(w, f) ? error_asm("Invalid comment") : 1; case '(': return !walkcomment(f) ? error_asm("Invalid comment") : 1;
case '~': return !makeinclude(w + 1) ? error_asm("Invalid include") : 1; case '~': return !makeinclude(w + 1) ? error_asm("Invalid include") : 1;
case '%': return !makemacro(w + 1, f) ? error_asm("Invalid macro") : 1; case '%': return !makemacro(w + 1, f) ? error_asm("Invalid macro") : 1;
case '@': return !makelabel(w + 1, 1) ? error_asm("Invalid label") : 1; case '@': return !makelabel(w + 1, 1) ? error_asm("Invalid label") : 1;