From 74b6e69086d8fa379d58f09d15edaf94ebf0278c Mon Sep 17 00:00:00 2001 From: Paul Tarjan Date: Fri, 14 Jun 2013 17:45:17 -0700 Subject: [PATCH] fix what I broke with the double diff I committed the wrong version. --- hphp/runtime/base/string_data.cpp | 2 +- hphp/runtime/base/zend/zend_collator.cpp | 2 +- hphp/runtime/base/zend/zend_functions.cpp | 3 +-- hphp/runtime/base/zend/zend_math.h | 3 +-- hphp/runtime/base/zend/zend_scanf.cpp | 2 +- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/hphp/runtime/base/string_data.cpp b/hphp/runtime/base/string_data.cpp index 10f876ff4..28c361531 100644 --- a/hphp/runtime/base/string_data.cpp +++ b/hphp/runtime/base/string_data.cpp @@ -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(s.ptr); + if (s.len) return strtod(s.ptr, nullptr); return 0; } diff --git a/hphp/runtime/base/zend/zend_collator.cpp b/hphp/runtime/base/zend/zend_collator.cpp index f143964d0..5c47c2118 100644 --- a/hphp/runtime/base/zend/zend_collator.cpp +++ b/hphp/runtime/base/zend/zend_collator.cpp @@ -98,7 +98,7 @@ static double collator_u_strtod(const UChar *nptr, UChar **endptr) { } *bufpos = '\0'; - value = folly::to(numbuf); + value = strtod(numbuf, nullptr); if (numbuf != buf) { free(numbuf); diff --git a/hphp/runtime/base/zend/zend_functions.cpp b/hphp/runtime/base/zend/zend_functions.cpp index e374b5269..bceffdf22 100644 --- a/hphp/runtime/base/zend/zend_functions.cpp +++ b/hphp/runtime/base/zend/zend_functions.cpp @@ -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(str); + *dval = strtod(str, nullptr); } return KindOfDouble; } diff --git a/hphp/runtime/base/zend/zend_math.h b/hphp/runtime/base/zend/zend_math.h index 8db7238b0..0150eb042 100644 --- a/hphp/runtime/base/zend/zend_math.h +++ b/hphp/runtime/base/zend/zend_math.h @@ -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(buf); + tmp_value = strtod(buf, nullptr); /* couldn't convert to string and back */ if (std::isinf(tmp_value)) { diff --git a/hphp/runtime/base/zend/zend_scanf.cpp b/hphp/runtime/base/zend/zend_scanf.cpp index b244c828d..74a3a8814 100644 --- a/hphp/runtime/base/zend/zend_scanf.cpp +++ b/hphp/runtime/base/zend/zend_scanf.cpp @@ -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(buf); + dvalue = strtod(buf, nullptr); return_value.append(dvalue); } break;