mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-03-19 18:00:23 +08:00
parse_line: Shrink code with memset helper
We know that P_none = 0 thus instead of using for() statement assign them all in one memset call. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
parent
525ef26359
commit
836492fbcf
5
parser.c
5
parser.c
@ -201,7 +201,6 @@ insn *parse_line(int pass, char *buffer, insn *result, ldfunc ldef)
|
||||
int critical;
|
||||
bool first;
|
||||
bool recover;
|
||||
int j;
|
||||
|
||||
restart_parse:
|
||||
first = true;
|
||||
@ -261,8 +260,8 @@ restart_parse:
|
||||
return result;
|
||||
}
|
||||
|
||||
for (j = 0; j < MAXPREFIX; j++)
|
||||
result->prefixes[j] = P_none;
|
||||
nasm_build_assert(P_none != 0);
|
||||
memset(result->prefixes, P_none, sizeof(result->prefixes));
|
||||
result->times = 1L;
|
||||
|
||||
while (i == TOKEN_PREFIX ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user