summaryrefslogtreecommitdiff
path: root/php/src
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2018-05-03 16:40:47 +0200
committerBenoit Foucher <benoit@zeroc.com>2018-05-03 16:40:59 +0200
commit75d923080037abc369a068e03c3f9076a83d3879 (patch)
treefaf99fc07c3b14d63c2ffaedd6ca899ec7255bac /php/src
parentRemove useless lock in .NET TraceLoggerI (diff)
downloadice-75d923080037abc369a068e03c3f9076a83d3879.tar.bz2
ice-75d923080037abc369a068e03c3f9076a83d3879.tar.xz
ice-75d923080037abc369a068e03c3f9076a83d3879.zip
Fixed issue where parsing of 64-bits values would be incorrect on Windows, fixes #79
Diffstat (limited to 'php/src')
-rw-r--r--php/src/php7/Communicator.cpp4
-rw-r--r--php/src/php7/Properties.cpp7
-rw-r--r--php/src/php7/Proxy.cpp16
-rw-r--r--php/src/php7/Types.cpp2
4 files changed, 15 insertions, 14 deletions
diff --git a/php/src/php7/Communicator.cpp b/php/src/php7/Communicator.cpp
index 819b9a4c350..fc8575820bc 100644
--- a/php/src/php7/Communicator.cpp
+++ b/php/src/php7/Communicator.cpp
@@ -1274,7 +1274,7 @@ ZEND_FUNCTION(Ice_register)
zval* comm;
char* s;
size_t sLen;
- long expires = 0;
+ zend_long expires = 0;
if(zend_parse_parameters(ZEND_NUM_ARGS(), const_cast<char*>("Os|l"), &comm, communicatorClassEntry, &s,
&sLen, &expires) != SUCCESS)
{
@@ -1449,7 +1449,7 @@ ZEND_FUNCTION(Ice_identityToString)
assert(identityClass);
zval* zv;
- long mode = 0;
+ zend_long mode = 0;
if(zend_parse_parameters(ZEND_NUM_ARGS(), const_cast<char*>("O|l"), &zv, identityClass, &mode) != SUCCESS)
{
diff --git a/php/src/php7/Properties.cpp b/php/src/php7/Properties.cpp
index 16abe91eea7..87d040f7c65 100644
--- a/php/src/php7/Properties.cpp
+++ b/php/src/php7/Properties.cpp
@@ -162,7 +162,7 @@ ZEND_METHOD(Ice_Properties, getPropertyAsIntWithDefault)
{
char* name;
size_t nameLen;
- long def;
+ zend_long def;
if(zend_parse_parameters(ZEND_NUM_ARGS(), const_cast<char*>("sl"), &name, &nameLen, &def) == FAILURE)
{
@@ -175,8 +175,9 @@ ZEND_METHOD(Ice_Properties, getPropertyAsIntWithDefault)
string propName(name, nameLen);
try
{
- Ice::Int val = _this->getPropertyAsIntWithDefault(propName, def);
- RETURN_LONG(static_cast<long>(val));
+ // TODO: Range check
+ Ice::Int val = _this->getPropertyAsIntWithDefault(propName, static_cast<Ice::Int>(def));
+ RETURN_LONG(val);
}
catch(const IceUtil::Exception& ex)
{
diff --git a/php/src/php7/Proxy.cpp b/php/src/php7/Proxy.cpp
index 7ce84804caa..712c9dad754 100644
--- a/php/src/php7/Proxy.cpp
+++ b/php/src/php7/Proxy.cpp
@@ -462,7 +462,7 @@ ZEND_METHOD(Ice_ObjectPrx, ice_locatorCacheTimeout)
ProxyPtr _this = Wrapper<ProxyPtr>::value(getThis());
assert(_this);
- long l;
+ zend_long l;
if(zend_parse_parameters(ZEND_NUM_ARGS(), const_cast<char*>("l"), &l) != SUCCESS)
{
RETURN_NULL();
@@ -470,7 +470,7 @@ ZEND_METHOD(Ice_ObjectPrx, ice_locatorCacheTimeout)
try
{
- if(!_this->clone(return_value, _this->proxy->ice_locatorCacheTimeout(l)))
+ if(!_this->clone(return_value, _this->proxy->ice_locatorCacheTimeout(static_cast<Ice::Int>(l))))
{
RETURN_NULL();
}
@@ -556,7 +556,7 @@ ZEND_METHOD(Ice_ObjectPrx, ice_endpointSelection)
ProxyPtr _this = Wrapper<ProxyPtr>::value(getThis());
assert(_this);
- long l;
+ zend_long l;
if(zend_parse_parameters(ZEND_NUM_ARGS(), const_cast<char*>("l"), &l) != SUCCESS)
{
RETURN_NULL();
@@ -1190,13 +1190,13 @@ ZEND_METHOD(Ice_ObjectPrx, ice_timeout)
try
{
- long l;
+ zend_long l;
if(zend_parse_parameters(ZEND_NUM_ARGS(), const_cast<char*>("l"), &l) != SUCCESS)
{
RETURN_NULL();
}
// TODO: range check?
- if(!_this->clone(return_value, _this->proxy->ice_timeout(l)))
+ if(!_this->clone(return_value, _this->proxy->ice_timeout(static_cast<Ice::Int>(l))))
{
RETURN_NULL();
}
@@ -1237,20 +1237,20 @@ ZEND_METHOD(Ice_ObjectPrx, ice_getTimeout)
}
}
-ZEND_METHOD(Ice_ObjectPrx, ice_invocationTimeout )
+ZEND_METHOD(Ice_ObjectPrx, ice_invocationTimeout)
{
ProxyPtr _this = Wrapper<ProxyPtr>::value(getThis());
assert(_this);
try
{
- long l;
+ zend_long l;
if(zend_parse_parameters(ZEND_NUM_ARGS(), const_cast<char*>("l"), &l) != SUCCESS)
{
RETURN_NULL();
}
// TODO: range check?
- if(!_this->clone(return_value, _this->proxy->ice_invocationTimeout (l)))
+ if(!_this->clone(return_value, _this->proxy->ice_invocationTimeout(static_cast<Ice::Int>(l))))
{
RETURN_NULL();
}
diff --git a/php/src/php7/Types.cpp b/php/src/php7/Types.cpp
index b7e274165dc..d6983d721c1 100644
--- a/php/src/php7/Types.cpp
+++ b/php/src/php7/Types.cpp
@@ -3706,7 +3706,7 @@ ZEND_FUNCTION(IcePHP_defineClass)
size_t idLen;
char* name;
size_t nameLen;
- long compactId;
+ zend_long compactId;
zend_bool preserve;
zend_bool interface;
zval* base;