summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2010-09-08 15:19:11 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2010-09-08 15:28:25 -0300
commit00208f2db1b257ea9354dc30655bc94799867e9c (patch)
treec2d112020785a675b1697c75dde43c2f82ccf6cf
parent0ba776e27a8c17727fa883eed29f60bc6c0bb7be (diff)
downloadshiboken-00208f2db1b257ea9354dc30655bc94799867e9c.tar.gz
shiboken-00208f2db1b257ea9354dc30655bc94799867e9c.tar.xz
shiboken-00208f2db1b257ea9354dc30655bc94799867e9c.zip
Remove unneeded casts that can hide errors.
-rw-r--r--libpyside/qsignal.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/libpyside/qsignal.cpp b/libpyside/qsignal.cpp
index 41cc71df..01daec68 100644
--- a/libpyside/qsignal.cpp
+++ b/libpyside/qsignal.cpp
@@ -112,7 +112,7 @@ PyTypeObject Signal_Type = {
0, /*tp_descr_get */
0, /*tp_descr_set */
0, /*tp_dictoffset */
- (initproc)signal_init, /*tp_init */
+ signal_init, /*tp_init */
0, /*tp_alloc */
PyType_GenericNew, /*tp_new */
signal_free, /*tp_free */
@@ -126,10 +126,10 @@ PyTypeObject Signal_Type = {
};
static PyMethodDef SignalInstance_methods[] = {
- {"connect", (PyCFunction)signal_instance_connect, METH_VARARGS|METH_KEYWORDS},
- {"disconnect", (PyCFunction)signal_instance_disconnect, METH_VARARGS},
- {"emit", (PyCFunction)signal_instance_emit, METH_VARARGS},
- {NULL} /* Sentinel */
+ {"connect", (PyCFunction)signal_instance_connect, METH_VARARGS|METH_KEYWORDS, 0},
+ {"disconnect", signal_instance_disconnect, METH_VARARGS, 0},
+ {"emit", signal_instance_emit, METH_VARARGS, 0},
+ {0} /* Sentinel */
};
static PyMappingMethods SignalInstance_as_mapping = {
@@ -234,11 +234,11 @@ void signalUpdateSource(PyObject* source)
{
Shiboken::AutoDecRef attrs(PyObject_Dir(source));
- for(int i = 0, i_max = PyList_GET_SIZE(attrs.object()); i < i_max; i++) {
+ for(int i = 0, iMax = PyList_GET_SIZE(attrs.object()); i < iMax; ++i) {
PyObject *attrName = PyList_GET_ITEM(attrs.object(), i);
- Shiboken::AutoDecRef attr(PyObject_GetAttr((PyObject*)source->ob_type, attrName));
- if (!attr.isNull() && (attr->ob_type == &Signal_Type)) {
- Shiboken::AutoDecRef signalInstance(reinterpret_cast<PyObject*>(PyObject_New(SignalInstanceData, &SignalInstance_Type)));
+ Shiboken::AutoDecRef attr(PyObject_GetAttr(reinterpret_cast<PyObject*>(source->ob_type), attrName));
+ if (attr->ob_type == &Signal_Type) {
+ Shiboken::AutoDecRef signalInstance(_PyObject_New(&SignalInstance_Type));
signal_instance_initialize(signalInstance, attrName, reinterpret_cast<SignalData*>(attr.object()), source, 0);
PyObject_SetAttr(source, attrName, signalInstance);
}