summaryrefslogtreecommitdiff
path: root/php/src
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2008-05-28 08:59:58 -0700
committerBenoit Foucher <benoit@zeroc.com>2008-06-06 12:25:27 +0200
commitbd9e134c47cfee5413810e59fa40efa1e340f985 (patch)
tree65c931660e1d82c3e67ecf8677bc57a0db9b8e4e /php/src
parentfixing py/config/Make.rules in branch (diff)
downloadice-bd9e134c47cfee5413810e59fa40efa1e340f985.tar.bz2
ice-bd9e134c47cfee5413810e59fa40efa1e340f985.tar.xz
ice-bd9e134c47cfee5413810e59fa40efa1e340f985.zip
bug 3141 - fixing GCC warnings in IcePHP
Diffstat (limited to 'php/src')
-rw-r--r--php/src/IcePHP/Communicator.cpp12
-rw-r--r--php/src/IcePHP/Marshal.cpp57
-rw-r--r--php/src/IcePHP/Profile.cpp5
-rw-r--r--php/src/IcePHP/Proxy.cpp6
-rw-r--r--php/src/IcePHP/Util.cpp16
5 files changed, 58 insertions, 38 deletions
diff --git a/php/src/IcePHP/Communicator.cpp b/php/src/IcePHP/Communicator.cpp
index 66d34fe22da..0f9e3d6e72d 100644
--- a/php/src/IcePHP/Communicator.cpp
+++ b/php/src/IcePHP/Communicator.cpp
@@ -105,9 +105,10 @@ IcePHP::getCommunicator(TSRMLS_D)
{
Ice::CommunicatorPtr result;
- zval **zv;
- if(zend_hash_find(&EG(symbol_table), "ICE", sizeof("ICE"), reinterpret_cast<void **>(&zv)) == SUCCESS)
+ void* data;
+ if(zend_hash_find(&EG(symbol_table), "ICE", sizeof("ICE"), &data) == SUCCESS)
{
+ zval** zv = reinterpret_cast<zval**>(data);
ice_object* obj = getObject(*zv TSRMLS_CC);
assert(obj);
@@ -139,9 +140,10 @@ IcePHP::getCommunicator(TSRMLS_D)
zval*
IcePHP::getCommunicatorZval(TSRMLS_D)
{
- zval **zv = 0;
- zend_hash_find(&EG(symbol_table), "ICE", sizeof("ICE"), reinterpret_cast<void **>(&zv));
- assert(zv);
+ void* data = 0;
+ zend_hash_find(&EG(symbol_table), "ICE", sizeof("ICE"), &data);
+ assert(data);
+ zval **zv = reinterpret_cast<zval**>(data);
return *zv;
}
diff --git a/php/src/IcePHP/Marshal.cpp b/php/src/IcePHP/Marshal.cpp
index 8589499e3ba..2a489f073bb 100644
--- a/php/src/IcePHP/Marshal.cpp
+++ b/php/src/IcePHP/Marshal.cpp
@@ -779,10 +779,11 @@ IcePHP::SequenceMarshaler::marshal(zval* zv, const Ice::OutputStreamPtr& os, Obj
case Slice::Builtin::KindBool:
{
Ice::BoolSeq seq(sz);
- zval** val;
Ice::Int i = 0;
- while(zend_hash_get_current_data_ex(arr, reinterpret_cast<void**>(&val), &pos) != FAILURE)
+ void* data;
+ while(zend_hash_get_current_data_ex(arr, &data, &pos) != FAILURE)
{
+ zval** val = reinterpret_cast<zval**>(data);
if(!pm->validate(*val TSRMLS_CC))
{
return false;
@@ -796,10 +797,11 @@ IcePHP::SequenceMarshaler::marshal(zval* zv, const Ice::OutputStreamPtr& os, Obj
case Slice::Builtin::KindByte:
{
Ice::ByteSeq seq(sz);
- zval** val;
Ice::Int i = 0;
- while(zend_hash_get_current_data_ex(arr, reinterpret_cast<void**>(&val), &pos) != FAILURE)
+ void* data;
+ while(zend_hash_get_current_data_ex(arr, &data, &pos) != FAILURE)
{
+ zval** val = reinterpret_cast<zval**>(data);
if(!pm->validate(*val TSRMLS_CC))
{
return false;
@@ -815,10 +817,11 @@ IcePHP::SequenceMarshaler::marshal(zval* zv, const Ice::OutputStreamPtr& os, Obj
case Slice::Builtin::KindShort:
{
Ice::ShortSeq seq(sz);
- zval** val;
Ice::Int i = 0;
- while(zend_hash_get_current_data_ex(arr, reinterpret_cast<void**>(&val), &pos) != FAILURE)
+ void* data;
+ while(zend_hash_get_current_data_ex(arr, &data, &pos) != FAILURE)
{
+ zval** val = reinterpret_cast<zval**>(data);
if(!pm->validate(*val TSRMLS_CC))
{
return false;
@@ -834,10 +837,11 @@ IcePHP::SequenceMarshaler::marshal(zval* zv, const Ice::OutputStreamPtr& os, Obj
case Slice::Builtin::KindInt:
{
Ice::IntSeq seq(sz);
- zval** val;
Ice::Int i = 0;
- while(zend_hash_get_current_data_ex(arr, reinterpret_cast<void**>(&val), &pos) != FAILURE)
+ void* data;
+ while(zend_hash_get_current_data_ex(arr, &data, &pos) != FAILURE)
{
+ zval** val = reinterpret_cast<zval**>(data);
if(!pm->validate(*val TSRMLS_CC))
{
return false;
@@ -853,10 +857,11 @@ IcePHP::SequenceMarshaler::marshal(zval* zv, const Ice::OutputStreamPtr& os, Obj
case Slice::Builtin::KindLong:
{
Ice::LongSeq seq(sz);
- zval** val;
Ice::Int i = 0;
- while(zend_hash_get_current_data_ex(arr, reinterpret_cast<void**>(&val), &pos) != FAILURE)
+ void* data;
+ while(zend_hash_get_current_data_ex(arr, &data, &pos) != FAILURE)
{
+ zval** val = reinterpret_cast<zval**>(data);
if(!pm->validate(*val TSRMLS_CC))
{
return false;
@@ -885,10 +890,11 @@ IcePHP::SequenceMarshaler::marshal(zval* zv, const Ice::OutputStreamPtr& os, Obj
case Slice::Builtin::KindFloat:
{
Ice::FloatSeq seq(sz);
- zval** val;
Ice::Int i = 0;
- while(zend_hash_get_current_data_ex(arr, reinterpret_cast<void**>(&val), &pos) != FAILURE)
+ void* data;
+ while(zend_hash_get_current_data_ex(arr, &data, &pos) != FAILURE)
{
+ zval** val = reinterpret_cast<zval**>(data);
if(!pm->validate(*val TSRMLS_CC))
{
return false;
@@ -903,10 +909,11 @@ IcePHP::SequenceMarshaler::marshal(zval* zv, const Ice::OutputStreamPtr& os, Obj
case Slice::Builtin::KindDouble:
{
Ice::DoubleSeq seq(sz);
- zval** val;
Ice::Int i = 0;
- while(zend_hash_get_current_data_ex(arr, reinterpret_cast<void**>(&val), &pos) != FAILURE)
+ void* data;
+ while(zend_hash_get_current_data_ex(arr, &data, &pos) != FAILURE)
{
+ zval** val = reinterpret_cast<zval**>(data);
if(!pm->validate(*val TSRMLS_CC))
{
return false;
@@ -921,10 +928,11 @@ IcePHP::SequenceMarshaler::marshal(zval* zv, const Ice::OutputStreamPtr& os, Obj
case Slice::Builtin::KindString:
{
Ice::StringSeq seq(sz);
- zval** val;
Ice::Int i = 0;
- while(zend_hash_get_current_data_ex(arr, reinterpret_cast<void**>(&val), &pos) != FAILURE)
+ void* data;
+ while(zend_hash_get_current_data_ex(arr, &data, &pos) != FAILURE)
{
+ zval** val = reinterpret_cast<zval**>(data);
if(!pm->validate(*val TSRMLS_CC))
{
return false;
@@ -955,9 +963,10 @@ IcePHP::SequenceMarshaler::marshal(zval* zv, const Ice::OutputStreamPtr& os, Obj
{
os->writeSize(sz);
- zval** val;
- while(zend_hash_get_current_data_ex(arr, reinterpret_cast<void**>(&val), &pos) != FAILURE)
+ void* data;
+ while(zend_hash_get_current_data_ex(arr, &data, &pos) != FAILURE)
{
+ zval** val = reinterpret_cast<zval**>(data);
if(!_elementMarshaler->marshal(*val, os, m TSRMLS_CC))
{
return false;
@@ -1231,14 +1240,14 @@ IcePHP::MemberMarshaler::MemberMarshaler(const string& name, const MarshalerPtr&
bool
IcePHP::MemberMarshaler::marshal(zval* zv, const Ice::OutputStreamPtr& os, ObjectMap& m TSRMLS_DC)
{
- zval** val;
- if(zend_hash_find(Z_OBJPROP_P(zv), const_cast<char*>(_name.c_str()), _name.length() + 1,
- reinterpret_cast<void**>(&val)) == FAILURE)
+ void* data;
+ if(zend_hash_find(Z_OBJPROP_P(zv), const_cast<char*>(_name.c_str()), _name.length() + 1, &data) == FAILURE)
{
php_error_docref(0 TSRMLS_CC, E_ERROR, "member `%s' is not defined", _name.c_str());
return false;
}
+ zval** val = reinterpret_cast<zval**>(data);
return _marshaler->marshal(*val, os, m TSRMLS_CC);;
}
@@ -1470,13 +1479,15 @@ IcePHP::NativeDictionaryMarshaler::marshal(zval* zv, const Ice::OutputStreamPtr&
HashTable* arr = Z_ARRVAL_P(zv);
HashPosition pos;
- zval** val;
+ void* data;
os->writeSize(zend_hash_num_elements(arr));
zend_hash_internal_pointer_reset_ex(arr, &pos);
- while(zend_hash_get_current_data_ex(arr, reinterpret_cast<void**>(&val), &pos) != FAILURE)
+ while(zend_hash_get_current_data_ex(arr, &data, &pos) != FAILURE)
{
+ zval** val = reinterpret_cast<zval**>(data);
+
//
// Get the key (which can be a long or a string).
//
diff --git a/php/src/IcePHP/Profile.cpp b/php/src/IcePHP/Profile.cpp
index a240bd63a5e..d0a4d039075 100644
--- a/php/src/IcePHP/Profile.cpp
+++ b/php/src/IcePHP/Profile.cpp
@@ -893,11 +893,12 @@ ZEND_FUNCTION(Ice_loadProfileWithArgs)
//
Ice::StringSeq args;
HashTable* arr = Z_ARRVAL_P(zv);
+ void* data;
HashPosition pos;
- zval** val;
zend_hash_internal_pointer_reset_ex(arr, &pos);
- while(zend_hash_get_current_data_ex(arr, reinterpret_cast<void**>(&val), &pos) != FAILURE)
+ while(zend_hash_get_current_data_ex(arr, &data, &pos) != FAILURE)
{
+ zval** val = reinterpret_cast<zval**>(data);
if(Z_TYPE_PP(val) != IS_STRING)
{
php_error_docref(0 TSRMLS_CC, E_ERROR, "argument array must contain strings");
diff --git a/php/src/IcePHP/Proxy.cpp b/php/src/IcePHP/Proxy.cpp
index 7f0f1b77725..81c297b2ab0 100644
--- a/php/src/IcePHP/Proxy.cpp
+++ b/php/src/IcePHP/Proxy.cpp
@@ -919,11 +919,13 @@ ZEND_FUNCTION(Ice_ObjectPrx_ice_endpoints)
HashTable* arr = Z_ARRVAL_P(zv);
HashPosition pos;
- zval** val;
+ void* data;
zend_hash_internal_pointer_reset_ex(arr, &pos);
- while(zend_hash_get_current_data_ex(arr, reinterpret_cast<void**>(&val), &pos) != FAILURE)
+ while(zend_hash_get_current_data_ex(arr, &data, &pos) != FAILURE)
{
+ zval** val = reinterpret_cast<zval**>(data);
+
if(Z_TYPE_PP(val) != IS_OBJECT)
{
php_error_docref(0 TSRMLS_CC, E_ERROR, "expected an element of type Ice_Endpoint");
diff --git a/php/src/IcePHP/Util.cpp b/php/src/IcePHP/Util.cpp
index d4c720207c4..d8816c1562d 100644
--- a/php/src/IcePHP/Util.cpp
+++ b/php/src/IcePHP/Util.cpp
@@ -114,14 +114,16 @@ IcePHP::extractIdentity(zval* zv, Ice::Identity& id TSRMLS_DC)
//
// Category is optional, but name is required.
//
- zval** categoryVal = 0;
- zval** nameVal;
- if(zend_hash_find(Z_OBJPROP_P(zv), "name", sizeof("name"), reinterpret_cast<void**>(&nameVal)) == FAILURE)
+ void* categoryData = 0;
+ void* nameData;
+ if(zend_hash_find(Z_OBJPROP_P(zv), "name", sizeof("name"), &nameData) == FAILURE)
{
php_error_docref(0 TSRMLS_CC, E_ERROR, "identity value does not contain member `name'");
return false;
}
- zend_hash_find(Z_OBJPROP_P(zv), "category", sizeof("category"), reinterpret_cast<void**>(&categoryVal));
+ zend_hash_find(Z_OBJPROP_P(zv), "category", sizeof("category"), &categoryData);
+ zval** categoryVal = reinterpret_cast<zval**>(categoryData);
+ zval** nameVal = reinterpret_cast<zval**>(nameData);
if(Z_TYPE_PP(nameVal) != IS_STRING)
{
@@ -179,12 +181,14 @@ IcePHP::extractContext(zval* zv, Ice::Context& ctx TSRMLS_DC)
}
HashTable* arr = Z_ARRVAL_P(zv);
+ void* data;
HashPosition pos;
- zval** val;
zend_hash_internal_pointer_reset_ex(arr, &pos);
- while(zend_hash_get_current_data_ex(arr, reinterpret_cast<void**>(&val), &pos) != FAILURE)
+ while(zend_hash_get_current_data_ex(arr, &data, &pos) != FAILURE)
{
+ zval** val = reinterpret_cast<zval**>(data);
+
//
// Get the key (which can be a long or a string).
//