~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mystrings/dtoa.cc

  • Committer: Nathan Williams
  • Date: 2009-06-24 22:50:51 UTC
  • mto: This revision was merged to the branch mainline in revision 1082.
  • Revision ID: nathanlws@gmail.com-20090624225051-r7nusz73rkzy7zt5
Converted all usages of cmin/cmax in mystrings directory to use std::min/max

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
#include <mystrings/m_string.h>  /* for memcpy and NOT_FIXED_DEC */
39
39
#include <stdlib.h>
40
40
 
 
41
#include <algorithm>
 
42
 
 
43
using namespace std;
 
44
 
41
45
/**
42
46
   Appears to suffice to not call malloc() in most cases.
43
47
   @todo
132
136
    if (len <= decpt)
133
137
      *dst++= '.';
134
138
 
135
 
    for (i= precision - cmax(0, (len - decpt)); i > 0; i--)
 
139
    for (i= precision - max(0, (len - decpt)); i > 0; i--)
136
140
      *dst++= '0';
137
141
  }
138
142
 
222
226
  if (x < 0.)
223
227
    width--;
224
228
 
225
 
  res= dtoa(x, 4, type == MY_GCVT_ARG_DOUBLE ? width : cmin(width, FLT_DIG),
 
229
  res= dtoa(x, 4, type == MY_GCVT_ARG_DOUBLE ? width : min(width, FLT_DIG),
226
230
            &decpt, &sign, &end, buf, sizeof(buf));
227
231
  if (decpt == DTOA_OVERFLOW)
228
232
  {