fix what I broke with the double diff

I committed the wrong version.
Esse commit está contido em:
Paul Tarjan
2013-06-14 17:45:17 -07:00
commit de Sara Golemon
commit 74b6e69086
5 arquivos alterados com 5 adições e 7 exclusões
+1 -1
Ver Arquivo
@@ -824,7 +824,7 @@ int64_t StringData::toInt64(int base /* = 10 */) const {
double StringData::toDouble() const {
StringSlice s = slice();
if (s.len) return folly::to<double>(s.ptr);
if (s.len) return strtod(s.ptr, nullptr);
return 0;
}
+1 -1
Ver Arquivo
@@ -98,7 +98,7 @@ static double collator_u_strtod(const UChar *nptr, UChar **endptr) {
}
*bufpos = '\0';
value = folly::to<double>(numbuf);
value = strtod(numbuf, nullptr);
if (numbuf != buf) {
free(numbuf);
+1 -2
Ver Arquivo
@@ -17,7 +17,6 @@
#include "hphp/runtime/base/zend/zend_functions.h"
#include "hphp/runtime/base/zend/zend_strtod.h"
#include "folly/Conv.h"
namespace HPHP {
@@ -184,7 +183,7 @@ DataType is_numeric_string(const char *str, int length, int64_t *lval,
int cmp = strcmp(&ptr[-digits], long_min_digits);
if (!(cmp < 0 || (cmp == 0 && *str == '-'))) {
if (dval) {
*dval = folly::to<double>(str);
*dval = strtod(str, nullptr);
}
return KindOfDouble;
}
+1 -2
Ver Arquivo
@@ -19,7 +19,6 @@
#define incl_HPHP_ZEND_MATH_H_
#include "hphp/util/base.h"
#include "folly/Conv.h"
namespace HPHP {
///////////////////////////////////////////////////////////////////////////////
@@ -116,7 +115,7 @@ inline double php_math_round(double value, int places,
char buf[40];
snprintf(buf, 39, "%15fe%d", tmp_value, -places);
buf[39] = '\0';
tmp_value = folly::to<double>(buf);
tmp_value = strtod(buf, nullptr);
/* couldn't convert to string and back */
if (std::isinf(tmp_value)) {
+1 -1
Ver Arquivo
@@ -1045,7 +1045,7 @@ int string_sscanf(const char *string, const char *format, int numVars,
if (!(flags & SCAN_SUPPRESS)) {
double dvalue;
*end = '\0';
dvalue = folly::to<double>(buf);
dvalue = strtod(buf, nullptr);
return_value.append(dvalue);
}
break;