X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=asm.c;h=c73f25cf7956b4121a6f5e2c6c6088ef8a2991db;hb=f1a2ac624fee31664503adc4b371940b1133fb3b;hp=161943816e23f0543552b0a7bf4ed9e9b4ec0ed9;hpb=8bfbe4d6199b6b14ddbcf213ec681cdcb8374c59;p=xonotic%2Fgmqcc.git diff --git a/asm.c b/asm.c index 1619438..c73f25c 100644 --- a/asm.c +++ b/asm.c @@ -44,7 +44,7 @@ VECTOR_MAKE(asm_sym, asm_symbols); * Assembly text processing: this handles the internal collection * of text to allow parsing and assemblation. */ -static char *const asm_getline(size_t *byte, FILE *fp) { +static char* asm_getline(size_t *byte, FILE *fp) { char *line = NULL; size_t read = util_getline(&line, byte, fp); *byte = read; @@ -530,24 +530,6 @@ static GMQCC_INLINE bool asm_parse_stmt(const char *skip, size_t line, asm_state * This needs to have a fall state, we start from the * end of the string and work backwards. */ - #define OPFILL(X) \ - do { \ - size_t w = 0; \ - if (!(c = strrchr(c, ','))) { \ - printf("error, expected more operands\n"); \ - return false; \ - } \ - c++; \ - w++; \ - while (*c == ' ' || *c == '\t') { \ - c++; \ - w++; \ - } \ - X = (const char*)c; \ - c -= w; \ - *c = '\0'; \ - c = (char*)skip; \ - } while (0) #define OPEATS(X,Y) X##Y #define OPCCAT(X,Y) OPEATS(X,Y) #define OPLOAD(X,Y) \ @@ -597,7 +579,6 @@ static GMQCC_INLINE bool asm_parse_stmt(const char *skip, size_t line, asm_state OPLOAD(s.o1.s1, c); break; } - #undef OPFILL #undef OPLOAD #undef OPCCAT }