+ fix clang warnings
This commit is contained in:
parent
e4768c1c75
commit
36dd6946a9
2
src/3rdParty/salomesmesh/CMakeLists.txt
vendored
2
src/3rdParty/salomesmesh/CMakeLists.txt
vendored
|
@ -8,6 +8,8 @@ SET(SMESH_VERSION_TWEAK 2)
|
|||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
set(CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -Wno-sign-compare -Wno-reorder -Wno-switch -Wno-unused-variable -Wno-unused-but-set-variable -Wno-comment")
|
||||
elseif(CMAKE_COMPILER_IS_CLANGXX)
|
||||
set(CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -Wno-sign-compare -Wno-reorder -Wno-switch -Wno-unused-variable -Wno-unused-private-field -Wno-unused-function -Wno-sometimes-uninitialized -Wno-overloaded-virtual -Wno-dynamic-class-memaccess -Wno-comment")
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_CLANGXX)
|
||||
|
|
|
@ -135,12 +135,12 @@ PythonWrapper::PythonWrapper()
|
|||
|
||||
bool PythonWrapper::toCString(const Py::Object& pyobject, std::string& str)
|
||||
{
|
||||
if (PyUnicode_Check(pyobject.ptr())) {
|
||||
if (PyUnicode_Check(pyobject.ptr())) {
|
||||
PyObject* unicode = PyUnicode_AsUTF8String(pyobject.ptr());
|
||||
str = PyString_AsString(unicode);
|
||||
Py_DECREF(unicode);
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else if (PyString_Check(pyobject.ptr())) {
|
||||
str = PyString_AsString(pyobject.ptr());
|
||||
return true;
|
||||
|
@ -243,34 +243,34 @@ bool PythonWrapper::loadGuiModule()
|
|||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
void PythonWrapper::createChildrenNameAttributes(PyObject* root, QObject* object)
|
||||
{
|
||||
|
||||
void PythonWrapper::createChildrenNameAttributes(PyObject* root, QObject* object)
|
||||
{
|
||||
#if defined (HAVE_SHIBOKEN) && defined(HAVE_PYSIDE)
|
||||
Q_FOREACH (QObject* child, object->children()) {
|
||||
const QByteArray name = child->objectName().toLocal8Bit();
|
||||
|
||||
if (!name.isEmpty() && !name.startsWith("_") && !name.startsWith("qt_")) {
|
||||
bool hasAttr = PyObject_HasAttrString(root, name.constData());
|
||||
if (!hasAttr) {
|
||||
Shiboken::AutoDecRef pyChild(Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkPySide_QtCoreTypes[SBK_QOBJECT_IDX], child));
|
||||
PyObject_SetAttrString(root, name.constData(), pyChild);
|
||||
}
|
||||
createChildrenNameAttributes(root, child);
|
||||
}
|
||||
createChildrenNameAttributes(root, child);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
Q_FOREACH (QObject* child, object->children()) {
|
||||
const QByteArray name = child->objectName().toLocal8Bit();
|
||||
|
||||
if (!name.isEmpty() && !name.startsWith("_") && !name.startsWith("qt_")) {
|
||||
bool hasAttr = PyObject_HasAttrString(root, name.constData());
|
||||
if (!hasAttr) {
|
||||
Shiboken::AutoDecRef pyChild(Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkPySide_QtCoreTypes[SBK_QOBJECT_IDX], child));
|
||||
PyObject_SetAttrString(root, name.constData(), pyChild);
|
||||
}
|
||||
createChildrenNameAttributes(root, child);
|
||||
}
|
||||
createChildrenNameAttributes(root, child);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void PythonWrapper::setParent(PyObject* pyWdg, QObject* parent)
|
||||
{
|
||||
#if defined (HAVE_SHIBOKEN) && defined(HAVE_PYSIDE)
|
||||
if (parent) {
|
||||
Shiboken::AutoDecRef pyParent(Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkPySide_QtGuiTypes[SBK_QWIDGET_IDX], parent));
|
||||
Shiboken::Object::setParent(pyParent, pyWdg);
|
||||
}
|
||||
#endif
|
||||
if (parent) {
|
||||
Shiboken::AutoDecRef pyParent(Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkPySide_QtGuiTypes[SBK_QWIDGET_IDX], parent));
|
||||
Shiboken::Object::setParent(pyParent, pyWdg);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// ----------------------------------------------------
|
||||
|
@ -631,8 +631,8 @@ Py::Object UiLoaderPy::load(const Py::Tuple& args)
|
|||
wrap.loadGuiModule();
|
||||
|
||||
Py::Object pyWdg = wrap.fromQWidget(widget);
|
||||
wrap.createChildrenNameAttributes(*pyWdg, widget);
|
||||
wrap.setParent(*pyWdg, parent);
|
||||
wrap.createChildrenNameAttributes(*pyWdg, widget);
|
||||
wrap.setParent(*pyWdg, parent);
|
||||
return pyWdg;
|
||||
}
|
||||
}
|
||||
|
@ -1053,7 +1053,7 @@ bool PyResource::connect(const char* sender, const char* signal, PyObject* cb)
|
|||
}
|
||||
|
||||
if (objS) {
|
||||
SignalConnect* sc = new SignalConnect(this, cb, objS);
|
||||
SignalConnect* sc = new SignalConnect(this, cb);
|
||||
mySingals.push_back(sc);
|
||||
return QObject::connect(objS, sigStr.toAscii(), sc, SLOT ( onExecute() ) );
|
||||
}
|
||||
|
@ -1267,8 +1267,8 @@ PyObject *PyResource::setValue(PyObject *args)
|
|||
|
||||
// ----------------------------------------------------
|
||||
|
||||
SignalConnect::SignalConnect( Base::PyObjectBase* res, PyObject* cb, QObject* sender)
|
||||
: myResource(res), myCallback(cb), mySender(sender)
|
||||
SignalConnect::SignalConnect(Base::PyObjectBase* res, PyObject* cb)
|
||||
: myResource(res), myCallback(cb)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -445,7 +445,7 @@ class SignalConnect : public QObject
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SignalConnect( Base::PyObjectBase* res, PyObject* cb, QObject* sender);
|
||||
SignalConnect(Base::PyObjectBase* res, PyObject* cb);
|
||||
~SignalConnect();
|
||||
|
||||
public Q_SLOTS:
|
||||
|
@ -454,7 +454,6 @@ public Q_SLOTS:
|
|||
private:
|
||||
PyObject* myResource;
|
||||
PyObject* myCallback;
|
||||
QObject* mySender;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------
|
||||
|
|
|
@ -600,8 +600,6 @@ Matrix4<Real>& Matrix4<Real>::operator*= (Real fScalar)
|
|||
template <class Real>
|
||||
Matrix4<Real>& Matrix4<Real>::operator/= (Real fScalar)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (fScalar != (Real)0.0)
|
||||
{
|
||||
Real fInvScalar = ((Real)1.0)/fScalar;
|
||||
|
|
|
@ -705,7 +705,7 @@ void TRational<N>::ConvertTo (double& rdValue) const
|
|||
return;
|
||||
}
|
||||
|
||||
unsigned int auiResult[2], uiSave = 0;
|
||||
unsigned int auiResult[2];
|
||||
|
||||
// compute the sign of the number
|
||||
int iS0 = m_kNumer.GetSign(), iS1 = m_kDenom.GetSign();
|
||||
|
|
Loading…
Reference in New Issue
Block a user