~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mystrings/dtoa.cc

  • Committer: Stewart Smith
  • Date: 2009-10-06 05:50:22 UTC
  • mto: This revision was merged to the branch mainline in revision 1170.
  • Revision ID: stewart@flamingspork.com-20091006055022-uh79cvwppcszr3xk
removeĀ unusedĀ HA_KEYTYPE_BIT

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
   You should have received a copy of the GNU General Public License
13
13
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA */
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA */
15
15
 
16
16
/****************************************************************
17
17
 
35
35
 
36
36
 ***************************************************************/
37
37
 
38
 
#include "config.h"
39
 
 
40
 
#include "drizzled/internal/m_string.h"  /* for memcpy and NOT_FIXED_DEC */
41
 
 
42
 
#include <float.h>
43
 
 
44
 
#include <cstdlib>
45
 
#include <cerrno>
 
38
#include <mystrings/m_string.h>  /* for memcpy and NOT_FIXED_DEC */
 
39
#include <stdlib.h>
 
40
 
46
41
#include <algorithm>
47
42
 
48
43
using namespace std;
49
44
 
50
 
namespace drizzled
51
 
{
52
 
namespace internal
53
 
{
54
 
 
55
45
/* Magic value returned by dtoa() to indicate overflow */
56
46
#define DTOA_OVERFLOW 9999
57
47
 
1951
1941
    *sign= 0;
1952
1942
 
1953
1943
  /* If infinity, set decpt to DTOA_OVERFLOW, if 0 set it to 1 */
1954
 
  if ((((word0(d) & Exp_mask) == Exp_mask) && ((*decpt= DTOA_OVERFLOW) != 0)) ||
1955
 
      (!dval(d) && ((*decpt= 1) != 0)))
 
1944
  if (((word0(d) & Exp_mask) == Exp_mask && (*decpt= DTOA_OVERFLOW)) ||
 
1945
      (!dval(d) && (*decpt= 1)))
1956
1946
  {
1957
1947
    /* Infinity, NaN, 0 */
1958
1948
    char *res= (char*) malloc(2);
2473
2463
    *rve= s;
2474
2464
  return s0;
2475
2465
}
2476
 
 
2477
 
} /* namespace internal */
2478
 
} /* namespace drizzled */