From a3022b820fa3bb5c5d2ee3260afa5b521a804c1d Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 30 Sep 2002 22:01:05 +0000 Subject: Update. 2002-09-30 Isamu Hasegawa * posix/regex_internal.h (re_match_context_t): Add a new member. (re_fail_stack_ent_t): New structure. (re_fail_stack_t): Likewise. * posix/regexec.c (re_search_internal): Use the new member of re_match_context_t. Use fail stack only if it has back references and there are plural matching candidates. (proceed_next_node): Use fail stack if it is indicated. (set_regs): Likewise. (push_fail_stack): New function. (pop_fail_stack): New function. (check_dst_limits): Likewise. (check_dst_limits_calc_pos): Likewise. (search_subexp): Check the limitations on the top of subexpressions. (sift_states_bkref): Check the limitations of the destination node. Reuse the array sctx->sifted_states. 2002-09-30 Ulrich Drepper * stdio-common/printf_fp.c: Shuffle a few lines around to help the compiler optimizing. No semantical changes intended. --- stdio-common/printf_fp.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'stdio-common/printf_fp.c') diff --git a/stdio-common/printf_fp.c b/stdio-common/printf_fp.c index b8813aa35d..e746101ddf 100644 --- a/stdio-common/printf_fp.c +++ b/stdio-common/printf_fp.c @@ -212,8 +212,7 @@ __printf_fp (FILE *fp, else if (scalesize == 0) { hi = frac[fracsize - 1]; - cy = __mpn_mul_1 (frac, frac, fracsize - 1, 10); - frac[fracsize - 1] = cy; + frac[fracsize - 1] = __mpn_mul_1 (frac, frac, fracsize - 1, 10); } else { @@ -237,9 +236,9 @@ __printf_fp (FILE *fp, } } - cy = __mpn_mul_1 (frac, frac, fracsize, 10); - if (cy != 0) - frac[fracsize++] = cy; + mp_limb_t _cy = __mpn_mul_1 (frac, frac, fracsize, 10); + if (_cy != 0) + frac[fracsize++] = _cy; } return L'0' + hi; @@ -364,6 +363,7 @@ __printf_fp (FILE *fp, /* Check for special values: not a number or infinity. */ if (__isnan (fpnum.dbl)) { + is_neg = 0; if (isupper (info->spec)) { special = "NAN"; @@ -374,10 +374,10 @@ __printf_fp (FILE *fp, special = "nan"; wspecial = L"nan"; } - is_neg = 0; } else if (__isinf (fpnum.dbl)) { + is_neg = fpnum.dbl < 0; if (isupper (info->spec)) { special = "INF"; @@ -388,7 +388,6 @@ __printf_fp (FILE *fp, special = "inf"; wspecial = L"inf"; } - is_neg = fpnum.dbl < 0; } else { @@ -814,6 +813,8 @@ __printf_fp (FILE *fp, { type = 'f'; fracdig_min = fracdig_max = info->prec < 0 ? 6 : info->prec; + dig_max = INT_MAX; /* Unlimited. */ + significant = 1; /* Does not matter here. */ if (expsign == 0) { intdig_max = exponent + 1; @@ -825,8 +826,6 @@ __printf_fp (FILE *fp, intdig_max = 1; chars_needed = 1 + 1 + fracdig_max; } - dig_max = INT_MAX; /* Unlimited. */ - significant = 1; /* Does not matter here. */ } else { @@ -912,7 +911,7 @@ __printf_fp (FILE *fp, { ++fracdig_no; *wcp = hack_digit (); - if (*wcp != L'0') + if (*wcp++ != L'0') significant = 1; else if (significant == 0) { @@ -920,7 +919,6 @@ __printf_fp (FILE *fp, if (fracdig_min > 0) ++fracdig_min; } - ++wcp; } /* Do rounding. */ -- cgit v1.2.3