+ 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)
|
include(cMake/ConfigureChecks.cmake)
|
||||||
configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||||
add_definitions(-DHAVE_CONFIG_H)
|
add_definitions(-DHAVE_CONFIG_H)
|
||||||
|
@ -55,7 +59,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
# SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined")
|
# SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined")
|
||||||
endif(UNIX)
|
endif(UNIX)
|
||||||
endif(CMAKE_COMPILER_IS_GNUCXX)
|
endif(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX)
|
||||||
|
|
||||||
|
|
||||||
# ================================================================================
|
# ================================================================================
|
||||||
|
|
|
@ -50,6 +50,7 @@ enum UnitSystem {
|
||||||
class UnitsSchema
|
class UnitsSchema
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
virtual ~UnitsSchema(){}
|
||||||
/** get called if this schema gets activated.
|
/** get called if this schema gets activated.
|
||||||
* Here its theoretical possible that you can change the static factors
|
* Here its theoretical possible that you can change the static factors
|
||||||
* for certain Units (e.g. mi = 1,8km instead of mi=1.6km).
|
* for certain Units (e.g. mi = 1,8km instead of mi=1.6km).
|
||||||
|
@ -59,7 +60,7 @@ public:
|
||||||
virtual void resetSchemaUnits(void){}
|
virtual void resetSchemaUnits(void){}
|
||||||
|
|
||||||
/// this methode translate the quantity in a string as the user may expect it
|
/// 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
|
// explicit template instantiation
|
||||||
|
namespace Base {
|
||||||
template class BaseExport Vector3<float>;
|
template class BaseExport Vector3<float>;
|
||||||
template class BaseExport Vector3<double>;
|
template class BaseExport Vector3<double>;
|
||||||
|
}
|
||||||
|
|
|
@ -176,6 +176,7 @@ private:
|
||||||
class SelectionGate
|
class SelectionGate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
virtual ~SelectionGate(){}
|
||||||
virtual bool allow(App::Document*,App::DocumentObject*, const char*)=0;
|
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&)));
|
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()));
|
ui->lineEdit_ObjectName->setText(QString::fromUtf8(pcObject->Label.getValue()));
|
||||||
else
|
else
|
||||||
ui->lineEdit_ObjectName->setText(QString::fromAscii(pcObject->getNameInDocument()));
|
ui->lineEdit_ObjectName->setText(QString::fromAscii(pcObject->getNameInDocument()));
|
||||||
|
|
|
@ -382,7 +382,7 @@ inline MeshFacetIterator& MeshFacetIterator::operator = (const MeshFacetIterator
|
||||||
_bApply = rpI._bApply;
|
_bApply = rpI._bApply;
|
||||||
_clTrf = rpI._clTrf;
|
_clTrf = rpI._clTrf;
|
||||||
// dirty flat copy of reference
|
// dirty flat copy of reference
|
||||||
memcpy((void*)&_rclMesh, &rpI._rclMesh, sizeof(&_rclMesh));
|
memcpy((void*)&_rclMesh, &rpI._rclMesh, sizeof(MeshKernel*));
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -470,7 +470,7 @@ inline MeshPointIterator& MeshPointIterator::operator = (const MeshPointIterator
|
||||||
_bApply = rpI._bApply;
|
_bApply = rpI._bApply;
|
||||||
_clTrf = rpI._clTrf;
|
_clTrf = rpI._clTrf;
|
||||||
// dirty flat copy of reference
|
// dirty flat copy of reference
|
||||||
memcpy((void*)&_rclMesh, &rpI._rclMesh, sizeof(&_rclMesh));
|
memcpy((void*)&_rclMesh, &rpI._rclMesh, sizeof(MeshKernel*));
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1031,11 +1031,11 @@ PyObject* MeshPy::splitEdge(PyObject *args)
|
||||||
|
|
||||||
const MeshCore::MeshKernel& kernel = getMeshObjectPtr()->getKernel();
|
const MeshCore::MeshKernel& kernel = getMeshObjectPtr()->getKernel();
|
||||||
PY_TRY {
|
PY_TRY {
|
||||||
if (facet < 0 || facet >= kernel.CountFacets()) {
|
if (facet >= kernel.CountFacets()) {
|
||||||
PyErr_SetString(PyExc_IndexError, "Facet index out of range");
|
PyErr_SetString(PyExc_IndexError, "Facet index out of range");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (neighbour < 0 || neighbour >= kernel.CountFacets()) {
|
if (neighbour >= kernel.CountFacets()) {
|
||||||
PyErr_SetString(PyExc_IndexError, "Facet index out of range");
|
PyErr_SetString(PyExc_IndexError, "Facet index out of range");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -1072,7 +1072,7 @@ PyObject* MeshPy::splitFacet(PyObject *args)
|
||||||
|
|
||||||
const MeshCore::MeshKernel& kernel = getMeshObjectPtr()->getKernel();
|
const MeshCore::MeshKernel& kernel = getMeshObjectPtr()->getKernel();
|
||||||
PY_TRY {
|
PY_TRY {
|
||||||
if (facet < 0 || facet >= kernel.CountFacets()) {
|
if (facet >= kernel.CountFacets()) {
|
||||||
PyErr_SetString(PyExc_IndexError, "Facet index out of range");
|
PyErr_SetString(PyExc_IndexError, "Facet index out of range");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -1091,11 +1091,11 @@ PyObject* MeshPy::swapEdge(PyObject *args)
|
||||||
|
|
||||||
const MeshCore::MeshKernel& kernel = getMeshObjectPtr()->getKernel();
|
const MeshCore::MeshKernel& kernel = getMeshObjectPtr()->getKernel();
|
||||||
PY_TRY {
|
PY_TRY {
|
||||||
if (facet < 0 || facet >= kernel.CountFacets()) {
|
if (facet >= kernel.CountFacets()) {
|
||||||
PyErr_SetString(PyExc_IndexError, "Facet index out of range");
|
PyErr_SetString(PyExc_IndexError, "Facet index out of range");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (neighbour < 0 || neighbour >= kernel.CountFacets()) {
|
if (neighbour >= kernel.CountFacets()) {
|
||||||
PyErr_SetString(PyExc_IndexError, "Facet index out of range");
|
PyErr_SetString(PyExc_IndexError, "Facet index out of range");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -1121,11 +1121,11 @@ PyObject* MeshPy::collapseEdge(PyObject *args)
|
||||||
|
|
||||||
const MeshCore::MeshKernel& kernel = getMeshObjectPtr()->getKernel();
|
const MeshCore::MeshKernel& kernel = getMeshObjectPtr()->getKernel();
|
||||||
PY_TRY {
|
PY_TRY {
|
||||||
if (facet < 0 || facet >= kernel.CountFacets()) {
|
if (facet >= kernel.CountFacets()) {
|
||||||
PyErr_SetString(PyExc_IndexError, "Facet index out of range");
|
PyErr_SetString(PyExc_IndexError, "Facet index out of range");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (neighbour < 0 || neighbour >= kernel.CountFacets()) {
|
if (neighbour >= kernel.CountFacets()) {
|
||||||
PyErr_SetString(PyExc_IndexError, "Facet index out of range");
|
PyErr_SetString(PyExc_IndexError, "Facet index out of range");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -1150,7 +1150,7 @@ PyObject* MeshPy::collapseFacet(PyObject *args)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
PY_TRY {
|
PY_TRY {
|
||||||
if (facet < 0 || facet >= getMeshObjectPtr()->countFacets()) {
|
if (facet >= getMeshObjectPtr()->countFacets()) {
|
||||||
PyErr_SetString(PyExc_IndexError, "Facet index out of range");
|
PyErr_SetString(PyExc_IndexError, "Facet index out of range");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -1173,7 +1173,7 @@ PyObject* MeshPy::insertVertex(PyObject *args)
|
||||||
Base::Vector3f v((float)val->x,(float)val->y,(float)val->z);
|
Base::Vector3f v((float)val->x,(float)val->y,(float)val->z);
|
||||||
|
|
||||||
PY_TRY {
|
PY_TRY {
|
||||||
if (facet < 0 || facet >= getMeshObjectPtr()->countFacets()) {
|
if (facet >= getMeshObjectPtr()->countFacets()) {
|
||||||
PyErr_SetString(PyExc_IndexError, "Facet index out of range");
|
PyErr_SetString(PyExc_IndexError, "Facet index out of range");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -1196,7 +1196,7 @@ PyObject* MeshPy::snapVertex(PyObject *args)
|
||||||
Base::Vector3f v((float)val->x,(float)val->y,(float)val->z);
|
Base::Vector3f v((float)val->x,(float)val->y,(float)val->z);
|
||||||
|
|
||||||
PY_TRY {
|
PY_TRY {
|
||||||
if (facet < 0 || facet >= getMeshObjectPtr()->countFacets()) {
|
if (facet >= getMeshObjectPtr()->countFacets()) {
|
||||||
PyErr_SetString(PyExc_IndexError, "Facet index out of range");
|
PyErr_SetString(PyExc_IndexError, "Facet index out of range");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -558,7 +558,7 @@ CmdRaytracingRender::CmdRaytracingRender()
|
||||||
void CmdRaytracingRender::activated(int iMsg)
|
void CmdRaytracingRender::activated(int iMsg)
|
||||||
{
|
{
|
||||||
// determining render type
|
// determining render type
|
||||||
const char* renderType;
|
std::string renderType;
|
||||||
unsigned int n1 = getSelection().countObjectsOfType(Raytracing::RayProject::getClassTypeId());
|
unsigned int n1 = getSelection().countObjectsOfType(Raytracing::RayProject::getClassTypeId());
|
||||||
if (n1 != 1) {
|
if (n1 != 1) {
|
||||||
unsigned int n2 = getSelection().countObjectsOfType(Raytracing::LuxProject::getClassTypeId());
|
unsigned int n2 = getSelection().countObjectsOfType(Raytracing::LuxProject::getClassTypeId());
|
||||||
|
|
Loading…
Reference in New Issue
Block a user