diff options
Diffstat (limited to 'strings/decimal.c')
-rw-r--r-- | strings/decimal.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/strings/decimal.c b/strings/decimal.c index 6c89657004c..f4a2621e194 100644 --- a/strings/decimal.c +++ b/strings/decimal.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,7 +32,7 @@ integer that determines the number of significant digits in a particular radix R, where R is either 2 or 10. S is a non-negative integer. Every value of an exact numeric type of scale S is of the - form n*10^{-S}, where n is an integer such that -R^P <= n <= R^P. + form n*10^{-S}, where n is an integer such that �-R^P <= n <= R^P. [...] @@ -100,11 +101,10 @@ implementation-defined. */ -#include <my_global.h> +#include "strings_def.h" #include <m_ctype.h> #include <myisampack.h> #include <my_sys.h> /* for my_alloca */ -#include <m_string.h> #include <decimal.h> /* @@ -145,7 +145,7 @@ static double scaler1[]= { 1.0, 10.0, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9 }; -#ifdef HAVE_purify +#ifdef HAVE_valgrind #define sanity(d) DBUG_ASSERT((d)->len > 0) #else #define sanity(d) DBUG_ASSERT((d)->len >0 && ((d)->buf[0] | \ @@ -307,7 +307,7 @@ int decimal_actual_fraction(decimal_t *from) { for (i= DIG_PER_DEC1 - ((frac - 1) % DIG_PER_DEC1); *buf0 % powers10[i++] == 0; - frac--) ; + frac--) {} } return frac; } @@ -502,7 +502,7 @@ static void digits_bounds(decimal_t *from, int *start_result, int *end_result) stop= (int) ((buf_end - from->buf + 1) * DIG_PER_DEC1); i= 1; } - for (; *buf_end % powers10[i++] == 0; stop--) ; + for (; *buf_end % powers10[i++] == 0; stop--) {} *end_result= stop; /* index of position after last decimal digit (from 0) */ } @@ -996,7 +996,7 @@ int double2decimal(double from, decimal_t *to) char buff[400], *end; int length, res; DBUG_ENTER("double2decimal"); - length= sprintf(buff, "%.16G", from); + length= my_sprintf(buff, (buff, "%.16G", from)); DBUG_PRINT("info",("from: %g from_as_str: %s", from, buff)); end= buff+length; res= string2decimal(buff, to, &end); @@ -1013,7 +1013,7 @@ static int ull2dec(ulonglong from, decimal_t *to) sanity(to); - for (intg1=1; from >= DIG_BASE; intg1++, from/=DIG_BASE) ; + for (intg1=1; from >= DIG_BASE; intg1++, from/=DIG_BASE) {} if (unlikely(intg1 > to->len)) { intg1=to->len; |