diff --git a/hphp/runtime/base/builtin_functions.h b/hphp/runtime/base/builtin_functions.h index 3cb8b0a74..9e4a51fb0 100644 --- a/hphp/runtime/base/builtin_functions.h +++ b/hphp/runtime/base/builtin_functions.h @@ -94,11 +94,11 @@ bool empty(CVarRef v, CStrRef, bool = false) = delete; inline Variant bitwise_or (CVarRef v1, CVarRef v2) { return v1 | v2;} inline Variant bitwise_and(CVarRef v1, CVarRef v2) { return v1 & v2;} inline Variant bitwise_xor(CVarRef v1, CVarRef v2) { return v1 ^ v2;} -inline Numeric multiply(CVarRef v1, CVarRef v2) { return v1 * v2;} +inline Variant multiply(CVarRef v1, CVarRef v2) { return v1 * v2;} inline Variant plus(CVarRef v1, CVarRef v2) { return v1 + v2;} -inline Numeric minus(CVarRef v1, CVarRef v2) { return v1 - v2;} -inline Numeric divide(CVarRef v1, CVarRef v2) { return v1 / v2; } -inline Numeric modulo(int64_t v1, int64_t v2) { +inline Variant minus(CVarRef v1, CVarRef v2) { return v1 - v2;} +inline Variant divide(CVarRef v1, CVarRef v2) { return v1 / v2; } +inline Variant modulo(int64_t v1, int64_t v2) { if (UNLIKELY(v2 == 0)) { raise_warning(Strings::DIVISION_BY_ZERO); return false; diff --git a/hphp/runtime/base/types.h b/hphp/runtime/base/types.h index a49e639ea..9f1e8cc96 100644 --- a/hphp/runtime/base/types.h +++ b/hphp/runtime/base/types.h @@ -49,10 +49,6 @@ template class SmartObject; class Variant; class VarNR; class RefData; -typedef Variant Numeric; -typedef Variant Primitive; -typedef Variant PlusOperand; -typedef Variant Sequence; /** * Macros related to Variant that are needed by StringData, ObjectData, diff --git a/hphp/runtime/ext/ext_math.cpp b/hphp/runtime/ext/ext_math.cpp index e63d7878c..46c273e48 100644 --- a/hphp/runtime/ext/ext_math.cpp +++ b/hphp/runtime/ext/ext_math.cpp @@ -168,7 +168,7 @@ Variant f_base_convert(CStrRef number, int64_t frombase, int64_t tobase) { return String(string_numeric_to_base(v, tobase), AttachString); } -Numeric f_pow(CVarRef base, CVarRef exp) { +Variant f_pow(CVarRef base, CVarRef exp) { int64_t bint, eint; double bdbl, edbl; DataType bt = base.toNumeric(bint, bdbl, true); diff --git a/hphp/runtime/ext/ext_math.h b/hphp/runtime/ext/ext_math.h index 3a317d922..5f8807692 100644 --- a/hphp/runtime/ext/ext_math.h +++ b/hphp/runtime/ext/ext_math.h @@ -73,7 +73,7 @@ Variant f_bindec(CStrRef binary_string); Variant f_hexdec(CStrRef hex_string); Variant f_octdec(CStrRef octal_string); Variant f_base_convert(CStrRef number, int64_t frombase, int64_t tobase); -Numeric f_pow(CVarRef base, CVarRef exp); +Variant f_pow(CVarRef base, CVarRef exp); double f_exp(double arg); double f_expm1(double arg); double f_log10(double arg); diff --git a/hphp/runtime/vm/bytecode.cpp b/hphp/runtime/vm/bytecode.cpp index d8fb07344..0b4c646f5 100644 --- a/hphp/runtime/vm/bytecode.cpp +++ b/hphp/runtime/vm/bytecode.cpp @@ -3716,7 +3716,7 @@ inline void OPTBLD_INLINE VMExecutionContext::iopDiv(PC& pc) { #undef MATHOP_DOUBLE // XXX: -Numeric moduloVar(CVarRef v1, CVarRef v2) { +Variant moduloVar(CVarRef v1, CVarRef v2) { return modulo(v1.toInt64(), v2.toInt64()); }