From 0e444a554d848ea88371420e1e00181733fb56a9 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 19 Aug 2023 01:04:20 +0200 Subject: [PATCH] Import: modernize C++: return braced init list --- src/Mod/Import/App/ImportOCAF2.cpp | 6 +++--- src/Mod/Import/App/StepShapePyImp.cpp | 2 +- src/Mod/Import/App/dxf/ImpExpDxf.cpp | 2 +- src/Mod/Import/Gui/AppImportGuiPy.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Mod/Import/App/ImportOCAF2.cpp b/src/Mod/Import/App/ImportOCAF2.cpp index 42c0ffd8a4..6e6faa7253 100644 --- a/src/Mod/Import/App/ImportOCAF2.cpp +++ b/src/Mod/Import/App/ImportOCAF2.cpp @@ -991,7 +991,7 @@ TDF_Label ExportOCAF2::findComponent(const char *subname, TDF_Label label, TDF_L Handle(XCAFDoc_GraphNode) ret; if(labels.Length() && (FindSHUO(labels,ret) || aShapeTool->SetSHUO(labels,ret))) return ret->Label(); - return TDF_Label(); + return {}; } TDF_LabelSequence components; TDF_Label ref; @@ -1018,7 +1018,7 @@ TDF_Label ExportOCAF2::findComponent(const char *subname, TDF_Label label, TDF_L } } } - return TDF_Label(); + return {}; } void ExportOCAF2::setupObject(TDF_Label label, App::DocumentObject *obj, @@ -1191,7 +1191,7 @@ TDF_Label ExportOCAF2::exportObject(App::DocumentObject* parentObj, if(!obj || shape.isNull()) { if (obj) FC_WARN(obj->getFullName() << " has null shape"); - return TDF_Label(); + return {}; } //sub may contain more than one hierarchy, e.g. Assembly container may use diff --git a/src/Mod/Import/App/StepShapePyImp.cpp b/src/Mod/Import/App/StepShapePyImp.cpp index a2a2686313..752665c941 100644 --- a/src/Mod/Import/App/StepShapePyImp.cpp +++ b/src/Mod/Import/App/StepShapePyImp.cpp @@ -31,7 +31,7 @@ using namespace Import; // returns a string which represents the object e.g. when printed in python std::string StepShapePy::representation() const { - return std::string(""); + return {""}; } PyObject *StepShapePy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Python wrapper diff --git a/src/Mod/Import/App/dxf/ImpExpDxf.cpp b/src/Mod/Import/App/dxf/ImpExpDxf.cpp index e34955eecf..06c2ef363e 100644 --- a/src/Mod/Import/App/dxf/ImpExpDxf.cpp +++ b/src/Mod/Import/App/dxf/ImpExpDxf.cpp @@ -99,7 +99,7 @@ gp_Pnt ImpExpDxfRead::makePoint(const double* p) sp2 = sp2 * optionScaling; sp3 = sp3 * optionScaling; } - return gp_Pnt(sp1,sp2,sp3); + return {sp1,sp2,sp3}; } void ImpExpDxfRead::OnReadLine(const double* s, const double* e, bool /*hidden*/) diff --git a/src/Mod/Import/Gui/AppImportGuiPy.cpp b/src/Mod/Import/Gui/AppImportGuiPy.cpp index 49974d365f..778c08d1a8 100644 --- a/src/Mod/Import/Gui/AppImportGuiPy.cpp +++ b/src/Mod/Import/Gui/AppImportGuiPy.cpp @@ -534,7 +534,7 @@ private: auto vp = Gui::Application::Instance->getViewProvider(obj); if(vp) return vp->getElementColors(subname); - return std::map(); + return {}; } Py::Object exportOptions(const Py::Tuple& args)