summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2014-07-21 09:42:01 -0230
committerDwayne Boone <dwayne@zeroc.com>2014-07-21 09:42:01 -0230
commitb30759dfccb7f844d3957bc09d68d0077a334e6a (patch)
tree7c3f9f8bccc3f674aedd70014a1925755937d5d9
parentFixed build failure on Windows 64bits (diff)
downloadice-b30759dfccb7f844d3957bc09d68d0077a334e6a.tar.bz2
ice-b30759dfccb7f844d3957bc09d68d0077a334e6a.tar.xz
ice-b30759dfccb7f844d3957bc09d68d0077a334e6a.zip
ICE-5481 use size_type for Stream startSize() return type
-rw-r--r--cpp/include/Ice/BasicStream.h6
-rw-r--r--cpp/include/Ice/Stream.h4
-rw-r--r--cpp/src/Ice/StreamI.cpp4
-rw-r--r--cpp/src/Ice/StreamI.h4
-rw-r--r--php/src/IcePHP/Types.cpp8
-rw-r--r--py/modules/IcePy/Types.cpp8
-rw-r--r--rb/src/IceRuby/Types.cpp12
7 files changed, 21 insertions, 25 deletions
diff --git a/cpp/include/Ice/BasicStream.h b/cpp/include/Ice/BasicStream.h
index a6e75c7fbd5..75e43ad8026 100644
--- a/cpp/include/Ice/BasicStream.h
+++ b/cpp/include/Ice/BasicStream.h
@@ -400,14 +400,14 @@ public:
Ice::Int readAndCheckSeqSize(int);
- int startSize()
+ size_type startSize()
{
- int pos = static_cast<Ice::Int>(b.size());
+ size_type pos = b.size();
write(Ice::Int(0));
return pos;
}
- void endSize(int pos)
+ void endSize(size_type pos)
{
assert(pos >= 0);
rewrite(static_cast<Ice::Int>(b.size()) - pos - 4, pos);
diff --git a/cpp/include/Ice/Stream.h b/cpp/include/Ice/Stream.h
index 830442ddde7..638fb80d705 100644
--- a/cpp/include/Ice/Stream.h
+++ b/cpp/include/Ice/Stream.h
@@ -351,8 +351,8 @@ public:
virtual bool writeOptional(Int, OptionalFormat) = 0;
- virtual int startSize() = 0;
- virtual void endSize(int pos) = 0;
+ virtual size_type startSize() = 0;
+ virtual void endSize(size_type pos) = 0;
template<typename T> inline void write(const T& v)
{
diff --git a/cpp/src/Ice/StreamI.cpp b/cpp/src/Ice/StreamI.cpp
index eb3ae4f13ae..f889f71b8be 100644
--- a/cpp/src/Ice/StreamI.cpp
+++ b/cpp/src/Ice/StreamI.cpp
@@ -729,14 +729,14 @@ OutputStreamI::rewrite(Int sz, size_type p)
_os->rewrite(sz, p);
}
-int
+OutputStream::size_type
OutputStreamI::startSize()
{
return _os->startSize();
}
void
-OutputStreamI::endSize(int pos)
+OutputStreamI::endSize(OutputStream::size_type pos)
{
_os->endSize(pos);
}
diff --git a/cpp/src/Ice/StreamI.h b/cpp/src/Ice/StreamI.h
index 88f9893c96f..103d917cc3e 100644
--- a/cpp/src/Ice/StreamI.h
+++ b/cpp/src/Ice/StreamI.h
@@ -183,8 +183,8 @@ public:
virtual size_type pos();
virtual void rewrite(Int, size_type);
- virtual int startSize();
- virtual void endSize(int pos);
+ virtual size_type startSize();
+ virtual void endSize(size_type pos);
private:
diff --git a/php/src/IcePHP/Types.cpp b/php/src/IcePHP/Types.cpp
index dae6ffd2268..202f2d785f4 100644
--- a/php/src/IcePHP/Types.cpp
+++ b/php/src/IcePHP/Types.cpp
@@ -1357,7 +1357,7 @@ IcePHP::StructInfo::marshal(zval* zv, const Ice::OutputStreamPtr& os, ObjectMap*
assert(Z_TYPE_P(zv) == IS_OBJECT); // validate() should have caught this.
assert(Z_OBJCE_P(zv) == zce); // validate() should have caught this.
- int sizePos = -1;
+ Ice::OutputStream::size_type sizePos = 0;
if(optional)
{
if(_variableLength)
@@ -1528,7 +1528,7 @@ IcePHP::SequenceInfo::marshal(zval* zv, const Ice::OutputStreamPtr& os, ObjectMa
sz = static_cast<Ice::Int>(zend_hash_num_elements(arr));
}
- int sizePos = -1;
+ Ice::OutputStream::size_type sizePos = 0;
if(optional)
{
if(elementType->variableLength())
@@ -2088,7 +2088,7 @@ IcePHP::DictionaryInfo::marshal(zval* zv, const Ice::OutputStreamPtr& os, Object
sz = static_cast<Ice::Int>(zend_hash_num_elements(arr));
}
- int sizePos = -1;
+ Ice::OutputStream::size_type sizePos = 0;
if(optional)
{
if(_variableLength)
@@ -2771,7 +2771,7 @@ IcePHP::ProxyInfo::optionalFormat() const
void
IcePHP::ProxyInfo::marshal(zval* zv, const Ice::OutputStreamPtr& os, ObjectMap*, bool optional TSRMLS_DC)
{
- int sizePos = -1;
+ Ice::OutputStream::size_type sizePos = 0;
if(optional)
{
sizePos = os->startSize();
diff --git a/py/modules/IcePy/Types.cpp b/py/modules/IcePy/Types.cpp
index d6b864fe244..59998c784c0 100644
--- a/py/modules/IcePy/Types.cpp
+++ b/py/modules/IcePy/Types.cpp
@@ -1266,7 +1266,7 @@ IcePy::StructInfo::marshal(PyObject* p, const Ice::OutputStreamPtr& os, ObjectMa
{
assert(PyObject_IsInstance(p, pythonType.get()) == 1); // validate() should have caught this.
- int sizePos = 0;
+ Ice::OutputStream::size_type sizePos = 0;
if(optional)
{
if(_variableLength)
@@ -1437,7 +1437,7 @@ IcePy::SequenceInfo::marshal(PyObject* p, const Ice::OutputStreamPtr& os, Object
{
PrimitiveInfoPtr pi = PrimitiveInfoPtr::dynamicCast(elementType);
- int sizePos = 0;
+ Ice::OutputStream::size_type sizePos = 0;
if(optional)
{
if(elementType->variableLength())
@@ -2516,7 +2516,7 @@ IcePy::DictionaryInfo::marshal(PyObject* p, const Ice::OutputStreamPtr& os, Obje
const Ice::Int sz = p == Py_None ? 0 : static_cast<Ice::Int>(PyDict_Size(p));
- int sizePos = 0;
+ Ice::OutputStream::size_type sizePos = 0;
if(optional)
{
if(_variableLength)
@@ -2995,7 +2995,7 @@ IcePy::ProxyInfo::optionalFormat() const
void
IcePy::ProxyInfo::marshal(PyObject* p, const Ice::OutputStreamPtr& os, ObjectMap*, bool optional, const Ice::StringSeq*)
{
- int sizePos = 0;
+ Ice::OutputStream::size_type sizePos = 0;
if(optional)
{
sizePos = os->startSize();
diff --git a/rb/src/IceRuby/Types.cpp b/rb/src/IceRuby/Types.cpp
index 6fd703c20a8..76c8724c0e0 100644
--- a/rb/src/IceRuby/Types.cpp
+++ b/rb/src/IceRuby/Types.cpp
@@ -992,7 +992,7 @@ IceRuby::StructInfo::marshal(VALUE p, const Ice::OutputStreamPtr& os, ObjectMap*
{
assert(callRuby(rb_obj_is_kind_of, p, rubyClass) == Qtrue); // validate() should have caught this.
- int sizePos = -1;
+ Ice::OutputStream::size_type sizePos = -1;
if(optional)
{
if(_variableLength)
@@ -1019,7 +1019,6 @@ IceRuby::StructInfo::marshal(VALUE p, const Ice::OutputStreamPtr& os, ObjectMap*
if(optional && _variableLength)
{
- assert(sizePos != -1);
os->endSize(sizePos);
}
}
@@ -1155,7 +1154,7 @@ IceRuby::SequenceInfo::marshal(VALUE p, const Ice::OutputStreamPtr& os, ObjectMa
volatile VALUE arr = Qnil;
- int sizePos = -1;
+ Ice::OutputStream::size_type sizePos = -1;
if(optional)
{
if(elementType->variableLength())
@@ -1222,7 +1221,6 @@ IceRuby::SequenceInfo::marshal(VALUE p, const Ice::OutputStreamPtr& os, ObjectMa
if(optional && elementType->variableLength())
{
- assert(sizePos != -1);
os->endSize(sizePos);
}
}
@@ -1725,7 +1723,7 @@ IceRuby::DictionaryInfo::marshal(VALUE p, const Ice::OutputStreamPtr& os, Object
sz = RHASH_SIZE(hash);
}
- int sizePos = -1;
+ Ice::OutputStream::size_type sizePos = 0;
if(optional)
{
if(_variableLength)
@@ -1754,7 +1752,6 @@ IceRuby::DictionaryInfo::marshal(VALUE p, const Ice::OutputStreamPtr& os, Object
if(optional && _variableLength)
{
- assert(sizePos != -1);
os->endSize(sizePos);
}
}
@@ -2307,7 +2304,7 @@ IceRuby::ProxyInfo::optionalFormat() const
void
IceRuby::ProxyInfo::marshal(VALUE p, const Ice::OutputStreamPtr& os, ObjectMap*, bool optional)
{
- int sizePos = -1;
+ Ice::OutputStream::size_type sizePos = -1;
if(optional)
{
sizePos = os->startSize();
@@ -2325,7 +2322,6 @@ IceRuby::ProxyInfo::marshal(VALUE p, const Ice::OutputStreamPtr& os, ObjectMap*,
if(optional)
{
- assert(sizePos != -1);
os->endSize(sizePos);
}
}