Skip to content

Commit

Permalink
+ fix clang warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Oct 2, 2015
1 parent e4768c1 commit 36dd694
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 36 deletions.
2 changes: 2 additions & 0 deletions src/3rdParty/salomesmesh/CMakeLists.txt
Expand Up @@ -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)
Expand Down
62 changes: 31 additions & 31 deletions src/Gui/WidgetFactory.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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
}

// ----------------------------------------------------
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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() ) );
}
Expand Down Expand Up @@ -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)
{
}

Expand Down
3 changes: 1 addition & 2 deletions src/Gui/WidgetFactory.h
Expand Up @@ -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:
Expand All @@ -454,7 +454,6 @@ public Q_SLOTS:
private:
PyObject* myResource;
PyObject* myCallback;
QObject* mySender;
};

// ----------------------------------------------------
Expand Down
2 changes: 0 additions & 2 deletions src/Mod/Mesh/App/WildMagic4/Wm4Matrix4.inl
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Mesh/App/WildMagic4/Wm4TRational.inl
Expand Up @@ -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();
Expand Down

0 comments on commit 36dd694

Please sign in to comment.