Skip to content

Commit

Permalink
fix -Wcatch-value=, fix -Wpedantic
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Sep 18, 2019
1 parent d0d92b0 commit 378de3c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/Base/BaseClass.h
Expand Up @@ -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) ); \
}
Expand Down
2 changes: 1 addition & 1 deletion src/Gui/GestureNavigationStyle.cpp
Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Part/App/Attacher.cpp
Expand Up @@ -2126,7 +2126,7 @@ gp_Pnt AttachEnginePoint::getProximityPoint(eMapMode mmode, const TopoDS_Shape&
return points.front();
}
}
catch (Standard_Failure) {
catch (const Standard_Failure&) {
// ignore
}

Expand Down
18 changes: 9 additions & 9 deletions src/Mod/Part/App/GeometryPyImp.cpp
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down
8 changes: 4 additions & 4 deletions src/Mod/TechDraw/App/GeometryObject.cpp
Expand Up @@ -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());
}
Expand Down Expand Up @@ -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());
}
Expand Down Expand Up @@ -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());
}
Expand Down Expand Up @@ -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());
}
Expand Down

0 comments on commit 378de3c

Please sign in to comment.