From 30ae63d16daed9faaa3d9165589e00e70386a4f5 Mon Sep 17 00:00:00 2001 From: Bernard Normier Date: Sat, 10 May 2008 15:40:51 -0400 Subject: Partial fix for bug #3141 (build warnings) --- py/modules/IcePy/Operation.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'py/modules/IcePy/Operation.cpp') diff --git a/py/modules/IcePy/Operation.cpp b/py/modules/IcePy/Operation.cpp index 843a9ba44ca..6189a462bec 100644 --- a/py/modules/IcePy/Operation.cpp +++ b/py/modules/IcePy/Operation.cpp @@ -1399,9 +1399,10 @@ IcePy::SyncBlobjectInvocation::invoke(PyObject* args) // Use the array API to avoid copying the data. // #if PY_VERSION_HEX < 0x02050000 - const Ice::Byte* mem; + const char* charBuf = 0; Py_ssize_t sz = inParams->ob_type->tp_as_buffer->bf_getcharbuffer( - inParams, 0, reinterpret_cast(&mem)); + inParams, 0, &charBuf); + const Ice::Byte* mem = reinterpret_cast(charBuf); #else Ice::Byte* mem; Py_ssize_t sz = inParams->ob_type->tp_as_buffer->bf_getcharbuffer( @@ -1523,9 +1524,10 @@ IcePy::AsyncBlobjectInvocation::invoke(PyObject* args) // Use the array API to avoid copying the data. // #if PY_VERSION_HEX < 0x02050000 - const Ice::Byte* mem; + const char* charBuf = 0; Py_ssize_t sz = inParams->ob_type->tp_as_buffer->bf_getcharbuffer( - inParams, 0, reinterpret_cast(&mem)); + inParams, 0, &charBuf); + const Ice::Byte* mem = reinterpret_cast(charBuf); #else Ice::Byte* mem; Py_ssize_t sz = inParams->ob_type->tp_as_buffer->bf_getcharbuffer( @@ -2198,8 +2200,10 @@ IcePy::BlobjectUpcall::response(PyObject* args) } #if PY_VERSION_HEX < 0x02050000 - const Ice::Byte* mem; - Py_ssize_t sz = arg->ob_type->tp_as_buffer->bf_getcharbuffer(arg, 0, reinterpret_cast(&mem)); + const char* charBuf = 0; + Py_ssize_t sz = arg->ob_type->tp_as_buffer->bf_getcharbuffer(arg, 0, &charBuf); + const Ice::Byte* mem = reinterpret_cast(charBuf); + #else Ice::Byte* mem; Py_ssize_t sz = arg->ob_type->tp_as_buffer->bf_getcharbuffer(arg, 0, reinterpret_cast(&mem)); -- cgit v1.2.3