From 7e39ae0d52ab50f382a4a8a7c3e3fdc702886fdd Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 26 Mar 2019 20:19:16 +0100 Subject: [PATCH] Stepfile: fix some minor review finding. --- scripts/StepImporter/CppGenerator.py | 8 ++-- .../StepImporter/StepReaderGen.cpp.template | 4 +- scripts/StepImporter/StepReaderGen.h.template | 37 +++++++++---------- 3 files changed, 24 insertions(+), 25 deletions(-) diff --git a/scripts/StepImporter/CppGenerator.py b/scripts/StepImporter/CppGenerator.py index 156f19523..13ee7642c 100644 --- a/scripts/StepImporter/CppGenerator.py +++ b/scripts/StepImporter/CppGenerator.py @@ -52,8 +52,8 @@ use_ifc_template = False input_step_template_h = 'StepReaderGen.h.template' input_step_template_cpp = 'StepReaderGen.cpp.template' -input_ifc_template_h = 'IFCReaderGen.h.template' -input_ifc_template_cpp = 'IFCReaderGen.cpp.template' +input_ifc_template_h = 'IFCReaderGen.h.template' +input_ifc_template_cpp = 'IFCReaderGen.cpp.template' cpp_keywords = "class" @@ -87,7 +87,7 @@ template_type = r""" template_stub_decl = '\tDECL_CONV_STUB({type});\n' template_schema = '\t\tSchemaEntry("{normalized_name}",&STEP::ObjectHelper<{type},{argcnt}>::Construct )\n' -template_schema_type = '\t\tSchemaEntry("{normalized_name}",NULL )\n' +template_schema_type = '\t\tSchemaEntry("{normalized_name}",nullptr )\n' template_converter = r""" // ----------------------------------------------------------------------------------------------------------- template <> size_t GenericFill<{type}>(const DB& db, const LIST& params, {type}* in) @@ -99,7 +99,7 @@ template_converter_prologue_a = '\tsize_t base = GenericFill(db,params,static_ca template_converter_prologue_b = '\tsize_t base = 0;\n' template_converter_check_argcnt = '\tif (params.GetSize() < {max_arg}) {{ throw STEP::TypeError("expected {max_arg} arguments to {name}"); }}' template_converter_code_per_field = r""" do {{ // convert the '{fieldname}' argument - boost::shared_ptr arg = params[base++];{handle_unset}{convert} + std::shared_ptr arg = params[base++];{handle_unset}{convert} }} while(0); """ template_allow_optional = r""" diff --git a/scripts/StepImporter/StepReaderGen.cpp.template b/scripts/StepImporter/StepReaderGen.cpp.template index 91705f7a4..f3240c099 100644 --- a/scripts/StepImporter/StepReaderGen.cpp.template +++ b/scripts/StepImporter/StepReaderGen.cpp.template @@ -2,7 +2,7 @@ Open Asset Import Library (ASSIMP) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, ASSIMP Development Team +Copyright (c) 2006-2019, ASSIMP Development Team All rights reserved. Redistribution and use of this software in source and binary forms, @@ -66,7 +66,7 @@ namespace STEP { // ----------------------------------------------------------------------------------------------------------- template <> size_t GenericFill(const STEP::DB& db, const LIST& params, NotImplemented* in) { - return 0; + return 0u; } diff --git a/scripts/StepImporter/StepReaderGen.h.template b/scripts/StepImporter/StepReaderGen.h.template index 5f9a2fd5d..7d4d77ef4 100644 --- a/scripts/StepImporter/StepReaderGen.h.template +++ b/scripts/StepImporter/StepReaderGen.h.template @@ -2,7 +2,7 @@ Open Asset Import Library (ASSIMP) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, ASSIMP Development Team +Copyright (c) 2006-2019, ASSIMP Development Team All rights reserved. Redistribution and use of this software in source and binary forms, @@ -47,25 +47,23 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. namespace Assimp { namespace StepFile { - using namespace STEP; - using namespace STEP::EXPRESS; - - - struct NotImplemented : public ObjectHelper { - - }; - - // ****************************************************************************** - // StepFile Custom data types - // ****************************************************************************** +using namespace STEP; +using namespace STEP::EXPRESS; + +struct NotImplemented : public ObjectHelper { + +}; + +// ****************************************************************************** +// StepFile Custom data types +// ****************************************************************************** {types} - - // ****************************************************************************** - // StepFile Entities - // ****************************************************************************** +// ****************************************************************************** +// StepFile Entities +// ****************************************************************************** {predefs} {entities} @@ -73,11 +71,12 @@ namespace StepFile { void GetSchema(EXPRESS::ConversionSchema& out); } //! StepFile + namespace STEP { - // ****************************************************************************** - // Converter stubs - // ****************************************************************************** +// ****************************************************************************** +// Converter stubs +// ****************************************************************************** #define DECL_CONV_STUB(type) template <> size_t GenericFill(const STEP::DB& db, const EXPRESS::LIST& params, IFC::type* in)