aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/libshiboken/basewrapper.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2017-06-09 10:06:35 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2017-06-09 09:11:47 +0000
commite25ed8d09b67a0b67dee4239513c00a6b7e701a4 (patch)
treee145da42c4e0cc1d2a40e24c313bc34d5de51817 /sources/shiboken2/libshiboken/basewrapper.cpp
parent8dd21fcb2c9f0366b3d298781c8a852363a4df22 (diff)
libshiboken: Fix/Silence some MSVC warnings
autodecref.h(110): warning C4522: 'Shiboken::AutoDecRef': multiple assignment operators specified autodecref.h(78): warning C4800: 'PyObject *const ': forcing value to bool 'true' or 'false' (performance warning) conversions.h(282): warning C4800: 'long': forcing value to bool 'true' or 'false' (performance warning) basewrapper.cpp(625): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning) basewrapper.cpp(654): warning C4800: 'SpecialCastFunction': forcing value to bool 'true' or 'false' (performance warning) basewrapper.cpp(1014): warning C4800: 'Shiboken::ParentInfo *': forcing value to bool 'true' or 'false' (performance warning) basewrapper.cpp(1044): warning C4800: 'void *': forcing value to bool 'true' or 'false' (performance warning) helper.cpp(56): warning C4244: 'initializing': conversion from 'Py_ssize_t' to 'int', possible loss of data shibokenbuffer.cpp(46): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning) Change-Id: If1517fde8e7670f258a56f6d845a66ebb3d82141 Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/libshiboken/basewrapper.cpp')
-rw-r--r--sources/shiboken2/libshiboken/basewrapper.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/sources/shiboken2/libshiboken/basewrapper.cpp b/sources/shiboken2/libshiboken/basewrapper.cpp
index b3f99a8a5..b319fea7e 100644
--- a/sources/shiboken2/libshiboken/basewrapper.cpp
+++ b/sources/shiboken2/libshiboken/basewrapper.cpp
@@ -624,7 +624,7 @@ namespace ObjectType
bool checkType(PyTypeObject* type)
{
- return PyType_IsSubtype(type, reinterpret_cast<PyTypeObject*>(&SbkObject_Type));
+ return PyType_IsSubtype(type, reinterpret_cast<PyTypeObject*>(&SbkObject_Type)) != 0;
}
bool isUserType(PyTypeObject* type)
@@ -653,7 +653,7 @@ void* callExternalCppConversion(SbkObjectType*, PyObject*) { return 0; }
bool hasCast(SbkObjectType* type)
{
- return type->d->mi_specialcast;
+ return type->d->mi_specialcast != 0;
}
void* cast(SbkObjectType* sourceType, SbkObject* obj, PyTypeObject* targetType)
@@ -1013,7 +1013,7 @@ void makeValid(SbkObject* self)
bool hasParentInfo(SbkObject* pyObj)
{
- return pyObj->d->parentInfo;
+ return pyObj->d->parentInfo != 0;
}
void* cppPointer(SbkObject* pyObj, PyTypeObject* desiredType)
@@ -1043,7 +1043,7 @@ bool setCppPointer(SbkObject* sbkObj, PyTypeObject* desiredType, void* cptr)
if (reinterpret_cast<SbkObjectType*>(Py_TYPE(sbkObj))->d->is_multicpp)
idx = getTypeIndexOnHierarchy(Py_TYPE(sbkObj), desiredType);
- bool alreadyInitialized = sbkObj->d->cptr[idx];
+ const bool alreadyInitialized = sbkObj->d->cptr[idx] != 0;
if (alreadyInitialized)
PyErr_SetString(PyExc_RuntimeError, "You can't initialize an object twice!");
else