summaryrefslogtreecommitdiff
path: root/py/modules/IcePy/ObjectFactory.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2007-04-18 17:19:06 +0000
committerMark Spruiell <mes@zeroc.com>2007-04-18 17:19:06 +0000
commit1129b050e2c513f1d0b87d5b29bae7699e35778b (patch)
tree2c1076967a445ce0e26948a03f283337ea80aab4 /py/modules/IcePy/ObjectFactory.cpp
parentAdded nmake support for WinCE (diff)
downloadice-1129b050e2c513f1d0b87d5b29bae7699e35778b.tar.bz2
ice-1129b050e2c513f1d0b87d5b29bae7699e35778b.tar.xz
ice-1129b050e2c513f1d0b87d5b29bae7699e35778b.zip
bug 1493: removing use of NULL bug 1852: fixing compiler warnings bug 1853:
fixing compiler warnings bug 2098: change proxy factory methods to return object of same class
Diffstat (limited to 'py/modules/IcePy/ObjectFactory.cpp')
-rw-r--r--py/modules/IcePy/ObjectFactory.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/py/modules/IcePy/ObjectFactory.cpp b/py/modules/IcePy/ObjectFactory.cpp
index 4ad93108cc4..57fc313ec5b 100644
--- a/py/modules/IcePy/ObjectFactory.cpp
+++ b/py/modules/IcePy/ObjectFactory.cpp
@@ -51,7 +51,7 @@ IcePy::ObjectFactory::create(const string& id)
// Invoke the create method on the Python factory object.
//
PyObjectHandle obj = PyObject_CallMethod(p->second, STRCAST("create"), STRCAST("s"), id.c_str());
- if(obj.get() == NULL)
+ if(!obj.get())
{
throw AbortMarshaling();
}
@@ -73,10 +73,10 @@ IcePy::ObjectFactory::create(const string& id)
//
// Instantiate the object.
//
- PyTypeObject* type = (PyTypeObject*)info->pythonType.get();
+ PyTypeObject* type = reinterpret_cast<PyTypeObject*>(info->pythonType.get());
PyObjectHandle args = PyTuple_New(0);
- PyObjectHandle obj = type->tp_new(type, args.get(), NULL);
- if(obj.get() == NULL)
+ PyObjectHandle obj = type->tp_new(type, args.get(), 0);
+ if(!obj.get())
{
throw AbortMarshaling();
}
@@ -100,7 +100,7 @@ IcePy::ObjectFactory::destroy()
//
// Invoke the destroy method on each registered Python factory.
//
- PyObjectHandle obj = PyObject_CallMethod(p->second, STRCAST("destroy"), NULL);
+ PyObjectHandle obj = PyObject_CallMethod(p->second, STRCAST("destroy"), 0);
PyErr_Clear();
Py_DECREF(p->second);
}