diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-14 15:02:40 +0100 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-14 15:02:40 +0100 |
commit | ab98c70a98e860f4cce0332d7164077cffa51b30 (patch) | |
tree | 44f429f0b0c920cb51724171ebd167b926cc8122 /src | |
parent | 6c64773dc5edd4b56eabcfa76b66b53ab76ecdf6 (diff) |
Value::numericValue() now returns a int64_t, and no longer a long
Diffstat (limited to 'src')
-rw-r--r-- | src/arithmetic.h | 14 | ||||
-rw-r--r-- | src/classbase.cpp | 6 | ||||
-rw-r--r-- | src/includes.h | 2 | ||||
-rw-r--r-- | src/numericmember.h (renamed from src/longmember.h) | 10 | ||||
-rw-r--r-- | src/value.cpp | 4 |
5 files changed, 18 insertions, 18 deletions
diff --git a/src/arithmetic.h b/src/arithmetic.h index ae690bc..21343d1 100644 --- a/src/arithmetic.h +++ b/src/arithmetic.h @@ -55,7 +55,7 @@ public: if (_value->isFloat()) return Value(F<double>()(_value->floatValue(), value)); // apply to natural numbers - return Value(F<long>()(_value->numericValue(), value)); + return Value(F<int64_t>()(_value->numericValue(), value)); } /** @@ -69,7 +69,7 @@ public: if (_value->isFloat()) return Value(F<double>()(_value->floatValue(), value)); // apply to natural numbers - return Value(F<long>()(_value->numericValue(), value)); + return Value(F<int64_t>()(_value->numericValue(), value)); } /** @@ -83,7 +83,7 @@ public: if (_value->isFloat()) return Value(F<double>()(_value->floatValue(), value)); // apply to natural numbers - return Value(F<long>()(_value->numericValue(), value)); + return Value(F<int64_t>()(_value->numericValue(), value)); } /** @@ -97,7 +97,7 @@ public: if (_value->isFloat()) return Value(F<double>()(_value->floatValue(), value?1:0)); // apply to natural numbers - return Value(F<long>()(_value->numericValue(), value?1:0)); + return Value(F<int64_t>()(_value->numericValue(), value?1:0)); } /** @@ -114,7 +114,7 @@ public: if (_value->isFloat()) return Value(F<double>()(_value->floatValue(), v)); // apply to natural numbers - return Value(F<long>()(_value->numericValue(), v)); + return Value(F<int64_t>()(_value->numericValue(), v)); } /** @@ -174,7 +174,7 @@ public: if (_value->isFloat()) return _value->operator=(F<double>()(_value->floatValue(), value)); // do a numeric operation - return _value->operator=(F<long>()(_value->numericValue(), value)); + return _value->operator=(F<int64_t>()(_value->numericValue(), value)); } /** @@ -188,7 +188,7 @@ public: if (_value->isFloat()) return _value->operator=(F<double>()(_value->floatValue(), value)); // do a numeric operation - return _value->operator=(F<long>()(_value->numericValue(), value)); + return _value->operator=(F<int64_t>()(_value->numericValue(), value)); } /** diff --git a/src/classbase.cpp b/src/classbase.cpp index 09850a7..ea24cfd 100644 --- a/src/classbase.cpp +++ b/src/classbase.cpp @@ -1595,7 +1595,7 @@ void ClassBase::property(const char *name, std::nullptr_t value, int flags) void ClassBase::property(const char *name, int16_t value, int flags) { // add property - _members.push_back(std::make_shared<LongMember>(name, value, flags)); + _members.push_back(std::make_shared<NumericMember>(name, value, flags)); } /** @@ -1607,7 +1607,7 @@ void ClassBase::property(const char *name, int16_t value, int flags) void ClassBase::property(const char *name, int32_t value, int flags) { // add property - _members.push_back(std::make_shared<LongMember>(name, value, flags)); + _members.push_back(std::make_shared<NumericMember>(name, value, flags)); } /** @@ -1619,7 +1619,7 @@ void ClassBase::property(const char *name, int32_t value, int flags) void ClassBase::property(const char *name, int64_t value, int flags) { // add property - _members.push_back(std::make_shared<LongMember>(name, value, flags)); + _members.push_back(std::make_shared<NumericMember>(name, value, flags)); } /** diff --git a/src/includes.h b/src/includes.h index 721b29e..0c00df3 100644 --- a/src/includes.h +++ b/src/includes.h @@ -83,7 +83,7 @@ #include "method.h" #include "member.h" #include "nullmember.h" -#include "longmember.h" +#include "numericmember.h" #include "boolmember.h" #include "stringmember.h" #include "floatmember.h" diff --git a/src/longmember.h b/src/numericmember.h index 09d3d8a..99889c6 100644 --- a/src/longmember.h +++ b/src/numericmember.h @@ -1,7 +1,7 @@ /** - * LongMember.h + * NumericMember.h * - * Implementation for a property that is initially set to a long value + * Implementation for a property that is initially set to a numeric value * * @author Emiel Bruijntjes <emiel.bruijntjes@copernica.com> * @copyright 2013, 2014 Copernica BV @@ -15,7 +15,7 @@ namespace Php { /** * Class definition */ -class LongMember : public Member +class NumericMember : public Member { private: /** @@ -31,12 +31,12 @@ public: * @param value * @param flags */ - LongMember(const char *name, long value, int flags) : Member(name, flags), _value(value) {} + NumericMember(const char *name, long value, int flags) : Member(name, flags), _value(value) {} /** * Destructor */ - virtual ~LongMember() {} + virtual ~NumericMember() {} /** * Declare class constant diff --git a/src/value.cpp b/src/value.cpp index 29b6dcd..9af2d14 100644 --- a/src/value.cpp +++ b/src/value.cpp @@ -74,7 +74,7 @@ Value::Value(int32_t value) } /** - * Constructor based on long value + * Constructor based on int64_t value * @param value */ Value::Value(int64_t value) @@ -1415,7 +1415,7 @@ Value Value::clone(Type type) const * Retrieve the value as integer * @return long */ -long Value::numericValue() const +int64_t Value::numericValue() const { // already a long? if (isNumeric()) return Z_LVAL_P(_val); |