Diff for /embedaddon/php/Zend/zend_strtod.c between versions 1.1.1.1 and 1.1.1.2

version 1.1.1.1, 2012/02/21 23:47:52 version 1.1.1.2, 2012/05/29 12:34:36
Line 2037  ret1: Line 2037  ret1:
         return s0;          return s0;
 }  }
   
/* F* VC6 */ZEND_API double zend_strtod (CONST char *s00, CONST char **se)
#if _MSC_VER <= 1300 
# pragma optimize( "", off ) 
#endif 
ZEND_API double zend_strtod (CONST char *s00, char **se) 
 {  {
         int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, dsign,          int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, dsign,
                 e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0, sign;                  e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0, sign;
Line 2574  retfree: Line 2570  retfree:
         Bfree(delta);          Bfree(delta);
 ret:  ret:
         if (se)          if (se)
                *se = (char *)s;                *se = s;
         result = sign ? -value(rv) : value(rv);          result = sign ? -value(rv) : value(rv);
   
         _THREAD_PRIVATE_MUTEX_LOCK(pow5mult_mutex);          _THREAD_PRIVATE_MUTEX_LOCK(pow5mult_mutex);
Line 2588  ret: Line 2584  ret:
         return result;          return result;
 }  }
   
ZEND_API double zend_hex_strtod(const char *str, char **endptr)ZEND_API double zend_hex_strtod(const char *str, const char **endptr)
 {  {
         const char *s = str;          const char *s = str;
         char c;          char c;
         int any = 0;          int any = 0;
         double value = 0;          double value = 0;
   
           if (strlen(str) < 2) {
                   *endptr = str;
                   return 0.0;
           }
   
         if (*s == '0' && (s[1] == 'x' || s[1] == 'X')) {          if (*s == '0' && (s[1] == 'x' || s[1] == 'X')) {
                 s += 2;                  s += 2;
         }          }
Line 2615  ZEND_API double zend_hex_strtod(const char *str, char  Line 2616  ZEND_API double zend_hex_strtod(const char *str, char 
         }          }
   
         if (endptr != NULL) {          if (endptr != NULL) {
                *endptr = (char *)(any ? s - 1 : str);                *endptr = any ? s - 1 : str;
         }          }
   
         return value;          return value;
 }  }
   
ZEND_API double zend_oct_strtod(const char *str, char **endptr)ZEND_API double zend_oct_strtod(const char *str, const char **endptr)
 {  {
         const char *s = str;          const char *s = str;
         char c;          char c;
         double value = 0;          double value = 0;
         int any = 0;          int any = 0;
   
           if (strlen(str) < 1) {
                   *endptr = str;
                   return 0.0;
           }
   
         /* skip leading zero */          /* skip leading zero */
         s++;          s++;
   
Line 2643  ZEND_API double zend_oct_strtod(const char *str, char  Line 2649  ZEND_API double zend_oct_strtod(const char *str, char 
         }          }
   
         if (endptr != NULL) {          if (endptr != NULL) {
                   *endptr = any ? s - 1 : str;
           }
   
           return value;
   }
   
   ZEND_API double zend_bin_strtod(const char *str, const char **endptr)
   {
           const char *s = str;
           char            c;
           double          value = 0;
           int             any = 0;
   
           if (strlen(str) < 2) {
                   *endptr = str;
                   return 0.0;
           }
   
           if ('0' == *s && ('b' == s[1] || 'B' == s[1])) {
                   s += 2;
           }
   
           while ((c = *s++)) {
                   /*
                    * Verify the validity of the current character as a base-2 digit.  In
                    * the event that an invalid digit is found, halt the conversion and
                    * return the portion which has been converted thus far.
                    */
                   if ('0' == c || '1' == c)
                           value = value * 2 + c - '0';
                   else
                           break;
   
                   any = 1;
           }
   
           /*
            * As with many strtoX implementations, should the subject sequence be
            * empty or not well-formed, no conversion is performed and the original
            * value of str is stored in *endptr, provided that endptr is not a null
            * pointer.
            */
           if (NULL != endptr) {
                 *endptr = (char *)(any ? s - 1 : str);                  *endptr = (char *)(any ? s - 1 : str);
         }          }
   

Removed from v.1.1.1.1  
changed lines
  Added in v.1.1.1.2


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>