mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 15:00:10 +01:00
gallium/tgsi/text: Replace open-coded integer parsing with parse_int().
This commit is contained in:
parent
40123dae43
commit
2faf01c840
1 changed files with 3 additions and 17 deletions
|
|
@ -466,24 +466,10 @@ parse_register_bracket(
|
|||
eat_opt_white(&ctx->cur);
|
||||
}
|
||||
|
||||
if (*ctx->cur == '+' || *ctx->cur == '-') {
|
||||
boolean negate;
|
||||
|
||||
negate = *ctx->cur == '-';
|
||||
ctx->cur++;
|
||||
eat_opt_white( &ctx->cur );
|
||||
if (!parse_uint( &ctx->cur, &uindex )) {
|
||||
report_error( ctx, "Expected literal unsigned integer" );
|
||||
return FALSE;
|
||||
}
|
||||
if (negate)
|
||||
brackets->index = -(int) uindex;
|
||||
else
|
||||
brackets->index = (int) uindex;
|
||||
}
|
||||
else {
|
||||
if (*ctx->cur == '+' || *ctx->cur == '-')
|
||||
parse_int( &ctx->cur, &brackets->index );
|
||||
else
|
||||
brackets->index = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!parse_uint( &ctx->cur, &uindex )) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue