diff options
author | Mark Spruiell <mes@zeroc.com> | 2007-05-22 21:08:19 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2007-05-22 21:08:19 +0000 |
commit | 34d78a9cc184c6779158d5a508e0b03fa13b17cb (patch) | |
tree | b05b24331403f2f3aa72d99658abb04d8bbd2f55 /php/src/IcePHP/Marshal.cpp | |
parent | bug 1854 - adding int64ToString (diff) | |
download | ice-34d78a9cc184c6779158d5a508e0b03fa13b17cb.tar.bz2 ice-34d78a9cc184c6779158d5a508e0b03fa13b17cb.tar.xz ice-34d78a9cc184c6779158d5a508e0b03fa13b17cb.zip |
bug 1854 - GCC 64-bit warnings
Diffstat (limited to 'php/src/IcePHP/Marshal.cpp')
-rw-r--r-- | php/src/IcePHP/Marshal.cpp | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/php/src/IcePHP/Marshal.cpp b/php/src/IcePHP/Marshal.cpp index f077611f678..0671b484da8 100644 --- a/php/src/IcePHP/Marshal.cpp +++ b/php/src/IcePHP/Marshal.cpp @@ -13,6 +13,7 @@ #include <Util.h> #include <IceUtil/InputUtil.h> +#include <IceUtil/OutputUtil.h> #include <IceUtil/ScopedArray.h> using namespace std; @@ -691,13 +692,8 @@ IcePHP::PrimitiveMarshaler::unmarshal(zval* zv, const Ice::InputStreamPtr& is TS // if(sizeof(Ice::Long) > sizeof(long) && (val < LONG_MIN || val > LONG_MAX)) { - char buf[64]; -#ifdef WIN32 - sprintf(buf, "%I64d", val); -#else - sprintf(buf, "%lld", val); -#endif - ZVAL_STRING(zv, buf, 1); + string str = IceUtil::int64ToString(val); + ZVAL_STRINGL(zv, const_cast<char*>(str.c_str()), str.length(), 1); } else { @@ -1047,13 +1043,8 @@ IcePHP::SequenceMarshaler::unmarshal(zval* zv, const Ice::InputStreamPtr& is TSR // if(sizeof(Ice::Long) > sizeof(long) && (*p < LONG_MIN || *p > LONG_MAX)) { - char buf[64]; -#ifdef WIN32 - sprintf(buf, "%I64d", *p); -#else - sprintf(buf, "%lld", *p); -#endif - ZVAL_STRING(val, buf, 1); + string str = IceUtil::int64ToString(*p); + ZVAL_STRINGL(val, const_cast<char*>(str.c_str()), str.length(), 1); } else { |