+ Better support of clang, fix issues discovered by clang
This commit is contained in:
parent
3b6d07833d
commit
2d4110b0f3
|
@ -45,7 +45,11 @@ endif(WIN32)
|
|||
|
||||
# ================================================================================
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||
set(CMAKE_COMPILER_IS_CLANGXX TRUE)
|
||||
endif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX)
|
||||
include(cMake/ConfigureChecks.cmake)
|
||||
configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||
add_definitions(-DHAVE_CONFIG_H)
|
||||
|
@ -55,7 +59,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
|||
if(UNIX)
|
||||
# SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined")
|
||||
endif(UNIX)
|
||||
endif(CMAKE_COMPILER_IS_GNUCXX)
|
||||
endif(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX)
|
||||
|
||||
|
||||
# ================================================================================
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#ifndef BASE_UNITSSCHEMA_H
|
||||
#define BASE_UNITSSCHEMA_H
|
||||
|
||||
|
||||
|
||||
#include <string>
|
||||
#include <QString>
|
||||
|
@ -50,6 +50,7 @@ enum UnitSystem {
|
|||
class UnitsSchema
|
||||
{
|
||||
public:
|
||||
virtual ~UnitsSchema(){}
|
||||
/** get called if this schema gets activated.
|
||||
* Here its theoretical possible that you can change the static factors
|
||||
* for certain Units (e.g. mi = 1,8km instead of mi=1.6km).
|
||||
|
@ -59,7 +60,7 @@ public:
|
|||
virtual void resetSchemaUnits(void){}
|
||||
|
||||
/// this methode translate the quantity in a string as the user may expect it
|
||||
virtual QString schemaTranslate(Base::Quantity quant,double &factor,QString &unitString)=0;
|
||||
virtual QString schemaTranslate(Base::Quantity quant,double &factor,QString &unitString)=0;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -411,5 +411,7 @@ void Vector3<_Precision>::TransformToCoordinateSystem (const Vector3 &rclBase,
|
|||
}
|
||||
|
||||
// explicit template instantiation
|
||||
namespace Base {
|
||||
template class BaseExport Vector3<float>;
|
||||
template class BaseExport Vector3<double>;
|
||||
}
|
||||
|
|
|
@ -88,20 +88,20 @@ public:
|
|||
// Export an instance of the base class (to avoid warning C4275, see also
|
||||
// C++ Language Reference/General Rules and Limitations on MSDN for more details.)
|
||||
//
|
||||
// For compiler gcc4.1 we need to define the template class outside namespace 'Gui'
|
||||
// For compiler gcc4.1 we need to define the template class outside namespace 'Gui'
|
||||
// otherwise we get the compiler error:
|
||||
// 'explicit instantiation of 'class Base::Subject<const Gui::SelectionChanges&>'
|
||||
// in namespace 'Gui' (which does not enclose namespace 'Base')
|
||||
//
|
||||
// It seems that this costruct is not longer needed for gcc4.4 and even leads to
|
||||
// 'explicit instantiation of 'class Base::Subject<const Gui::SelectionChanges&>'
|
||||
// in namespace 'Gui' (which does not enclose namespace 'Base')
|
||||
//
|
||||
// It seems that this costruct is not longer needed for gcc4.4 and even leads to
|
||||
// errors under Mac OS X. Thus, we check for version between 4.1 and 4.4.
|
||||
// It seems that for Mac OS X this can be completely ignored
|
||||
|
||||
#if defined(__GNUC__) && defined(__GNUC_MINOR__) && !defined(FC_OS_MACOSX)
|
||||
#if defined(__GNUC__) && defined(__GNUC_MINOR__) && !defined(FC_OS_MACOSX)
|
||||
#define GNUC_VERSION (((__GNUC__)<<16)+((__GNUC_MINOR__)<<8))
|
||||
#if GNUC_VERSION >= 0x040100 && GNUC_VERSION < 0x040400
|
||||
template class GuiExport Base::Subject<const Gui::SelectionChanges&>;
|
||||
#endif
|
||||
template class GuiExport Base::Subject<const Gui::SelectionChanges&>;
|
||||
#endif
|
||||
#undef GNUC_VERSION
|
||||
#endif
|
||||
|
||||
|
@ -130,11 +130,11 @@ public:
|
|||
void detachSelection();
|
||||
|
||||
private:
|
||||
virtual void onSelectionChanged(const SelectionChanges& msg) = 0;
|
||||
|
||||
private:
|
||||
typedef boost::signals::connection Connection;
|
||||
Connection connectSelection;
|
||||
virtual void onSelectionChanged(const SelectionChanges& msg) = 0;
|
||||
|
||||
private:
|
||||
typedef boost::signals::connection Connection;
|
||||
Connection connectSelection;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -156,7 +156,7 @@ public:
|
|||
static void removeObserver(const Py::Object& obj);
|
||||
|
||||
private:
|
||||
void onSelectionChanged(const SelectionChanges& msg);
|
||||
void onSelectionChanged(const SelectionChanges& msg);
|
||||
void addSelection(const SelectionChanges&);
|
||||
void removeSelection(const SelectionChanges&);
|
||||
void setSelection(const SelectionChanges&);
|
||||
|
@ -165,8 +165,8 @@ private:
|
|||
void removePreselection(const SelectionChanges&);
|
||||
|
||||
private:
|
||||
Py::Object inst;
|
||||
static std::vector<SelectionObserverPython*> _instances;
|
||||
Py::Object inst;
|
||||
static std::vector<SelectionObserverPython*> _instances;
|
||||
};
|
||||
|
||||
/** SelectionGate
|
||||
|
@ -176,6 +176,7 @@ private:
|
|||
class SelectionGate
|
||||
{
|
||||
public:
|
||||
virtual ~SelectionGate(){}
|
||||
virtual bool allow(App::Document*,App::DocumentObject*, const char*)=0;
|
||||
};
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ TaskObjectName::TaskObjectName(App::DocumentObject *pcObject,QWidget *parent)
|
|||
|
||||
QObject::connect(ui->lineEdit_ObjectName,SIGNAL(textChanged (const QString&)),this,SLOT(TextChanged(const QString&)));
|
||||
|
||||
if(pcObject->Label.getValue() != "")
|
||||
if(strcmp(pcObject->Label.getValue(),"") != 0)
|
||||
ui->lineEdit_ObjectName->setText(QString::fromUtf8(pcObject->Label.getValue()));
|
||||
else
|
||||
ui->lineEdit_ObjectName->setText(QString::fromAscii(pcObject->getNameInDocument()));
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include "MeshKernel.h"
|
||||
#include "Elements.h"
|
||||
#include <Base/Matrix.h>
|
||||
#include <Base/Vector3D.h>
|
||||
#include <Base/Vector3D.h>
|
||||
#include <climits>
|
||||
|
||||
namespace MeshCore {
|
||||
|
@ -382,7 +382,7 @@ inline MeshFacetIterator& MeshFacetIterator::operator = (const MeshFacetIterator
|
|||
_bApply = rpI._bApply;
|
||||
_clTrf = rpI._clTrf;
|
||||
// dirty flat copy of reference
|
||||
memcpy((void*)&_rclMesh, &rpI._rclMesh, sizeof(&_rclMesh));
|
||||
memcpy((void*)&_rclMesh, &rpI._rclMesh, sizeof(MeshKernel*));
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@ -470,7 +470,7 @@ inline MeshPointIterator& MeshPointIterator::operator = (const MeshPointIterator
|
|||
_bApply = rpI._bApply;
|
||||
_clTrf = rpI._clTrf;
|
||||
// dirty flat copy of reference
|
||||
memcpy((void*)&_rclMesh, &rpI._rclMesh, sizeof(&_rclMesh));
|
||||
memcpy((void*)&_rclMesh, &rpI._rclMesh, sizeof(MeshKernel*));
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
|
|
@ -1031,11 +1031,11 @@ PyObject* MeshPy::splitEdge(PyObject *args)
|
|||
|
||||
const MeshCore::MeshKernel& kernel = getMeshObjectPtr()->getKernel();
|
||||
PY_TRY {
|
||||
if (facet < 0 || facet >= kernel.CountFacets()) {
|
||||
if (facet >= kernel.CountFacets()) {
|
||||
PyErr_SetString(PyExc_IndexError, "Facet index out of range");
|
||||
return NULL;
|
||||
}
|
||||
if (neighbour < 0 || neighbour >= kernel.CountFacets()) {
|
||||
if (neighbour >= kernel.CountFacets()) {
|
||||
PyErr_SetString(PyExc_IndexError, "Facet index out of range");
|
||||
return NULL;
|
||||
}
|
||||
|
@ -1072,7 +1072,7 @@ PyObject* MeshPy::splitFacet(PyObject *args)
|
|||
|
||||
const MeshCore::MeshKernel& kernel = getMeshObjectPtr()->getKernel();
|
||||
PY_TRY {
|
||||
if (facet < 0 || facet >= kernel.CountFacets()) {
|
||||
if (facet >= kernel.CountFacets()) {
|
||||
PyErr_SetString(PyExc_IndexError, "Facet index out of range");
|
||||
return NULL;
|
||||
}
|
||||
|
@ -1091,11 +1091,11 @@ PyObject* MeshPy::swapEdge(PyObject *args)
|
|||
|
||||
const MeshCore::MeshKernel& kernel = getMeshObjectPtr()->getKernel();
|
||||
PY_TRY {
|
||||
if (facet < 0 || facet >= kernel.CountFacets()) {
|
||||
if (facet >= kernel.CountFacets()) {
|
||||
PyErr_SetString(PyExc_IndexError, "Facet index out of range");
|
||||
return NULL;
|
||||
}
|
||||
if (neighbour < 0 || neighbour >= kernel.CountFacets()) {
|
||||
if (neighbour >= kernel.CountFacets()) {
|
||||
PyErr_SetString(PyExc_IndexError, "Facet index out of range");
|
||||
return NULL;
|
||||
}
|
||||
|
@ -1121,11 +1121,11 @@ PyObject* MeshPy::collapseEdge(PyObject *args)
|
|||
|
||||
const MeshCore::MeshKernel& kernel = getMeshObjectPtr()->getKernel();
|
||||
PY_TRY {
|
||||
if (facet < 0 || facet >= kernel.CountFacets()) {
|
||||
if (facet >= kernel.CountFacets()) {
|
||||
PyErr_SetString(PyExc_IndexError, "Facet index out of range");
|
||||
return NULL;
|
||||
}
|
||||
if (neighbour < 0 || neighbour >= kernel.CountFacets()) {
|
||||
if (neighbour >= kernel.CountFacets()) {
|
||||
PyErr_SetString(PyExc_IndexError, "Facet index out of range");
|
||||
return NULL;
|
||||
}
|
||||
|
@ -1150,7 +1150,7 @@ PyObject* MeshPy::collapseFacet(PyObject *args)
|
|||
return NULL;
|
||||
|
||||
PY_TRY {
|
||||
if (facet < 0 || facet >= getMeshObjectPtr()->countFacets()) {
|
||||
if (facet >= getMeshObjectPtr()->countFacets()) {
|
||||
PyErr_SetString(PyExc_IndexError, "Facet index out of range");
|
||||
return NULL;
|
||||
}
|
||||
|
@ -1173,7 +1173,7 @@ PyObject* MeshPy::insertVertex(PyObject *args)
|
|||
Base::Vector3f v((float)val->x,(float)val->y,(float)val->z);
|
||||
|
||||
PY_TRY {
|
||||
if (facet < 0 || facet >= getMeshObjectPtr()->countFacets()) {
|
||||
if (facet >= getMeshObjectPtr()->countFacets()) {
|
||||
PyErr_SetString(PyExc_IndexError, "Facet index out of range");
|
||||
return NULL;
|
||||
}
|
||||
|
@ -1196,7 +1196,7 @@ PyObject* MeshPy::snapVertex(PyObject *args)
|
|||
Base::Vector3f v((float)val->x,(float)val->y,(float)val->z);
|
||||
|
||||
PY_TRY {
|
||||
if (facet < 0 || facet >= getMeshObjectPtr()->countFacets()) {
|
||||
if (facet >= getMeshObjectPtr()->countFacets()) {
|
||||
PyErr_SetString(PyExc_IndexError, "Facet index out of range");
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -558,7 +558,7 @@ CmdRaytracingRender::CmdRaytracingRender()
|
|||
void CmdRaytracingRender::activated(int iMsg)
|
||||
{
|
||||
// determining render type
|
||||
const char* renderType;
|
||||
std::string renderType;
|
||||
unsigned int n1 = getSelection().countObjectsOfType(Raytracing::RayProject::getClassTypeId());
|
||||
if (n1 != 1) {
|
||||
unsigned int n2 = getSelection().countObjectsOfType(Raytracing::LuxProject::getClassTypeId());
|
||||
|
|
Loading…
Reference in New Issue
Block a user