ruby-changes:12565
From: azav <ko1@a...>
Date: Sun, 26 Jul 2009 00:18:51 +0900 (JST)
Subject: [ruby-changes:12565] Ruby:r24274 (trunk): * ext/bigdecimal.c: moved BASE_FIG definition before it is used first time.
azav 2009-07-26 00:18:37 +0900 (Sun, 26 Jul 2009) New Revision: 24274 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=24274 Log: * ext/bigdecimal.c: moved BASE_FIG definition before it is used first time. Modified files: trunk/ext/bigdecimal/bigdecimal.c Index: ext/bigdecimal/bigdecimal.c =================================================================== --- ext/bigdecimal/bigdecimal.c (revision 24273) +++ ext/bigdecimal/bigdecimal.c (revision 24274) @@ -39,6 +39,24 @@ #define SAVE(p) PUSH(p->obj); #define GUARD_OBJ(p,y) {p=y;SAVE(p);} +#ifndef BASE_FIG +static U_LONG BASE_FIG = 4; /* =log10(BASE) */ +static U_LONG BASE = 10000L; /* Base value(value must be 10**BASE_FIG) */ + /* The value of BASE**2 + BASE must be represented */ + /* within one U_LONG. */ +static U_LONG HALF_BASE = 5000L;/* =BASE/2 */ +static U_LONG BASE1 = 1000L; /* =BASE/10 */ +#else +#ifndef BASE +#error BASE_FIG is defined but BASE is not +#endif +#define HALF_BASE (BASE/2) +#define BASE1 (BASE/10) +#endif +#ifndef DBLE_FIG +#define DBLE_FIG (DBL_DIG+1) /* figure of double */ +#endif + /* * ================== Ruby Interface part ========================== */ @@ -2062,24 +2080,6 @@ static U_LONG gnPrecLimit = 0; /* Global upper limit of the precision newly allocated */ static U_LONG gfRoundMode = VP_ROUND_HALF_UP; /* Mode for general rounding operation */ -#ifndef BASE_FIG -static U_LONG BASE_FIG = 4; /* =log10(BASE) */ -static U_LONG BASE = 10000L; /* Base value(value must be 10**BASE_FIG) */ - /* The value of BASE**2 + BASE must be represented */ - /* within one U_LONG. */ -static U_LONG HALF_BASE = 5000L;/* =BASE/2 */ -static U_LONG BASE1 = 1000L; /* =BASE/10 */ -#else -#ifndef BASE -#error BASE_FIG is defined but BASE is not -#endif -#define HALF_BASE (BASE/2) -#define BASE1 (BASE/10) -#endif -#ifndef DBLE_FIG -#define DBLE_FIG (DBL_DIG+1) /* figure of double */ -#endif - static Real *VpConstOne; /* constant 1.0 */ static Real *VpPt5; /* constant 0.5 */ #define maxnr 100UL /* Maximum iterations for calcurating sqrt. */ -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/