mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* util.c (ruby_strtod, dtoa): initialize more variables for error
handling. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4940cff399
commit
54afba10a5
2 changed files with 12 additions and 7 deletions
|
@ -1,3 +1,8 @@
|
|||
Mon Jun 2 08:46:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* util.c (ruby_strtod, dtoa): initialize more variables for error
|
||||
handling.
|
||||
|
||||
Mon Jun 2 05:27:58 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* io.c (rscheck), marshal.c (w_nbyte, w_bytes, w_unique),
|
||||
|
|
14
util.c
14
util.c
|
@ -6,7 +6,7 @@
|
|||
$Date$
|
||||
created at: Fri Mar 10 17:22:34 JST 1995
|
||||
|
||||
Copyright (C) 1993-2003 Yukihiro Matsumoto
|
||||
Copyright (C) 1993-2008 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
@ -53,7 +53,7 @@ scan_hex(start, len, retlen)
|
|||
int len;
|
||||
int *retlen;
|
||||
{
|
||||
static char hexdigit[] = "0123456789abcdef0123456789ABCDEF";
|
||||
static const char hexdigit[] = "0123456789abcdef0123456789ABCDEF";
|
||||
register const char *s = start;
|
||||
register unsigned long retval = 0;
|
||||
char *tmp;
|
||||
|
@ -152,8 +152,8 @@ scan_hex(start, len, retlen)
|
|||
|
||||
static int valid_filename(char *s);
|
||||
|
||||
static char suffix1[] = ".$$$";
|
||||
static char suffix2[] = ".~~~";
|
||||
static const char suffix1[] = ".$$$";
|
||||
static const char suffix2[] = ".~~~";
|
||||
|
||||
#define ext (&buf[1000])
|
||||
|
||||
|
@ -2112,6 +2112,7 @@ ruby_strtod(const char *s00, char **se)
|
|||
const char *s2;
|
||||
#endif
|
||||
|
||||
errno = 0;
|
||||
sign = nz0 = nz = 0;
|
||||
dval(rv) = 0.;
|
||||
for (s = s00;;s++)
|
||||
|
@ -2291,7 +2292,7 @@ ret0:
|
|||
#endif
|
||||
dval(rv) = tens[k - 9] * dval(rv) + z;
|
||||
}
|
||||
bd0 = 0;
|
||||
bd0 = bb = bd = bs = delta = 0;
|
||||
if (nd <= DBL_DIG
|
||||
#ifndef RND_PRODQUOT
|
||||
#ifndef Honor_FLT_ROUNDS
|
||||
|
@ -3217,7 +3218,7 @@ dtoa(double d, int mode, int ndigits, int *decpt, int *sign, char **rve)
|
|||
int denorm;
|
||||
ULong x;
|
||||
#endif
|
||||
Bigint *b, *b1, *delta, *mlo, *mhi, *S;
|
||||
Bigint *b, *b1, *delta, *mlo = 0, *mhi = 0, *S;
|
||||
double d2, ds, eps;
|
||||
char *s, *s0;
|
||||
#ifdef Honor_FLT_ROUNDS
|
||||
|
@ -3570,7 +3571,6 @@ bump_up:
|
|||
|
||||
m2 = b2;
|
||||
m5 = b5;
|
||||
mhi = mlo = 0;
|
||||
if (leftright) {
|
||||
i =
|
||||
#ifndef Sudden_Underflow
|
||||
|
|
Loading…
Add table
Reference in a new issue