fix -Wcatch-value=, fix -Wpedantic

This commit is contained in:
wmayer
2019-09-18 14:36:23 +02:00
parent b1dd1e61a7
commit 5746c37b7e
5 changed files with 16 additions and 16 deletions

View File

@@ -87,7 +87,7 @@ void _class_::init(void){\
/// define to implement a subclass of Base::BaseClass
#define TYPESYSTEM_SOURCE_TEMPLATE_T(_class_, _parentclass_) \
TYPESYSTEM_SOURCE_TEMPLATE_P(_class_);\
TYPESYSTEM_SOURCE_TEMPLATE_P(_class_)\
template<> void _class_::init(void){\
initSubclass(_class_::classTypeId, #_class_ , #_parentclass_, &(_class_::create) ); \
}

View File

@@ -1008,7 +1008,7 @@ void GestureNavigationStyle::onRollGesture(int direction)
code << "Gui.runCommand(\"" << cmd << "\")";
try {
Base::Interpreter().runString(code.str().c_str());
} catch (Base::PyException exc) {
} catch (Base::PyException& exc) {
exc.ReportException();
} catch (...) {
Base::Console().Error("GestureNavigationStyle::onRollGesture: unknown C++ exception when invoking command %s\n", cmd.c_str());

View File

@@ -2126,7 +2126,7 @@ gp_Pnt AttachEnginePoint::getProximityPoint(eMapMode mmode, const TopoDS_Shape&
return points.front();
}
}
catch (Standard_Failure) {
catch (const Standard_Failure&) {
// ignore
}

View File

@@ -274,11 +274,11 @@ PyObject* GeometryPy::getExtensionOfType(PyObject *args)
return cpy;
}
catch(Base::ValueError e) {
catch(const Base::ValueError& e) {
PyErr_SetString(PartExceptionOCCError, e.what());
return 0;
}
catch(std::bad_weak_ptr e) {
catch(const std::bad_weak_ptr& e) {
PyErr_SetString(PartExceptionOCCError, "Geometry extension does not exist anymore.");
return 0;
}
@@ -308,11 +308,11 @@ PyObject* GeometryPy::getExtensionOfName(PyObject *args)
return cpy;
}
catch(Base::ValueError e) {
catch(const Base::ValueError& e) {
PyErr_SetString(PartExceptionOCCError, e.what());
return 0;
}
catch(std::bad_weak_ptr e) {
catch(const std::bad_weak_ptr& e) {
PyErr_SetString(PartExceptionOCCError, "Geometry extension does not exist anymore.");
return 0;
}
@@ -334,7 +334,7 @@ PyObject* GeometryPy::hasExtensionOfType(PyObject *args)
try {
return Py::new_reference_to(Py::Boolean(this->getGeometryPtr()->hasExtension(type)));
}
catch(Base::ValueError e) {
catch(const Base::ValueError& e) {
PyErr_SetString(PartExceptionOCCError, e.what());
return 0;
}
@@ -359,7 +359,7 @@ PyObject* GeometryPy::hasExtensionOfName(PyObject *args)
try {
return Py::new_reference_to(Py::Boolean(this->getGeometryPtr()->hasExtension(std::string(o))));
}
catch(Base::ValueError e) {
catch(const Base::ValueError& e) {
PyErr_SetString(PartExceptionOCCError, e.what());
return 0;
}
@@ -382,7 +382,7 @@ PyObject* GeometryPy::deleteExtensionOfType(PyObject *args)
this->getGeometryPtr()->deleteExtension(type);
Py_Return;
}
catch(Base::ValueError e) {
catch(const Base::ValueError& e) {
PyErr_SetString(PartExceptionOCCError, e.what());
return 0;
}
@@ -408,7 +408,7 @@ PyObject* GeometryPy::deleteExtensionOfName(PyObject *args)
this->getGeometryPtr()->deleteExtension(std::string(o));
Py_Return;
}
catch(Base::ValueError e) {
catch(const Base::ValueError& e) {
PyErr_SetString(PartExceptionOCCError, e.what());
return 0;
}
@@ -447,7 +447,7 @@ PyObject* GeometryPy::getExtensions(PyObject *args)
return list;
}
catch(Base::ValueError e) {
catch(const Base::ValueError& e) {
PyErr_SetString(PartExceptionOCCError, e.what());
return 0;
}

View File

@@ -185,7 +185,7 @@ void GeometryObject::projectShape(const TopoDS_Shape& input,
brep_hlr->Hide();
}
catch (Standard_Failure e) {
catch (const Standard_Failure& e) {
Base::Console().Error("GO::projectShape - OCC error - %s - while projecting shape\n",
e.GetMessageString());
}
@@ -226,7 +226,7 @@ void GeometryObject::projectShape(const TopoDS_Shape& input,
BRepLib::BuildCurves3d(hidOutline);
BRepLib::BuildCurves3d(hidIso);
}
catch (Standard_Failure e) {
catch (const Standard_Failure& e) {
Base::Console().Error("GO::projectShape - OCC error - %s - while extracting edges\n",
e.GetMessageString());
}
@@ -286,7 +286,7 @@ void GeometryObject::projectShapeWithPolygonAlgo(const TopoDS_Shape& input,
}
brep_hlrPoly->Update();
}
catch (Standard_Failure e) {
catch (const Standard_Failure& e) {
Base::Console().Error("GO::projectShapeWithPolygonAlgo - OCC error - %s - while projecting shape\n",
e.GetMessageString());
}
@@ -318,7 +318,7 @@ void GeometryObject::projectShapeWithPolygonAlgo(const TopoDS_Shape& input,
BRepLib::BuildCurves3d(hidSeam);
BRepLib::BuildCurves3d(hidOutline);
}
catch (Standard_Failure e) {
catch (const Standard_Failure& e) {
Base::Console().Error("GO::projectShapeWithPolygonAlgo - OCC error - %s - while extracting edges\n",
e.GetMessageString());
}