Gentoo Archives: gentoo-commits

From: "Mike Frysinger (vapier)" <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-libs/gmp/files/4.2.2: mpf_set_str.c.diff
Date: Fri, 02 May 2008 04:23:55
Message-Id: E1JrmoL-0008FM-EL@stork.gentoo.org
1 vapier 08/05/02 04:23:53
2
3 Added: mpf_set_str.c.diff
4 Log:
5 Add fix from upstream.
6 (Portage version: 2.2_pre5)
7
8 Revision Changes Path
9 1.1 dev-libs/gmp/files/4.2.2/mpf_set_str.c.diff
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-libs/gmp/files/4.2.2/mpf_set_str.c.diff?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-libs/gmp/files/4.2.2/mpf_set_str.c.diff?rev=1.1&content-type=text/plain
13
14 Index: mpf_set_str.c.diff
15 ===================================================================
16 *** mpf/set_str.c 30 Aug 2007 18:19:41 -0000
17 --- mpf/set_str.c 10 Dec 2007 04:47:18 -0000
18 *************** mpf_set_str (mpf_ptr x, const char *str,
19 *** 272,277 ****
20
21 if (expptr != 0)
22 ! /* FIXME: Should do some error checking here. */
23 ! exp_in_base = strtol (expptr, (char **) 0, exp_base);
24 else
25 exp_in_base = 0;
26 --- 272,298 ----
27
28 if (expptr != 0)
29 ! {
30 ! /* Scan and convert the exponent, in base exp_base. */
31 ! long dig, neg = -(long) ('-' == expptr[0]);
32 ! expptr -= neg; /* conditional increment */
33 ! c = (unsigned char) *expptr++;
34 ! dig = digit_value[c];
35 ! if (dig >= exp_base)
36 ! {
37 ! TMP_FREE;
38 ! return -1;
39 ! }
40 ! exp_in_base = dig;
41 ! c = (unsigned char) *expptr++;
42 ! dig = digit_value[c];
43 ! while (dig < exp_base)
44 ! {
45 ! exp_in_base = exp_in_base * exp_base;
46 ! exp_in_base += dig;
47 ! c = (unsigned char) *expptr++;
48 ! dig = digit_value[c];
49 ! }
50 ! exp_in_base = (exp_in_base ^ neg) - neg; /* conditional negation */
51 ! }
52 else
53 exp_in_base = 0;
54
55
56
57 --
58 gentoo-commits@l.g.o mailing list