[Mesa-dev] [PATCH v2 08/12] gallium/tgsi/text: Replace open-coded integer parsing with parse_int().
Francisco Jerez
currojerez at riseup.net
Sat Mar 24 06:40:01 PDT 2012
---
src/gallium/auxiliary/tgsi/tgsi_text.c | 20 +++-----------------
1 file changed, 3 insertions(+), 17 deletions(-)
diff --git a/src/gallium/auxiliary/tgsi/tgsi_text.c b/src/gallium/auxiliary/tgsi/tgsi_text.c
index a63e8d7..3fd764f 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_text.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_text.c
@@ -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 )) {
--
1.7.9.2
More information about the mesa-dev
mailing list